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: 

Problem to get the availability of a product using BAPI_SALESORDER_SIMULATE

Former Member
0 Kudos

Hi folks,

I am trying to use BAPI_SALESORDER_SIMULATE to get the availability of a product but the BAPI does not send me the expected result :

I am trying to get the availability of a "to be discontinued" product. The available quantity of this product is 592 unit.

1/ Here is what I have in VA01 when I order a quantity of 1000 unit : [VA01|http://img689.imageshack.us/img689/4982/va012.jpg]

--> only 592 units available : OK !

2/ Here is what I have with BAPI_MATERIAL_AVAILABILITY when I order a quantity of 1000 unit : [Table WMDVEX|http://img707.imageshack.us/img707/9793/wmdvex2.jpg]

--> only 592 units available : OK !

3/ Here is what I have with BAPI_SALESORDER_SIMULATE when I order a quantity of 1000 unit : [TableORDER_SCHEDULE_EX|http://img101.imageshack.us/img101/830/orderscheduleex2.jpg]

--> Nothing available : not OK !

For information to run BAPI_SALESORDER_SIMULATE I am filling ORDER_HEADER_IN, ORDER_PARTNERS and ORDER_ITEMS_IN.

Thanks in advance for your help.

10 REPLIES 10

brad_bohn
Active Contributor
0 Kudos

For information to run BAPI_SALESORDER_SIMULATE I am filling ORDER_HEADER_IN, ORDER_PARTNERS and ORDER_ITEMS_IN.

What about ORDER_SCHEDULE_IN? You need to specify the required quantity for the item.

Former Member
0 Kudos

@Brad : I am filling the quantity in ORDER_ITEMS_IN-REQ_QTY. If in addition I fill ORDER_SCHEDULE_IN-REQ_QTY I have a strange behaviour : [the product quantity seems duplicated|http://img684.imageshack.us/img684/9007/orderscheduleex3.jpg] (new delivery schedule line number) ?!?

brad_bohn
Active Contributor
0 Kudos

Yes, in that function I see the same issue. You need to specify one or the other. I checked some of our calls and they don't specify the item quantity, just the schedule quantity. Unfortunately, I can confirm lines any which way it's done. Each time the results match the availability check and the BAPI results for availability. You may need to dig in and debug the differences. All of the various options should hit the same availability function AVAILABILITY_CHECK.

Former Member
0 Kudos

@Brad : If I fill ORDER_SCHEDULE_IN-REQ_QTY in place of ORDER_ITEMS_IN-REQ_QTY I receive an error : E-06070-Enter a quantity (I suppose ORDER_ITEMS_IN-REQ_QTY is mandatory). Which field do you use to specify the schedule quantity ?

For information here are the information I am using to run BAPI_SALESORDER_SIMULATE :


----------------------------------------
ORDER_HEADER_IN
----------------------------------------
DOC_TYPE
SALES_ORG
DISTR_CHAN
DIVISION
REQ_DATE_H
PO_METHOD

----------------------------------------
ORDER_ITEMS_IN
----------------------------------------
ITM_NUMBER
MATERIAL
REQ_QTY
SALES_UNIT

----------------------------------------
ORDER_PARTNERS
----------------------------------------
PARTN_ROLE
PARTN_NUMB

Former Member
0 Kudos

You must have a configuration that does not allow partial deliveries, or your order data is not allowing partial deliveries, for the 1000 quantity?

0 Kudos

I think you're on target there because I can run the function without anything in the order items table or by filling the target quantity field in the items table (yes, I know this is for contracts) and the required quantity field for the schedule lines and still get a good result. Obviously, there's code in the sales order code that allows this in one of the '..._FUELLEN' routines. That's why I would go back to the way it worked before and debug the difference in the availability check.

0 Kudos

I was able to simulate a product without filling ORDER_ITEMS_IN-REQ_QTY (this field was mandatory in our system because of a specific development).

If I fill ORDER_SCHEDULE_IN-REQ_QTY in place of ORDER_ITEMS_IN-REQ_QTY I get one line in ORDER_SCHEDULE_EX but [the CONFIR_QTY is still equal to zero|http://img202.imageshack.us/img202/3678/orderscheduleex.jpg]....

0 Kudos

Hey,

I just spent the last week trying to resolve this problem. The reason that the field 'CONFIR_QTY' was always giving me a 0 quantity even though I did have stock available was that there was a credit block on the customer I was testing on.

I used transaction FD32 for my customer to change the credit limit on that customer (There are other ways to do this as well). CONFIR_QTY was then being populated accurately.

- Murray

0 Kudos

HI,

did you solved the problem in the meantime? I'm facing the same and haven't find a solution yet.

Regards

Henning

0 Kudos

Thanks to Andreas Koschinsky who posted the Solution: In SAP transaction OVZJ the default behavior for partial availability checks can be defined per sales org/dist/div.