Dokumentation zur VorgehensweiseJob-Protokoll in eine interne Tabelle kopieren

Vorgehensweise

Mit BP_JOBLOG_READ können Sie den Inhalt des Job-Protokolls in eine interne Tabelle kopieren. Sie können dann das Protokoll weiterverarbeiten. Beispielsweise können Sie die Protokolle mehrerer zusammen hängender Jobs verketten und nach dem Begriff abgebrochen suchen, um nicht erfolgreich verarbeitete Jobs zu ermitteln.

Beispiel

Syntax Syntax

  1. 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.
Ende des Codes