03-13-2007 3:30 PM
Hi everyone,
I have a question about stock overview.
When you enter transaction MMBE and enter a certain material, you will see, as a result, the stock overview for that material.
When you click on 'Choose (F2)' while selected the total unrestricted use quantity, a new window will appear. In this window some (calculated) stock quantities will be shown.
One of those items shows the 'Open Order qty'.
Does anybody has a query or FM which will give me this 'Open Order quantity', so I can use this value in another program/report.
Does anybody know how to calculate this quantity (which tables, fields, ... )
Many thanks in advance.
Guy.
03-13-2007 3:46 PM
Hi try this:
PARAMETERS: P_WERKS LIKE MARD-WERKS DEFAULT '0001'.
*
PARAMETERS: P_MATNR LIKE MARA-MATNR.
DATA MDEZX TYPE TABLE OF MDEZ WITH HEADER LINE.
START-OF-SELECTION.
*
CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API'
EXPORTING
MATNR = P_MATNR
WERKS = P_WERKS
TABLES
MDEZX = MDEZX
EXCEPTIONS
MATERIAL_PLANT_NOT_FOUND = 1
PLANT_NOT_FOUND = 2
OTHERS = 3.
.
IF SY-SUBRC <> 0.
WRITE: / SY-SUBRC.
EXIT.
ENDIF.
*
LOOP AT MDEZX.
WRITE: / MDEZX-DELB0, MDEZX-EXTRA, MDEZX-MNG01, MDEZX-MNG02.
ENDLOOP.
*
END-OF-SELECTION.
perhaps it helps.
Regards, Dieter
03-13-2007 3:46 PM
Hi try this:
PARAMETERS: P_WERKS LIKE MARD-WERKS DEFAULT '0001'.
*
PARAMETERS: P_MATNR LIKE MARA-MATNR.
DATA MDEZX TYPE TABLE OF MDEZ WITH HEADER LINE.
START-OF-SELECTION.
*
CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API'
EXPORTING
MATNR = P_MATNR
WERKS = P_WERKS
TABLES
MDEZX = MDEZX
EXCEPTIONS
MATERIAL_PLANT_NOT_FOUND = 1
PLANT_NOT_FOUND = 2
OTHERS = 3.
.
IF SY-SUBRC <> 0.
WRITE: / SY-SUBRC.
EXIT.
ENDIF.
*
LOOP AT MDEZX.
WRITE: / MDEZX-DELB0, MDEZX-EXTRA, MDEZX-MNG01, MDEZX-MNG02.
ENDLOOP.
*
END-OF-SELECTION.
perhaps it helps.
Regards, Dieter
03-14-2007 7:14 AM
Dear Mr. Gröhn,
This is what I need!!! Thanks you very much. I'm going to give you a BIG 10 for this one!
In my case I need the sum of all the values in the MNG01 fields in table MDEZX where DELB0 = PchOrd.
Thanks.