Application Development 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: 

How to get errors from a function called IN BACKGROUND TASK AS SEPARATE UNIT ?

Former Member
0 Kudos

Hi gurus,

We have placed a call to a function IN BACKGROUND TASK AS SEPARATE UNIT in a user exit (SD Invoices). This function updates another document (SD Shipment).

The thing is that, sometimes, this update can not be done due to some reasons (Document is blocked for another user, authorizations...) and we would like to know how to get the error messages in this cases. The update is done via BAPI and we have the RETURN tab, but as it runs in background task, how to know that the BAPI returned error messages?

Is there a log (System log, RFC log...) where the errors are posted by the system?

Thanks in advance!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Nothing found for this. So I've added a bit of code to get the error messages returned from the BAPI called in Background and save them into a new custom table for later check.

5 REPLIES 5

Former Member
0 Kudos

Nothing found for this. So I've added a bit of code to get the error messages returned from the BAPI called in Background and save them into a new custom table for later check.

Hi AAH...

I have not the solution, but instead creating custom table, why don't you use the BAL_LOG ?

https://wiki.scn.sap.com/wiki/display/Snippets/Application+Logging+in+SAP+Using+ABAP

regards

Fred

0 Kudos

You're are totally right. This was another option for us, but we decided to use the table cause it is easier to troubleshoot and hopefully in the future we we'll remove it.

Thanks for the suggestion!

Fred's idea is good but is there a mechanism that intimates the user about the error logs in SLG0/1.Usually,end users will not be having access to SLG0/1.

K.Kiran.

maybe a specific job that scan the BAL_LOG and send a mail in the Business Workplace of the corresponding user ...

sometimes people used IDOC to manage Background task / log / re-run ..

fred