2022 Dec 05 6:05 PM
Hello,
I am trying to edit two fields in notification header data when I save the associated maintenance order.
For that I'm using user-exit EXIT_SAPLCOIH_009. I am doing some checks in this user-exit and if all is true, I call a Z function in UPDATE TASK that calls FM: BAPI_ALM_NOTIF_DATA_MODIFY and BAPI_ALM_NOTIF_SAVE.
The problem here is that I always get the error message from the first BAPI IM 416 - Notification x locked by user (that's me).
I've tried BADI WORKORDER_UPDATE but the problem remain and already set an WAIT UP TO 2 SECONDS in the top of the update task function.
Can anyone help? Thanks
2022 Dec 05 6:46 PM
Hello carlos91moreira
I'd suggest to call the notification update in a separate logical unit of work (LUW) using:
CALL FUNCTION func IN BACKGROUND TASK AS SEPARATE UNIT
That's basically the same approach that I'v suggested here: https://answers.sap.com/questions/13768145/what-is-badiexit-to-enhance-cj20n-after-click-save.html?c...
You'd need to create a custom RFC-enabled function module. The function should call both BAPI_ALM_NOTIF_DATA_MODIFY and BAPI_ALM_NOTIF_SAVE to update the notification. Make sure to test the RFC function first, to make sure the notification is updated correctly. Then integrated a call with "IN BACKGROUND TASK AS SEPARATE UNIT" in the BAdI implementation.
Best regards
Dominik Tylczynski
2022 Dec 05 6:46 PM
Hello carlos91moreira
I'd suggest to call the notification update in a separate logical unit of work (LUW) using:
CALL FUNCTION func IN BACKGROUND TASK AS SEPARATE UNIT
That's basically the same approach that I'v suggested here: https://answers.sap.com/questions/13768145/what-is-badiexit-to-enhance-cj20n-after-click-save.html?c...
You'd need to create a custom RFC-enabled function module. The function should call both BAPI_ALM_NOTIF_DATA_MODIFY and BAPI_ALM_NOTIF_SAVE to update the notification. Make sure to test the RFC function first, to make sure the notification is updated correctly. Then integrated a call with "IN BACKGROUND TASK AS SEPARATE UNIT" in the BAdI implementation.
Best regards
Dominik Tylczynski
2022 Dec 06 11:40 AM
Thanks a lot for your help.
That didn't solve my issue but maybe it was me who missed some step after the function call.
I solved the issue with a batch program. This was not the way I wanted to solve it but the deadline is very close.
Thanks again for your help.
2022 Dec 06 12:20 PM
2022 Dec 14 11:55 AM
Hello, I did all of that the first time but didn't work. Tried again and it worked. It was very late, probably did something wrong that I didn't double check. Anyway, just to thank you once again. That solution worked.