Application Development 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: 

function module testing

Former Member
0 Kudos
75

i want to test the functionmodule AVAILABILITY_CHECK please let me know the parametrs to be passed

2 REPLIES 2

Former Member
0 Kudos
46

Debug the standard availability check in CO02, you will get the information you wanted.

arjun_thakur
Active Contributor
0 Kudos
46

hi prakesh,

It is very difficult to work with that FM outside VA01.

If you need to check the availability of a Material using a program, then you can make use of the following BAPI.

BAPI_MATERIAL_AVAILABILITY

This BAPI returns the Available quantity.

The import parameters of this BAPI are

Material

Plant

Unit

REPORT ZEX_AVAILIBILITYCHK .

Parameter: p_matnr like BAPIMATVP-MATNR,

p_werks like BAPIMATVP-WERKS,

p_unit like BAPIADMM-UNIT.

*Data: int_wmdvsx like BAPIWMDVS occurs 0 with header line,

  • int_wmdvex like BAPIWMDVE occurs 0 with header line.

Data: int_wmdvsx type table of bapiwmdvs with header line,

int_wmdvex type table of bapiwmdve with header line,

d_WKBST like BAPICM61V-WKBST.

CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'

EXPORTING

PLANT = p_werks

MATERIAL = p_matnr

UNIT = p_unit

  • CHECK_RULE =

  • STGE_LOC =

  • BATCH =

  • CUSTOMER =

  • DOC_NUMBER =

  • ITM_NUMBER =

  • WBS_ELEM =

  • STOCK_IND =

  • DEC_FOR_ROUNDING =

  • DEC_FOR_ROUNDING_X =

  • READ_ATP_LOCK =

  • READ_ATP_LOCK_X =

IMPORTING

  • ENDLEADTME =

AV_QTY_PLT = d_WKBST

  • DIALOGFLAG =

  • RETURN =

TABLES

WMDVSX = int_wmdvsx

WMDVEX = int_wmdvex

.

Write:/ d_WKBST.

If sy-subrc = 0.

endif.

i hope it helps

regrads

arjun