‎2006 Oct 02 8:06 PM
Hi,
I want to find list of materials whose stock balance has changed for today with the condition of movement types(i have around 50 movement types)
For wht movement types a Material document gets created ???
List of Movement Types: '102','105','106','122','123','124','125','161','201','201','231','232','261','262','301','302','311','331','411','460','501','502','511','512','551','552'.
For all the above movement types does a material document get created ???????
Can i use mkpf and mseg??? i am jst worried that for all the above movement types if materail document gets created then my problem will be solved if i join both MKPF and MSEG table if not how can i get the list of materials whose stock has changed today with the above movement types...????
Thanks in adavance..
Sham.
‎2006 Oct 02 8:08 PM
You could just use SAP transaction MB51, this has a robust selection screen including, material, plant and movement types.
‎2006 Oct 02 8:11 PM
Joseph,
I have a custom report which need the material numbers....
Thanks,
Sham.
‎2006 Oct 02 8:24 PM
Hi,
You can find from tables CDHDR and CDPOS tables.
Thanks,
Ramakrishna
‎2006 Oct 02 9:50 PM
Ramakrishna,
I jst checked in tables.....
when we do a GI or GR it dosn't exist in tables CDHDR or CDPOS....
Thanks,
Sham.
‎2006 Oct 02 10:07 PM
Hi,
Try this..
TABLES: MSEG.
PARAMETERS: P_DATE LIKE MKPF-BUDAT.
SELECT-OPTIONS SO_BWART FOR MSEG-BWART.
SELECT-OPTIONS SO_MATNR FOR MSEG-MATNR.
DATA: BEGIN OF ITAB OCCURS 0,
MBLNR LIKE MKPF-MBLNR,
GJAHR LIKE MKPF-MJAHR,
MATNR LIKE MSEG-MATNR,
MENGE LIKE MSEG-MENGE,
MEINS LIKE MSEG-MEINS,
END OF ITAB.
SELECT AMBLNR AMJAHR BMATNR BMENGE B~MEINS
INTO TABLE ITAB
FROM MKPF AS A INNER JOIN MSEG AS B
ON AMBLNR = BMBLNR AND
AMJAHR = BMJAHR
WHERE A~BUDAT = P_DATE
AND B~BWART IN SO_BWART
AND B~MATNR IN SO_MATNR
<b> AND B~MENGU = 'X'.</b>
The field MENGU might be used to check if the
material movement has affected the stock..
Also I have used posting date = given date in P_DATE..
LOOP AT ITAB.
WRITE: / ITAB-MBLNR,
ITAB-GJAHR,
ITAB-MATNR,
ITAB-MENGE,
ITAB-MEINS.
ENDLOOP.
Thanks,
Naren