on 06-15-2009 12:06 PM
Hi,
I need BAPI like BAPI_MATERIAL_AVAILABILITY, but for all plants and materials.
The case is like this: We have 3 plants and we would like to have material availability by material for all plants in one report.
In our case we are looping in internal table with all materials and we import into BAPI parameters like material and plant.Based on this of course performance is too slow. How can we solve the problem. Below is my code.
LOOP AT it_final.
*--
CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
PLANT = '1100'
MATERIAL = it_final-matnr
UNIT = it_final-meins
CHECK_RULE = 'A'
IMPORTING
AV_QTY_PLT = d_WKBST
TABLES
WMDVSX = int_wmdvsx
WMDVEX = int_wmdvex.
it_final-labst1 = d_WKBST.
*modify it_final.
when '1200'.
CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
PLANT = '1200'
MATERIAL = it_final-matnr
UNIT = it_final-meins
CHECK_RULE = 'A'
IMPORTING
AV_QTY_PLT = d_WKBST
TABLES
WMDVSX = int_wmdvsx
WMDVEX = int_wmdvex.
it_final-labst2 = d_WKBST.
*modify it_final.
when '1300'.
CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
PLANT = '1300'
MATERIAL = it_final-matnr
UNIT = it_final-meins
CHECK_RULE = 'A'
IMPORTING
AV_QTY_PLT = d_WKBST
TABLES
WMDVSX = int_wmdvsx
WMDVEX = int_wmdvex.
it_final-labst3 = d_WKBST.
*----
record_tab-string+0(18) = it_final-matnr.
record_tab-string+18(40) = it_final-maktx.
record_tab-string+58(3) = it_final-meins.
record_tab-string+61(13) = it_final-labst1.
record_tab-string+74(13) = it_final-labst2.
record_tab-string+87(13) = it_final-labst3.
append record_tab.
*break skolev.
endloop.
Regards,
Stefan
Solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.