Skip to Content
0
Former Member
Jul 02, 2007 at 01:04 PM

BAPI_MATERIAL_AVAILABILITY for ATP Quantity....

50 Views

Hi Experts,

I am using BAPI_MATERIAL_AVAILABILITY for mass materials in ABAP program,

but it takes very long time to execute ( 40,000 + materials ). If any other BAPI or FM available for ATP Quantity, so i can try ?

I am pasting my program, pl. check :

DATA: iwmdvsx TYPE TABLE OF bapiwmdvs WITH HEADER LINE,

iwmdvex TYPE TABLE OF bapiwmdve WITH HEADER LINE.

DATA: r TYPE bapireturn, " Check it once.

FQty TYPE MENGV13.

LOOP AT it_out.

CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'

EXPORTING

plant = 'HIP' "p_werks

material = it_out-matnr "p_matnr

unit = 'EA' "p_meins

stge_loc = 'BSR'

***********

IMPORTING

return = r

***********

TABLES

wmdvsx = iwmdvsx

wmdvex = iwmdvex.

***********

IF r-type is initial OR r-type = 'S'.

LOOP AT iwmdvex.

FQty = FQty + iwmdvex-com_qty.

ENDLOOP.

it_out-free_qty = FQty.

  • MODIFY it_out TRANSPORTING free_qty WHERE matnr = it_out-matnr.

modify it_out.

FQty = 0.

ENDIF.

***********

REFRESH iwmdvex.

************

CLEAR: it_out.

***********

REFRESH iwmdvsx.

ENDLOOP.

Message was edited by:

YUSUF BHORI