‎2015 Apr 06 1:39 PM
Hi,
I got a scenario that when a Breakdown Notification (IW22) getting closed i.e. system status NOCO then automatically Order against the Breakdown Notification should get closed i.e. TECO status.
SO i have created an UPDATE Function Module within that i called BAPI_ALM_ORDER_MAINTAIN function module to update TECO status.
But i'm getting the below error in ST22 where as in SM13 no error is appearing.
Short text of the error message:
Nested call of PERFORM ON COMMIT: NESTED_PERFORM_ON_COMMIT caller: SAPLC
OVB program: SAPLCOVB form: DELTA_PUT
Long text of the error message:
Diagnosis
During processing of a routine called using PERFORM ... ON COMMIT,
the system attempted to call PERFORM ... ON COMMIT again. Nesting
of this is not allowed.
System Response
Procedure
The program indicated after "Caller:" must be changed. This is the
program that calls the routine indicated after "Form:" during
COMMIT processing. This routine is part of the program indicated
after
"Program:".
Procedure for System Administration
Technical information about the message:
Message class....... 00
Number.............. 081
Variable 1.......... NESTED_PERFORM_ON_COMMIT
Variable 2.......... caller: SAPLCOVB
Variable 3.......... program: SAPLCOVB
Variable 4.......... "form: DELTA_PUT"
Can anyone suggest me whether BAPI_ALM_ORDER_MAINTAIN function module can be called in UPDATE Function Module or if any other way to do the above scenario.
Please suggest me.
Thanks in advance.
Regards,
Ramana.
‎2015 Apr 07 7:50 AM
‎2015 Apr 07 7:50 AM
‎2015 Apr 07 12:46 PM
Hi Raymond,
Thanks for your reply.
I have changed the Function Module to Remote Enabled and called that Function Module using
CALL FUNCTION '<FM NAME>' IN BACKGROUND TASK '<TASK NAME>'..
NOTIFICATION (IW22) is getting saved without Roll Back even though an error occurs in the above function module.
So how can i stop NOTIFICATION save when error occurs in BACKGROUND TASK Function Module.
Regards,
Ramana.
‎2015 Apr 07 2:11 PM
Hi,
If I understand correctly - you can't, because BACKGROUNG TASK will be executed in a separate process, separate LUW... which is why I'm apprehensive about splitting "business logic" into two LUWs.
I'd try to find a place in NOTIFICATION logic (prior to commit), where your BAPI "wrapper" can be called as a normal function module.
cheers
Janis
‎2015 Apr 07 3:04 PM
You cannot.
A solution could be to call the BAPI (without commit) just before the COMMIT of the current transaction, but in this case you can get other kind of errors, cause the notification is not yet updated, or mess of data in memory between notification and order (e.g. partner managed in same function group) ?
Another solution is check of order status, allowing to set TECO, some call of K_OBJNR_WITH_VRGNG_CHECK with operation BTAB (Technically complete) and execute the FM IN BACKGROUND TASK (don't use TASK option if you don't need it) Also there can be other errors.
Regards,
Raymond
PS: Did you use BAdI NOTIF_EVENT_SAVE ?
‎2015 Apr 09 7:55 AM
Hi Raymond,
Thanks for your reply.
I have used NOTIF_EVENT_POST BADI.
I think i have to check the ORDER status whether TECO can be done or not in NOTIF_EVENT_SAVE BADI while closing the NOTIFICATION so that there will not be any errors while closing the ORDER using the FM IN BACKGROUND TASK.
Please advice me if any way to avoid errors while closing the ORDER.
Regards,
Ramana.
‎2015 Apr 07 7:52 AM
Hi,
Where and how have you integrated the call to your update function? Since the SAP logic you are integrating with registers PERFORM ON COMMIT routine(s) and since the BAPI will register more of those routines, the call to your function should come preferably prior to SAP logic issues commit work. And this call can not be executed from within a SAP routine performed on commit.
The call chain further down in the shortdump should tell what's going wrong - maybe post that as well. The challenge here will be to find a correct integration point for your logic.
Actually, forget part of what I wrote - Raymond is right I'm not sure about the Background Tasks (have not used them), but you can't use update function here. Calling a normal function prior to SAP commit should work, however.
cheers
Janis
‎2015 Apr 07 8:32 AM
Hi Ramana,
Kindly proceed as suggested by Raymond but call the FM in new task to make sure that the new FM call will execute in a separate LUW.
Thanks,
Gupta
‎2015 Apr 11 7:40 AM
Hi Raymond/ Gupta,
Thanks for your reply.
Can you suggest me how to run the BAPI_ALM_ORDER_MAINTAIN FM in TEST RUN Mode.
If i can run this in Test Run mode then my issue of handling errors will be solved.
Regards,
Ramana.