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

Using BAPI_MATERIAL_AVAILABILITY for storage-location-level

Weiskopf
Participant
0 Likes
3,789

Hello experts,

To determine the ATP quantity Iu2019m using the function module BAPI_MATERIAL_AVAILABILITY. I need to get the ATP quantity on storage-location-level; for this the following parameters are set:

- PLANT

- MATERIAL

- UNIT

- CHECK_RULE

- STGE_LOC

The result in table WMDVEX is for different storages locations the same, but in transaction CO09 I have different quantities for the storage locations.

How can I determine the ATP quantity on storage-location-level?

Thank you for your hint.

Regards,

Kurt.

3 REPLIES 3
Read only

brad_bohn
Active Contributor
0 Likes
1,451

I'm not aware of any differences between the BAPI and CO09 and I've been using the function for quite some time in transactions to pre-determine ATP quantities. Are you using checking rule 'A' for both? Example:


      CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
        EXPORTING
          plant      = gs_docitems-werks
          material   = gs_docitems-matnr
          unit       = gs_docitems-vrkme
          check_rule = 'A'
          stge_loc   = gs_docitems-lgort
        IMPORTING
          return     = ls_return
        TABLES
          wmdvsx     = lt_wmdvsx
          wmdvex     = lt_wmdvex.

      READ TABLE lt_wmdvex INTO ls_wmdvex INDEX 1.

      gs_docitems-atpqty = ls_wmdvex-com_qty.

Read only

0 Likes
1,451

Hallo Brad Bohn,

thank you for your suggestion.

Iu2019m using an own rule (as copy of rule A), the own rule donu2019t use purchase orders.

In CO09 I have the following ATP Quanties:

09.09.2009	BStand		1,775	0	259 
09.09.2009	LgBest	0001	785	0	459 
09.09.2009	LgBest	0002	989	0	452 
09.09.2009	LgBest	0003	22	0	20

The function module provides only 259 for each storage location.

There is another function module AVAILABILITY_CHECK. Can this function module also be used to determine ATP quantity?

Thank you & best regards,

Kurt.

Read only

brad_bohn
Active Contributor
0 Likes
1,451

Unfortunately, I can't really tell you what's wrong without looking at your configuration or the differences in the calls. If you trace both the BAPI and CO09 with Runtime Analysis, you'llsee that they both call function AVAILABILITY_CHECK. I would start by checking if rule 'A' produces different results, then by checking for any differences in the two calls or the handling of the results from the calls.