BAPI_ALM_ORDER_MAINTAIN doesn't work in SAP Business Workflow
Hi all, I am using BAPI_ALM_ORDER_MAINTAIN within a workflow to release a PM order which is created by the workflow in a step before with ALM_ME_ORDER_CREATE, followed by ALM_ME_ORD_BAPI_ORDER_POST and BAPI_TRANSACTION_COMMIT. That works fine and the result is a PM order that is not yet released. After the BAPI_TRANSACTION_COMMIT I have tried SET UPDATE TASK LOCAL, as well as WAIT UP TO 180 SECONDS. I also stopped the workflow to control whether all data is written to the database and I found all data of the PM order properly. BUT BAPI_ALM_ORDER_MAINTAIN always issued an error message saying that the data for the procedure (Vorgang) are not maintained for the PM order. If I run the BAPI_ALM_ORDER_MAINTAIN alone it works, same with the function I created as well as the method of the business object as well as the task for the workflow. As soon as the workflow runs it - error message, no release. Even if you release the PM order manually with IW32 the PM order is fine and released. No error message at all. My conclusion is that WF_BATCH cannot run the BAPI caused by lag of user rights also it has SAP_ALL. This makes no sence but might be the solution of the problem. Does anybody have an idea what's wrong?
I dont think this issue has to do something with user authorisation. It might be due to LUW and tRFC You are using commit work in the same and then release of order in same background method. Refer to link below. Try to create a separate background step to release the Order and check results