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

Using BAPI_MATERIAL_AVAILABILITY ...

Former Member
0 Likes
959

Hi! I was trying to use BAPI_MATERIAL_AVAILABILITY to get the stock of my material, but I do not sure how to use it.

I'm setting

PLANT=POS1

MATERIAL=..

UNIT=...

WMDVSX-REQ_DATE = today

WMDVSX-REQ_QTY = 99999999

this returns me

AV_QTY_PLT with the correct value in stock for all warhouses of that plant

WMDVEX-EQ_QTY= 99999...

WMDVEX-COM_QTY = 222724 // not a clue what this number represents...

but if I call it with

PLANT=POS1

MATERIAL=...

UNIT=...

STGE_LOC=MOS1

WMDVSX-REQ_DATE = today

WMDVSX-REQ_QTY = 99999999

this returns me

AV_QTY_PLT with the same value for all warehouses, not just for MOS1

WMDVEX-EQ_QTY= 99999...

WMDVEX-COM_QTY = 993 // not a clue what this number represents neither...

I want to know how much material I had for sale today in just one Plant+Location...

thanks a lot

2 REPLIES 2
Read only

Former Member
0 Likes
593

Hi, we use it as follows:

call function 'BAPI_MATERIAL_AVAILABILITY'

exporting

plant = det_entrega-werks "Plant

material = p_matnr "Material number

unit = det_entrega-meins "Unit of measure to verify

stge_loc = det_entrega-lgort "Storage

tables

wmdvsx = tabla1

wmdvex = tabla_disp. "Result Available

if sy-subrc eq 0.

read table tabla_disp index 1.

if sy-subrc eq 0.

  • the avilable quantity it's on tabla_disp-com_qty

Read only

0 Likes
593

and in "tabla1" what are you filling in to send it to the bapi?