Entering content frameProcedure documentation Copying a Job Log into an Internal Table Locate the document in its SAP Library structure

Use BP_JOBLOG_READ to read the contents of a job log into an internal table. You can then further process the job log. For example, you could concatenate the logs from several related jobs or search for the term canceled (German abgebrochen) to detect jobs that did not run successfully.

Sample Program

REPORT BPJOBLOG.
INCLUDE LBTCHDEF.
*
* Possible data declarations: BP_JOBLOG_READ
* Assumption: You have saved the JOBNAME and JOBCOUNT of a job
* and are specifying these values explicitly.
*
* Job log records are returned in an internal table.
*
DATA: JOBNUMBER LIKE TBTCJOB-JOBCOUNT.
DATA: JOBLOGID LIKE TBTCJOB-JOBLOG.
DATA: JOBNAME LIKE TBTCJOB-JOBNAME.

DATA JOBLOG OCCURS 100 LIKE TBTC5.

JOBNAME = '<NAME OF JOB>'. " Supplied by you when you schedule
" a job.
JOBCOUNT = '<NUMBER OF JOB>'. " Returned by JOB_OPEN.

CALL FUNCTION 'BP_JOBLOG_READ'
EXPORTING
CLIENT = SY-MANDT
" Defaults to user's client.
JOBCOUNT = JOBNUMBER " Job ID number.
JOBNAME = JOBNAME " Job name.
TABLES
JOBLOGTBL = JOBLOG
EXCEPTIONS
JOBLOG_DOES_NOT_EXIST = 01
" Log already deleted
JOBLOG_IS_EMPTY = 02 " Job has just started. If
" exception recurs, there is
" probably a system problem.
NO_JOBLOG_THERE_YET = 03 " Job not yet started.
NO_SHOW_PRIVILEGE_GIVEN = 04 " Calling user does not have
" display privileges for the
" requested job.
OTHERS = 99. " System errors, such as
" database or network
" problems.

Leaving content frame