Skip to Content
avatar image
-2
Former Member

ABAP CODE background task log read from SM37

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Apr 11, 2017 at 10:49 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Apr 18, 2017 at 01:13 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded