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: 

ABAP CODE background task log read from SM37

irumudipriyan
Explorer
0 Kudos

i have updated mara table in a background task and i need to display error details of each record with sequence number .i know we can see log details in SM37 but its showing only error or success details but how to get record sequence number ?

Example

i need result as below

record status message

1 success material created

2 error rejected

.

.

thanks & Regards,

Priyan R.

3 REPLIES 3

former_member200754
Participant
0 Kudos

Try to raise message type 'S'. if you raise message type 'E' will stop program.

Then these info will write to job log

Ex:

Loop at it_mara.

update to table mara.

If sy-sy-subrc = 0

message 'success material created' TYPE 'S'

else.

message 'error rejected TYPE 'S'

endloop

0 Kudos

thanks for your answer John vo,

log is created in a background mode which is a LSMW direct input project we cant change the code in loading program the only option is i have to read the log from SM37 with correct record sequence number .

thanks in advance

raymond_giuseppi
Active Contributor
0 Kudos

Perform some search on Application Log in online help and sample reports like SBAL_DEMO_*.

Then adapt your creation program and allow users to transaction SLG1.