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

Termination error for calling BAPI_ALM_ORDER_MAINTAIN function module in UPDATE TASK?

Former Member
0 Likes
2,324

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.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,470

You cannot call a BAPI that will require a COMMIT in an update task, better change your FM from update to RFC enabled and call it IN BACKGROUND TASK.

Regards,

Raymond

8 REPLIES 8
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,471

You cannot call a BAPI that will require a COMMIT in an update task, better change your FM from update to RFC enabled and call it IN BACKGROUND TASK.

Regards,

Raymond

Read only

0 Likes
1,470

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.

Read only

0 Likes
1,470

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

Read only

0 Likes
1,470

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 ?

Read only

0 Likes
1,470

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.

Read only

Private_Member_7726
Active Contributor
0 Likes
1,470

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

Read only

Former Member
0 Likes
1,470

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

Read only

0 Likes
1,470

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.