Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_PO_CHANGE trigger Material Availability check

Former Member
0 Likes
1,407

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

2 REPLIES 2
Read only

sabirshah1
Participant
0 Likes
941

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,

  •      int_wmdvex like BAPIWMDVE 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

  •              CHECK_RULE               =
  •              STGE_LOC                 =
  •              BATCH                    =
  •              CUSTOMER                 =
  •              DOC_NUMBER               =
  •              ITM_NUMBER               =
  •              WBS_ELEM                 =
  •              STOCK_IND                =
  •              DEC_FOR_ROUNDING         =
  •              DEC_FOR_ROUNDING_X       =
  •              READ_ATP_LOCK            =
  •              READ_ATP_LOCK_X          =

            IMPORTING

  •              ENDLEADTME               =

               AV_QTY_PLT               = d_WKBST

  •              DIALOGFLAG               =
  •              RETURN                   =

             TABLES

               WMDVSX                   = int_wmdvsx

               WMDVEX                   = int_wmdvex

                     .

Write:/ d_WKBST.

If sy-subrc = 0.

endif.

Read only

0 Likes
941

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