07-07-2012 4:44 AM
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
07-07-2012 6:29 AM
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