2007 May 31 7:32 PM
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
2007 May 31 8:23 PM
Hi,
What are the characteristics of I_ZDAILY_MVMT-ONHAND_VAL? Are you referencing bapi_on_hand with the section commented as being a correct value and I_ZDAILY_MVMT-ONHAND_VAL with the section not commented being an incorrect value?
Warren
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
2007 May 31 8:23 PM
Hi,
What are the characteristics of I_ZDAILY_MVMT-ONHAND_VAL? Are you referencing bapi_on_hand with the section commented as being a correct value and I_ZDAILY_MVMT-ONHAND_VAL with the section not commented being an incorrect value?
Warren
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |