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

Commit at ZXCO1U01

Former Member
0 Likes
1,466

Hello gurus,

I am trying to write code at exit ZXCO1U01 for sending an email notification when an Process order is saved. The problem is that, i cannot write commit at this exit, because it raises an exception for perform on commit. The code i use for sending the email is below

CALL METHOD SEND_REQUEST->SEND(
         EXPORTING
           I_WITH_ERROR_SCREEN = CA_X
         RECEIVING
           RESULT              = SENT_TO_ALL ).
       COMMIT WORK.

I tried to create a function, and do this in update task, but the update terminated also.

Can anyone gine me a sample code to make this happend ?

Thanks in advance!

4 REPLIES 4
Read only

Private_Member_49934
Product and Topic Expert
Product and Topic Expert
0 Likes
981

Just call the code in update task WITHOUT COMMIT.

The transction should be doing the commit for you.

Read only

0 Likes
981

thanks for answer, but without commit no update is happening..

Read only

RaymondGiuseppi
Active Contributor
0 Likes
981

Okay, dont put any commit in transaction customer-exits or BAdI as well as in update task. Try to execute in a FM in background task which will execute after update tasks (successful). There you are in another luw and are allowed to use any tools, like call transaction or commit-work. ( Also check via SM58 for error management as you use SM13 for update task errors)

Regards,

Raymond

Read only

0 Likes
981

Thanks, this solved my problem.