‎2008 May 14 7:18 AM
hi guys:
A report need to show all of the matieral ATP qty by using storage location and plant as key. the resoult needs same as the result of CO09
is there a fuction or BAPI can be uesd.
many thanks
Chris
‎2008 May 14 7:49 AM
Hi,
Use the Bapi 'BAPI_MATERIAL_AVAILABILITY'.
Check the sample code
DATA: iwmdvsx TYPE TABLE OF bapiwmdvs WITH HEADER LINE,
iwmdvex TYPE TABLE OF bapiwmdve WITH HEADER LINE.
DATA: r TYPE bapireturn, " Check it once.
FQty TYPE MENGV13.
LOOP AT it_out.
CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
plant = 'HIP' "p_werks
material = it_out-matnr "p_matnr
unit = 'EA' "p_meins
stge_loc = 'BSR'
***********
IMPORTING
return = r
***********
TABLES
wmdvsx = iwmdvsx
wmdvex = iwmdvex.
***********
IF r-type is initial OR r-type = 'S'.
LOOP AT iwmdvex.
FQty = FQty + iwmdvex-com_qty.
ENDLOOP.
it_out-free_qty = FQty.
MODIFY it_out TRANSPORTING free_qty WHERE matnr = it_out-matnr.
modify it_out.
FQty = 0.
ENDIF.
***********
REFRESH iwmdvex.
************
CLEAR: it_out.
***********
REFRESH iwmdvsx.
ENDLOOP.
Regards,
Raj.
‎2008 May 14 7:31 AM
Hi,
Check this BAPi:BAPI_MATERIAL_AVAILABILITY
CO06 - BACKORDER_PROCESSING
FM AVAILABILITY_CHECK
Regards,
Kumar
‎2008 May 14 7:44 AM
Hi,
The bapi is
BAPI_MATERIAL_AVAILABILITY.
Regards
Kiran Sure
‎2008 May 14 7:49 AM
Hi,
Use the Bapi 'BAPI_MATERIAL_AVAILABILITY'.
Check the sample code
DATA: iwmdvsx TYPE TABLE OF bapiwmdvs WITH HEADER LINE,
iwmdvex TYPE TABLE OF bapiwmdve WITH HEADER LINE.
DATA: r TYPE bapireturn, " Check it once.
FQty TYPE MENGV13.
LOOP AT it_out.
CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
plant = 'HIP' "p_werks
material = it_out-matnr "p_matnr
unit = 'EA' "p_meins
stge_loc = 'BSR'
***********
IMPORTING
return = r
***********
TABLES
wmdvsx = iwmdvsx
wmdvex = iwmdvex.
***********
IF r-type is initial OR r-type = 'S'.
LOOP AT iwmdvex.
FQty = FQty + iwmdvex-com_qty.
ENDLOOP.
it_out-free_qty = FQty.
MODIFY it_out TRANSPORTING free_qty WHERE matnr = it_out-matnr.
modify it_out.
FQty = 0.
ENDIF.
***********
REFRESH iwmdvex.
************
CLEAR: it_out.
***********
REFRESH iwmdvsx.
ENDLOOP.
Regards,
Raj.