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

Handle Error After Commit Work

Former Member
0 Likes
1,175

Hi,

I'd like to know if there is any way to get information about an error generated during the excution of some FM in update task.

I use the 'commit work and wait' statement which gives me a sy-subrc <> 0 in case of error during the update, but I need to retrieve information about the error. Is it possible ?

Thanks in advance.

3 REPLIES 3
Read only

Former Member
0 Likes
733

I usually write a custom function module ( a wrapper ) with a return table parameter and call the standard function module inside the custom funciton module. Then I write any errrors from the Standard FM to the return table and email it to the user that ran the program.

Read only

0 Likes
733

Hi,

the problem is that once you call the FM IN UPDATE TASK you no longer have the chance to access that return table.

I know that an error has been reported if the sy-subrc after the "COMMIT WORK AND WAIT" is not initial. In SM13 I can see the error reported by the FM that failed, but I'd like to know if it is possible to retrieve that information in my ABAP program...

Thanks!

Read only

0 Likes
733

What I meant is you submit the wrapper FM in update task. When this wrapper FM runs, it will simply call the Standard function module and capture all the error messages into an internal table ( a return table) and email the contents of that table to the user that ran the program using the following funciton module SO_NEW_DOCUMENT_SEND_API1.

I did something like this and it has been working pretty good.