Quantcast
Channel: SCN : All Content - SAP GUI
Viewing all articles
Browse latest Browse all 3616

Material Change Report- Join CDHDR, CDPOS with Material Tables

$
0
0

Material Change report is based on two major tables, CDHDR and CDPOS.

 

CDHDR - Change document header

CDPOS - Change document items

 

For custom report, need to add material description with this. Material description is from MAKTX field in MAKT.

 

MAKT - Material Description

 

To achieve the Material change report, need to join the above 3 tables.

 

Join CDPOS, CDHDR with MARA, MAKT.

 

List the available columns in all the tables.

 

CDPOS table structure

1.png

 

CDHDR table structure


2.png

Join between CDHDR and CDPOS tables


3.png

MAKT table structure


41.png

Joining CDHDR & CDPOS with MAKT is the problem, we can't see any proper join except language key in SQVI. Joining is possible by identifying the table records.

 

Check all the above table records. CDHDR & CDPOS are huge tables so make sure to use properly.

 

Based on the data, we can join all the tables together.

 

Check the below SQL Script to join CDHDR & CDPOS tables.

 

SELECT TOP 10 * FROM SAPSR1.CDHDR C INNERJOIN SAPSR1.CDPOS CD

ON C.CHANGENR=CD.CHANGENR AND C.OBJECTID=CD.OBJECTID AND C.OBJECTCLAS=CD.OBJECTCLAS

 

Next step is to join with MAKT. Here ObjectID is matching with MATNR field. So objectID is nothing but Material Number.

 

SELECT TOP 10 C.OBJECTID as MaterialNo, MAKTX as MaterialDescription, C.UDATE, CD.VALUE_OLD, CD.VALUE_NEW

FROM SAPSR1.CDHDR C INNERJOIN SAPSR1.CDPOS CD

ON C.CHANGENR=CD.CHANGENR AND C.OBJECTID=CD.OBJECTID

INNER JOIN SAPSR1.MAKT M

ON M.MATNR=C.OBJECTID

 

Check the below output

5.png


Viewing all articles
Browse latest Browse all 3616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>