cancel
Showing results for 
Search instead for 
Did you mean: 

Material availability problem

Former Member
0 Kudos

Hi,

i have some problems with the material availability in my program.

We created a program to deliver open sales orders. So the user can build a list with open sales orders he want to deliver.

For this list, we check the material availability with the function module BAPI_MATERIAL_AVAILABILITY

and set the sum of the available material as default value for delivering.

For deilivery creation we use the function module BAPI_OUTB_DELIVERY_CREATE_SLS.

No our problem. The first function modules returns that 1700 pices are available. The user approved the delivery and the second function module tries to create the delivery with 1700 pic. But the BAPI_OUTB_DELIVERY_CREATE_SLS returns a error with message "Only 150 pic of material XXX available'.

Has anybody a solution for this problem? It`s not possible to submit the function BAPI_OUTB_DELIVERY_CREATE_SLS a check rule or anything else.

Regards,

Anton

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

This message was moderated.

paolbe
Explorer
0 Kudos

This message was moderated.

Former Member
0 Kudos

Also you said that you use : the material availability with the function module BAPI_MATERIAL_AVAILABILITY

and set the sum of the available material as default value for delivering.

You must check that the value returned by this BAPI (available material) should match with that in MD04

Former Member
0 Kudos

The problem might be that BAPI_MATERIAL_AVAILABILTY is not returning you the correct ATP quantity, it might not be considering the quantities locked by the other open sales orders, so it returns you a quantity of 1700 while actual available quantity is 150 and remaining quantity 1550 is locked in some open sales orders.

Check the material availability in CO09.

If this is the case then pass the following values to the parameters of BAPI

READ_ATP_LOCK = 'K'

READ_ATP_LOCK_X = 'X'

And call BAPI as CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY' DESTINATION 'NONE'.

Then it considers the quantity locked in Other documents and you will get the correct ATP quantity.

Hope this solves the problem.

Regards,

Sandeep

Former Member
0 Kudos

Hi,

My suggestion is that first you check the availability in MD04.

Every open sales order (even quotations & scheduling agreements) consumes the available quantity.

So what you see in MMBE is not always available.

If still face issue then revert.

Former Member
0 Kudos

Hi,

knows anybody a other function module to generate deliveries?

Regards,

Anton