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_SALESORDER_CHANGE returns the error message

Former Member
0 Likes
1,557

Hi experts,

I have got some strange problem:

In my program there is IDOC_INPUT_ORDERS which create SO. After that I have sales order number and it is OK.

In same program I want to change created SO so I wrote:

SET UPDATE TASK LOCAL.

BAPI_SALESORDER_CHANGE

but the BAPI return error message that SO number is now processed by WF-BATCH user ...

Also the SO created by IDOC is not set as IN UPDATE TASK so what is wrong ?

Really thanks.

Daniel.

1 ACCEPTED SOLUTION
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
998

WF-BATCH is a workflow system user which isprocessing it. Do you have any workflow getting triggered in SAP as soon as a SO is created. If yes try to change the sales order via tcode look at what it says. Second option aspointed out earlier make lopp wait step of 3-4mins if that is the case.

Nabheet

Hi experts,

I have got some strange problem:

In my program there is IDOC_INPUT_ORDERS which create SO. After that I have sales order number and it is OK.

In same program I want to change created SO so I wrote:

SET UPDATE TASK LOCAL.

BAPI_SALESORDER_CHANGE

but the BAPI return error message that SO number is now processed by WF-BATCH user ...

Also the SO created by IDOC is not set as IN UPDATE TASK so what is wrong ?

Really thanks.

Daniel.

4 REPLIES 4
Read only

Former Member
0 Likes
998

Sales Order change and create updates MANY database tables. The update process is therefore understandably a bit lengthy. When I worked with SD, it was not uncommon to create a sales order and have it show locked for 2-3 minutes immediately after SAVE press. I would suggest that you either build in some delay before you attempt a change or (better yet) do your changes to sales orders created (should be able to capture the doc number in the return) in a later, subsequent process.

Read only

0 Likes
998

Thanks for your reply.

First of all, the SO which is created from IDOC is processed in dialog. I am waiting for him like you said ~ 2 minutes. It is not a asynchronous process I think.

Furthemore when I put some breakpoint in BAPI_SALESORDER_CHANGE I can see created SO in VBAK.

Whether my thinking is correct that it could be a reason of COMMIT WORK (asynchronous commit) command in IDOC_INPUT_ORDERS fm ?

Maybe BAPI_TRANSACTION_COMMIT will help after IDOC processing ... ?

Thanks

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
999

WF-BATCH is a workflow system user which isprocessing it. Do you have any workflow getting triggered in SAP as soon as a SO is created. If yes try to change the sales order via tcode look at what it says. Second option aspointed out earlier make lopp wait step of 3-4mins if that is the case.

Nabheet

Read only

0 Likes
998

I have made the next tests and it seems to that WF-BATCH user is blocking the SO.

After the 3-4 minutes waiting at breakpoint, WF-BATCH release the SO and everything was fine.

Because during creating SO also workflow is triggered the question is how to make some kind of COMMIT WORK and WAIT after IDOC_INPUT_ORDERS is performed.

Is there any chance ? Or check somehow that workflow process is finished/closed?

BTW. Thank you guys for the localisation of my problem ...