‎2013 Jan 24 11:17 AM
Hi Experts,
I am doing the migration program for the service Order Create using the BAPI 'BAPI_ALM_ORDER_MAINTAIN'. After the BAPI i am calling the FM
'ALM_ME_COMMIT_OR_ROLLBACK' it will commit or Rollback bassed on the Return table what i am getting from the BAPI.
This was working fine. But when i run it in the Bulk order i mean 700 service order some orders i am getting success message. But few orders like 50 orders i am getting the below error message.
"After SAVE method, COMMIT WORK or ROLLBACK WORK must be executed".
when i refer the FM 'ALM_ME_COMMIT_OR_ROLLBACK' they have used bapi_transaction_commit statement and wait also.
But i dont know why i am getting the error message. can you please adivce
Thanks,
Dhina..
‎2013 Jan 24 11:45 AM
‎2013 Jan 24 11:45 AM
‎2013 Jan 24 12:09 PM
Hi Kesavadas,
Yeah i refered the link.
Function module BAPI_ALM_ORDER_MAINTAIN was called with the SAVE method. Then the function module was called again without triggering update first.
So you want me to put wait statement after the FM 'ALM_ME_COMMIT_OR_ROLLBACK' ?
Thanks,
Dhina..
‎2013 Jan 24 12:33 PM
"After the call of BAPI_ALM_ORDER_MAINTAIN with the SAVE method, the update must be triggered or cancelled. A new call is not possible beforehand."
It says a commit work or rollback work has to triggered after each entry.
or
"If you want to update several calls of BAPI_ALM_ORDER_MAINTAIN together, you can only use the SAVE method for the last call of BAPI_ALM_ORDER_MAINTAIN. All other calls must use the DIALOG method."
In your case, we have to use the DIALOG method( for example change ) for the entries starting from one and use SAVE method in the last entry while passing to parameter IT_METHODS like for example:
ls_method-refnumber = 1.
ls_method-objecttype = 'OPERATION'.
ls_method-method = 'CHANGE'.
ls_method-objectkey = '12345'.
append ls_method to lt_methods.
clear ls_method.
ls_method-refnumber = 1.
ls_method-method = 'SAVE'.
ls_method-objectkey = '12345'.
append ls_method to lt_methods.
‎2013 Jan 24 12:06 PM
Hi ,
You are saying Your Function module is using commit and wait means when you are running bulk upation it will wait for all the records has to process first at the last it will do commit.
better you can use COMMIT WORK and ROLLBACK With out WAIT after your BAPI function call.
Thanks
Mani
‎2022 Mar 11 7:46 AM
For anyone who is having this problem check if you have 'uncommited' bapi before. In my case I had a bapi which was not commited and after solving it there was no error