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: 

Abap background job

Former Member
0 Kudos

Hi abapers,

                  I had a requirement to get the batch spool data.

                  Run rcatstco program as batch job and get the personnel numbers from errors(batch spool) and display them in all grid.

                   Can anyone give me an idea or help me with this?hw can I do this?

Moderator message: please do more research before posting, use meaningful subject lines when posting.

Message was edited by: Thomas Zloch

1 REPLY 1

davis_raja
Active Participant
0 Kudos

Dear,

     You need to get the runtime job details. For that you can use FM GET_JOB_RUNTIME_INFO.

     CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
     IMPORTING
       EVENTID                 = GD_EVENTID
       EVENTPARM               = GD_EVENTPARM
       EXTERNAL_PROGRAM_ACTIVE = GD_EXTERNAL_PROGRAM_ACTIVE
       JOBCOUNT                = GD_JOBCOUNT
       JOBNAME                 = GD_JOBNAME
       STEPCOUNT               = GD_STEPCOUNT
     EXCEPTIONS
       NO_RUNTIME_INFO         = 1
       OTHERS                  = 2.

     Then you need to obtain the Spool ID from the table TBTCP

     SELECT * FROM  TBTCP
                  INTO TABLE IT_TBTCP
                  WHERE      JOBNAME     = GD_JOBNAME
                  AND        JOBCOUNT    = GD_JOBCOUNT
                  AND        STEPCOUNT   = GD_STEPCOUNT
                  AND        LISTIDENT   <> '0000000000'
                  ORDER BY   JOBNAME
                             JOBCOUNT
                             STEPCOUNT.

   READ TABLE IT_TBTCP INTO WA_TBTCP INDEX 1.
   IF SY-SUBRC = 0.
     MESSAGE S004(ZDD) WITH GD_SPOOL_NR.
     GD_SPOOL_NR = WA_TBTCP-LISTIDENT.
     MESSAGE S004(ZDD) WITH GD_SPOOL_NR.

   ENDIF