‎2015 Feb 26 8:32 AM
HI Expert,
There is a requirement to trigger the Material Availability check in the STO from BAPI_PO_CHANGE. The issue is we are not passing any chaangeable value so it is giving message No Data change.
Ideally to trigger material Availabiliity we don't have to pass any changed value , it is calculated from the internal ATP check logic. So how to do it programmatically.
Regards,
Kapil
‎2015 Feb 26 10:42 AM
Hi Kapil ,
This BAPI returns the Available quantity.
The code given below shows how to call this BAPI. The import parameters of this BAPI are
Material
Plant
Unit
---
REPORT ZEX_AVAILIBILITYCHK .
Parameter: p_matnr like BAPIMATVP-MATNR,
p_werks like BAPIMATVP-WERKS,
p_unit like BAPIADMM-UNIT.
*Data: int_wmdvsx like BAPIWMDVS occurs 0 with header line,
Data: int_wmdvsx type table of bapiwmdvs with header line, int_wmdvex type table of bapiwmdve with header line, d_WKBST like BAPICM61V-WKBST. CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY' EXPORTING PLANT = p_werks MATERIAL = p_matnr UNIT = p_unit
IMPORTING
AV_QTY_PLT = d_WKBST
TABLES
WMDVSX = int_wmdvsx
WMDVEX = int_wmdvex
.
Write:/ d_WKBST.
If sy-subrc = 0.
endif.
‎2015 Feb 26 10:54 AM
Hi Sabir,
Thanks for the reply !
But i want the same behavior like We do in ME22N -> Select the item & Click on material availability button. Later it will update the Schedule line for the PO line item.
Regards,
Kapil