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 does not create Sales order

Former Member
0 Likes
1,833

Hi All,

I am using BAPI_SALESORDER_CREATEFROMDAT2 to create sales order.

It is working fine till now.

But I found that whenever there is a material whose condition price is maintained and doesnot match with the valuation type, the Sales order does not get created, neither it gives any error msg.

For e.g For Valuation type Consign , condition type ZPCS is valid and similarly for Turnkey , condition type ZPTK is valid.

if a material has valuation type consign and condition type ZPTK.. The SAP system ofcourse will not allow to create a SO unless we delete the ZPTK entry from the SO and create ZPCS...

BAPI also doesnot create the SO but doesnot return the error messge too.

I try to put the ZPCS value to BAPI thru BAPICOND..but still not working?

How do i handle such case?

Points will be awarded to useful ans

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,445

Hi,

If you are saying that you cannot create a sales order with the Valuation type and Condition type mismatch even through VA01 manually, then there is nothing much you can do in BAPI also.

2nd Case is you say that that BAPI RETURN table is not getting populated and it is empty in this issue which is not letting you know that Sales order is not Created.

The one work around for this issue is you can check the exporting parameter SALESDOCUMENT if it has the Sales Order number or not. if the RETURN table is empty and the SALESDOCUMENT field has SO Number, then SO is created and if RETURN table is Initial and SALESDOCUMENT is also Initial, then it is the issue that you are facing.

Also try posting a Query in OSS.

regards,

Mahesh

8 REPLIES 8
Read only

Former Member
0 Likes
1,445

Any help?

More explanation..

If a material has more than one pricing condition maintained, then I am not able to create the Sales order using BAPI. How do I handle this case?

Read only

0 Likes
1,445

help please

Read only

Former Member
0 Likes
1,446

Hi,

If you are saying that you cannot create a sales order with the Valuation type and Condition type mismatch even through VA01 manually, then there is nothing much you can do in BAPI also.

2nd Case is you say that that BAPI RETURN table is not getting populated and it is empty in this issue which is not letting you know that Sales order is not Created.

The one work around for this issue is you can check the exporting parameter SALESDOCUMENT if it has the Sales Order number or not. if the RETURN table is empty and the SALESDOCUMENT field has SO Number, then SO is created and if RETURN table is Initial and SALESDOCUMENT is also Initial, then it is the issue that you are facing.

Also try posting a Query in OSS.

regards,

Mahesh

Read only

0 Likes
1,445

Thanks mahesh, I have already asked OSS

Read only

0 Likes
1,445

IS there any workaround way?

Read only

0 Likes
1,445

Hi,

Dont you think you can work with SALESDOCUMENT field ?.

regards,

Mahesh

Read only

0 Likes
1,445

I Am already performing that check..

At first place salesdocument is blank.

and the return tables has messages but success messages only no error.

Isnt it strange?

Read only

0 Likes
1,445

Hi!

You might try to enter a user exit for checking the condtions within the program MV45AFZZ. before the saving.

If the conditions are wrong, you just perform a command MESSAGE with type E, and the BAPI will return the given message also.

Regards

Tamá