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: 

Reading and writing a JOB LOG

Former Member
0 Kudos

Hi

How do we read the job log?

How do we display it?

Regards

Nishant

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI

GOOD

GO THROUGH THIS

Use

All message types issued by a program running in the background are stored in a job log, which you can display either to obtain information on a prematurely terminated program or to complete a detailed investigation of a particular background processing run. A separate log file is created for each job.

Deleting Log Files

You should never delete log files directly. If you want to clear the log directory, you must delete the jobs to which the logs belong. In the process, the logs are also deleted.

Job logs are held in the TemSe temporary sequential objects storage facility. TemSe is configured to always store job logs as operating system files in the shared SAP directories. If you delete log files directly at the operating system level, you create inconsistencies in the TemSe database, which you'll then need to eliminate with the Consistency check function in Transaction SP12.

Log Messages

Log messages are generally output using ABAP keyword MESSAGE. With the exception of ABAP breakpoint statistics, no other data is normally output to the job log.

ABAP Short Dumps

If an ABAP program generated a dump when it terminated abnormally, you can display the dump by clicking on the Abend message.

Batch Input Messages

Messages output during batch input sessions are not recorded in the job log. These messages are output only to the batch input system.

Procedure

...

1. Go to Select Background Jobs using Transaction SM37 or by choosing CCMS ® Jobs ® Maintenance.

2. Select the jobs you want to review in the job log by specifying conditions that identify the job or jobs, including job name, user name, job status, start condition, or contents of a job step. Execute this selection to see a list of jobs that match these criteria.

3. In the Job overview screen, select your desired job and choose Job log.

4. In the Job Log Entries for ).

6. For further information about a particular item in the job log, select the line and choose Long text. The resulting help screen can include further information about diagnosing the message, the system’s response to the message, and how the user should follow up.

THANKS

MRUTYUN

9 REPLIES 9

Former Member
0 Kudos

Nishant,

When you schedule a program in the background all the message statements will be written to the job log. This can be seen in SM37 transaction.

If you want to read the same programmitacally you can use the function BP_JOBLOG_READ, and write them as required.

Regards,

Ravi

0 Kudos

Hie RaviKumar Allampallam,

Thank you for providing the function module name.

It met my requirement

Regards,

Pranali

Former Member
0 Kudos

HI

GOOD

GO THROUGH THIS

Use

All message types issued by a program running in the background are stored in a job log, which you can display either to obtain information on a prematurely terminated program or to complete a detailed investigation of a particular background processing run. A separate log file is created for each job.

Deleting Log Files

You should never delete log files directly. If you want to clear the log directory, you must delete the jobs to which the logs belong. In the process, the logs are also deleted.

Job logs are held in the TemSe temporary sequential objects storage facility. TemSe is configured to always store job logs as operating system files in the shared SAP directories. If you delete log files directly at the operating system level, you create inconsistencies in the TemSe database, which you'll then need to eliminate with the Consistency check function in Transaction SP12.

Log Messages

Log messages are generally output using ABAP keyword MESSAGE. With the exception of ABAP breakpoint statistics, no other data is normally output to the job log.

ABAP Short Dumps

If an ABAP program generated a dump when it terminated abnormally, you can display the dump by clicking on the Abend message.

Batch Input Messages

Messages output during batch input sessions are not recorded in the job log. These messages are output only to the batch input system.

Procedure

...

1. Go to Select Background Jobs using Transaction SM37 or by choosing CCMS ® Jobs ® Maintenance.

2. Select the jobs you want to review in the job log by specifying conditions that identify the job or jobs, including job name, user name, job status, start condition, or contents of a job step. Execute this selection to see a list of jobs that match these criteria.

3. In the Job overview screen, select your desired job and choose Job log.

4. In the Job Log Entries for ).

6. For further information about a particular item in the job log, select the line and choose Long text. The resulting help screen can include further information about diagnosing the message, the system’s response to the message, and how the user should follow up.

THANKS

MRUTYUN

Former Member

Hi Nishant,

in case your question was aiming at writing logs in your own programms, check out the "Basis Application Logging". Function modules starting with BAL* and sample programs SBAL_DEMO*. Its well documented.

The logs can then be displayed using transaction SLG1, for customizing SLG0.

Kind regards,

Silke

0 Kudos

if i give the statement..

MESSAGE I000(00) WITH 'MESSAGE INTO JOB LOG' .

and check sm37 after program execution, will i be able to see the job logs?

Message was edited by: Nishant Gupta

Message was edited by: Nishant Gupta

0 Kudos

HI NIshant,

Yes , you can see your job log,but only with one mesage MESSAGE INTO JOB LOG.

Basically the job will have all the messages that are encountered in the flow of the program when run in background.

Regards,

Ravi

0 Kudos

Hi Ravi,

What do you imply with the statement "only with one mesage MESSAGE INTO JOB LOG."

Regards

Nishant

Former Member
0 Kudos

hi

check this FM to read JOB LOG

<b>BAPI_XBP_JOB_JOBLOG_READ</b>

to show the job log

<b>BP_JOBLOG_SHOW</b>

Former Member
0 Kudos
  • Goto SM37
  • Use the filters and Execute (F8)
  • Select a job in the list and double click on it
  • Click on Job log on the top of Job page
  • To analise more about the failure and long running duration of a job. You may have to use SM51, STAD etc.,