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

Internal COMMIT WORK in BAPI_SHIPMENT_CHANGE

Former Member
0 Likes
1,825

Hi,

I am calling BAPI_SHIPMENT_CHANGE in a loop to update shipment with fwding agent for a list of shipments. I have included a simulation flag in the report which allows user to run the report to see if there are any errors in the data. I am not calling COMMIT WORK AND WAIT when the flag is CHECKED. However what we have noticed is that the changes gets commited to database. When we do the same thing in VT02N where we back out without saving we dont see this issue.

My question is BAPI will only commit changes to DB when we use COMMIT WORK after the FM is executed successfully else it will not. I have attached the screenshot of the location where this commit work happens. I am not sure what sets -NO_COMMIT_WORK = 'X' since the BAPI does not provide this parameter. Does anybody know why this happens or is there any note (I was not able to find one)

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,309

Try doing a ROLLBACK if it is being run in simulation mode.

Rob

5 REPLIES 5
Read only

Former Member
0 Likes
1,310

Try doing a ROLLBACK if it is being run in simulation mode.

Rob

Read only

0 Likes
1,309

ROLLBACK will go back until last COMMIT WORK was executed. Will not help. @Francisco pointed out to comments in the FM which indicates that should not have been used in first place.

Read only

0 Likes
1,309

Hmmm....

That's what I thought you wanted.

I missed that the COMMIT was happening in the BAPI; so I see why it wasn't what you wanted.

Anyway, see note  1083509.

Rob

Message was edited by: Rob Burbank

Read only

perfectoromero
Explorer
0 Likes
1,309

I have the 6.0 version of SAP and the BAPI shows this message:

************************************************************************
* CAUTION                                                              *
* This function module is not released officially.                     *
* It is not implemented in normal applications                         *
* and is not well tested.                                              *
* (This function module is only implemented to store the knowledge     *
* for later use)                                                       *
************************************************************************

You have the change a lot of objects to have a test mode, because the internal code set the activities_no_commit_work in false value.

Read only

0 Likes
1,309

Yes. That variable is set to false. I am now wondering if this BAPI should not be used at all now that you pointed out the comments.