SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Jobs



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Mon Sep 17, 2007 6:37 pm    Post subject: Jobs Reply with quote

GET_JOB_RUNTIME_INFO - Job, Step, Event etc.

JOB_OPEN - Open Job Scheduling Without Dialog (Including COMMIT WORK) Open background job and obtain the job Id (JOBCOUNT)

JOB_SUBMIT - Insert Background Task in Background Request with COMMIT WORK Add step to the opened job

JOB_CLOSE - Close Background Request With COMMIT WORK Release the job

BP_EVENT_RAISE - Trigger Background Event Ofter used to submit background job by event

BP_JOBLOG_READ - Fetch job log executions

BP_JOB_READ - Retrieve Job Specifications
Code:
FORM f_log_spoolnumber.
.
  DATA: lw_jobcount     TYPE TBTCM-JOBCOUNT,
        lw_jobname      TYPE TBTCM-JOBNAME,
        lw_stepcount    TYPE TBTCM-STEPCOUNT,
        lt_steplist     LIKE TABLE OF TBTCSTEP WITH HEADER LINE,
        lt_spool_attrib LIKE TABLE OF BAPIXMSPOOLID WITH HEADER LINE,
        lw_spool        TYPE tbtcstep-listident,
        lw_spoolchar    TYPE symsgv.

* Only execute if in batch mode
  IF sy-batch EQ 'X'.
*   Get Job/batch details
    CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
     IMPORTING
       JOBCOUNT                      = lw_jobcount
       JOBNAME                       = lw_jobname
       STEPCOUNT                     = lw_stepcount
     EXCEPTIONS
       NO_RUNTIME_INFO               = 1
       OTHERS                        = 2.

    IF SY-SUBRC EQ 0.
*     Read spool number, must be opcode 20.
      CALL FUNCTION 'BP_JOB_READ'
        EXPORTING
          JOB_READ_JOBCOUNT           = lw_jobcount
          JOB_READ_JOBNAME            = lw_jobname
          JOB_READ_OPCODE             = '20'
          JOB_STEP_NUMBER             = lw_stepcount
        TABLES
          JOB_READ_STEPLIST           = lt_steplist
          SPOOL_ATTRIBUTES            = lt_spool_attrib
        EXCEPTIONS
          INVALID_OPCODE              = 1
          JOB_DOESNT_EXIST            = 2
          JOB_DOESNT_HAVE_STEPS       = 3
          OTHERS                      = 4.
      IF SY-SUBRC EQ 0.
        READ TABLE lt_steplist INDEX 1.
        lw_spool = lt_steplist-listident. lw_spoolchar = lw_spool.
      ENDIF.
    ENDIF.
  ENDIF.
* Now record the spool number in the interface Framework detail message
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.