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

bapi_material_availability returning strange values

Former Member
0 Likes
5,785

Hi everyone,

I have been calling the BAPI bapi_material_availability and for certain units, two in fact, it returns 9999999999.000 for storage level availability, even though the plant level is accurate as well as CO09 for the storage location availability. I have seen this question asked while googling this problem but no solution... I'm sure this is just a simple newbie problem I am having.

Thanks for the help!

Alan

12 REPLIES 12
Read only

Former Member
0 Likes
3,317

Hi Alan

The reason is you might have not populated structure: WMDVSX.

BAPI_MATERIAL_AVAILABILITY is used to check if we can commit certain quantity on a particular date. If we do not specify the required quantity it takes that we have requested for the maximum, hence the output structure will have some 999.... value.

Try by populating structure WMDVSX with requested delivery date and requested quantity, then the output structure will have the requested quantity.

Hope this helps you understand the reason...

Kind Regards

Eswar

Read only

0 Likes
3,317

Hi Eswar,

Thank you for your response. I have populated the structure WMDVSX with a date and quantity. However, now the quantity always equals the amount requested, regardless of the actual available units in the storage location (If I enter in 100000, it returns 100000.)

Could there be any other values I am neglecting to pass correctly? (I am passing check rule, material, plant, storage location, stock type, unit, date requested, and quantity requested)

Thanks again for your help,

Alan

Read only

0 Likes
3,317

Hi Alan

FM: BAPI_MATERIAL_AVAILABILITY serves the quantity, we can serve for the requested quantity.

Suppose there is 48 quantity and we request for 50, the output structure WMDVEX will have requested quantity as 50 and committed quantity as 48.

If we do not specify any quantity, it suppose that we have requested the maximum quantity i.e 999....

Hope this helps you understand the purpose of FM: BAPI_MATERIAL_AVAILABILITY.

Regards

Eswar

Read only

0 Likes
3,317

Eswar,

Thank you for your help thus far.

When I call the function using a material, only for two materials is it returning a commited quantity as 9999999999, even though we only have a few thousand in inventory. Other materials return the available quantity as expected.

If I do enter a requested quantity, say 10000, the WMDVEX structure will still return 10000 requested AND 10000 commited, even though CO09 lists the availability of this material as well under 10000.

Could this be a problem with how the material is set in SAP?

Thanks,

Alan

Read only

0 Likes
3,317

Hello Alan,

I have a similar problem now.

If you already know the answer, could you please update this topic how you soloved ?

Thank you

Yuko

Read only

0 Likes
3,317

hi,

were you able to find out what's wrong?

cheers

Read only

0 Likes
3,317

hi, exactly the same as Maria Garingalao

Read only

Former Member
0 Likes
3,317

Alan,

I think your problem is in the content of the Input table WMDVSX. Here is a suggestion - find a material on your Test platform that doesn't have any stock. Write an amount on (a 501 or 561 or Phy. Inv. adjustment will do the trick) for say 10 units. Ensure your plant level data is showing a valid availability check i.e. something like 02 not KP. Test the BAPI in SE37 using the relevant data (and a checking rule 'A' - I am assuming this is a sales related check). In the Input table put in the required quantity of <u>12</u> units for delivery in, say, a weeks time. Now include the parameter of 'VC' in the field DELKZ. This is the RP element that relates to an order. What you should get back is a confirmed quantity on the required date, plus the additional 2 units to be delivered at the end of your RLT (Replen Lead Time). Check this in MD04, and go to Environment -> ATP Quantities.

Hope this does the business for you. Let me know if doesn't and I try and get back to you.

Cheers,

Paul...

Read only

Former Member
0 Likes
3,317

I am having a similar issue but only for some materials. I debugged and found out that this is based on the material master setting for field MARC-MTVFP (avail check group). If it's set to 'KP' there is no check so it just returns 999, but if it's set to '02' it does seem to work as expected, at least for me.

Read only

Former Member
0 Likes
3,317

Thank you a lot, I had the same problem and changing the value to 02 in the field MARC-MTVFP, the issue was resolved.

Read only

Former Member
0 Likes
3,317

Thank you a lot, I had the same problem and changing the value to 02 in the field MARC-MTVFP, the issue was resolved.

Read only

Former Member
3,317

Hi all,

I'm also getting the same strange output. But after debugging we found the reason for such output.

So the issue is completely at Master data maintenance level.

details as follows:

There are 2 Cases: 1. ATP check for the Req Date & Req Quant.

2. ATP check for entire Material-Plant-Storage Loc

In either of the cases: Initially a checks for the Stock level at plant level takes place, then depending on stock availability the BAPI calculates the ATP quant.

IF the stock at plant level = 0.

u2022 Then first RLT (Replenishment Lead Time) is calculated (as per Material master data) and then it calculates the RLT Date as follows

IF Req Date = Passed.

RLT Date = Req Date + RLT time

ELSE.

RLT Date = Current Date + RLT time

ENDIF.

Finally at the time of ATP calculation for Zero stock another check at this RLT date happens, as follows.

IF RLT Date GT (Req Date-If passed otherwise Rundate).

ATP check gets populated depending on current dateu2019s available stock.

ELSE.

Means The ATP check is irrelevant, as no stock available and no visibility for stock updation. So a hard coded u201C9999999999.000u201D value is being populated to output Quantity field.

ENDIF.

Edited by: 19740_SANTHI on Mar 1, 2010 7:33 AM

Edited by: 19740_SANTHI on Mar 1, 2010 7:35 AM