Skip to Content
0
Former Member
May 31, 2007 at 06:32 PM

Regarding "BAPI_MATERIAL_AVAILABILITY" (important)

36 Views

Hi,

In my program, I use BAPI_MATERIAL_AVAILABILITY to get the <u><b>on-hand quantity in CSE.</b></u>

The following is my code:

CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'

EXPORTING

plant = I_ZDAILY_MVMT-WERKS

material = I_ZDAILY_MVMT-MATNR

unit = 'CSE'

IMPORTING

av_qty_plt = bapi_onhand

return = return

TABLES

wmdvsx = atp1

wmdvex = atp2.

IF return IS INITIAL.

READ TABLE atp2 WITH TABLE KEY bdcnt = 0

req_date = sy-datum

com_date = sy-datum.

  • IF atp2-com_qty <> '9999999999.000'.

  • I_ZDAILY_MVMT-ONHAND_VAL = atp2-com_qty.

  • ELSE.

I_ZDAILY_MVMT-ONHAND_VAL = bapi_onhand.

  • ENDIF.

ENDIF.

-


The problem is that if the commented section above is uncommented, i get extremely large and unreliable data (for example 163,333,333,333,333 - which doesn't make sense.)

On the other hand, when the commented sections are left commented, i get data that seems real.

Which is the right way and what am i doing wrong? How do i check if the data that i am getting is correct?

Thanks,

John

  • Responses will be rewarded and highly appreciated