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: 

BAPI_SALESORDER_CREATEFROMDAT2 not able to ceate Sales Order

former_member203070
Participant

I'm facing problem when there is two line item in parameter order_items_in and the POSNR value is different (for example 10 and 20). In this case the sales order is not being created by the function module BAPI_SALESORDER_CREATEFROMDAT2.

The RETURN table id like below,

TABLE - return -

1    S    V4    233    SALES_HEADER_IN has been processed successfully

2    S    V4    233    SALES_ITEM_IN has been processed successfully

3    E    V1    320    No item category available (Table T184 ZPRO ZBOM  ZTAQ)

4    E    V4    248    Error in SALES_ITEM_IN 000020

5    E    V4    219    Sales document  was not changed

But if there is one item and posnr = 10 then the sales order has been successfully created.

Or when the POSNR for two line item is same (like 10 and 10) then also the sales order has been created successfully.

Please send me suggestions for the problem ASAP.

Thanks & Regards,

Partha S Goswami

______________________________                   

1 ACCEPTED SOLUTION

former_member203070
Participant
0 Kudos

Hi Gaurav / Wang ,

I got the solution.

The problem was for the BOM (bill of material) issue.

In this case we just need to pass the parameter INT_NUMBER_ASSIGNMENT with value ‘X’ into the BAPI.

I have documented the details in a blog post. Please go through it.

https://scn.sap.com/community/abap/blog/2013/09/05/problem-in-sales-order-creation-using-bapisalesor...

Thanks for replying..

- Partha

4 REPLIES 4

Former Member
0 Kudos

Hi,

Have you checked your Data for Line Item 20 whether the ITEM CATEGORY you are passing holds valid in your System?

You can go to table T184 or Table TVPT to confirm the same.

From the Error stated, it looks like the Item caterogy passed is not correct.

Thanks

Gaurav

former_member186413
Participant
0 Kudos

I suggest you to contact with the SD consultant of your side, to check "item category " that your porgram  passing through is availabe in the IMG configuration.  

check to see the material types defination!

former_member203070
Participant
0 Kudos

Hi Gaurav / Wang ,

I got the solution.

The problem was for the BOM (bill of material) issue.

In this case we just need to pass the parameter INT_NUMBER_ASSIGNMENT with value ‘X’ into the BAPI.

I have documented the details in a blog post. Please go through it.

https://scn.sap.com/community/abap/blog/2013/09/05/problem-in-sales-order-creation-using-bapisalesor...

Thanks for replying..

- Partha

0 Kudos

  Hi Partha, thanks for sharing. I faced the same problem, and solved it by doing what you did. After several days debugging the BAPI_SALESORDER_CREATEFROMDAT2, searching for notes, asking the SD consultant to check VOV4 for the possibility of missing data, I was running out of choices. It seems to me that there must be something slightly wrong with this BAPI, as the sales order was not created, for instance, if I pass it line items A, B, C, -> message V1 320, but if I flipped them to B, A, C, the sales order was generated correctly!!

Thank you.

Regards.

Sergio Pereira