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

a function/BAPI for co09

Former Member
0 Likes
2,984

hi guys:

A report need to show all of the matieral ATP qty by using storage location and plant as key. the resoult needs same as the result of CO09

is there a fuction or BAPI can be uesd.

many thanks

Chris

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,324

Hi,

Use the Bapi 'BAPI_MATERIAL_AVAILABILITY'.

Check the sample code

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.

Regards,

Raj.

3 REPLIES 3
Read only

Former Member
0 Likes
1,324

Hi,

Check this BAPi:BAPI_MATERIAL_AVAILABILITY

CO06 - BACKORDER_PROCESSING

FM AVAILABILITY_CHECK

Regards,

Kumar

Read only

Former Member
0 Likes
1,324

Hi,

The bapi is

BAPI_MATERIAL_AVAILABILITY.

Regards

Kiran Sure

Read only

Former Member
0 Likes
1,325

Hi,

Use the Bapi 'BAPI_MATERIAL_AVAILABILITY'.

Check the sample code

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.

Regards,

Raj.