2008 Mar 20 9:22 AM
Hi,
I am calling Job_Submit inside a loop.Job_Submit executes a prg which creates 2- or more spools,thus inside a loop.
Job_Close for the corresponding job is outside the loop.
Is it poss to get the spool number(s) generated as a result of job execution inside the loop i.e. after Job_Submit and before job_Close.
I suppose spool number is generated after Job_Close.
Please assist!!!
Answers will be rewarded.
- Rohan
Hi,
I am calling Job_Submit inside a loop.Job_Submit executes a prg which creates 2- or more spools,thus inside a loop.
Job_Close for the corresponding job is outside the loop.
Is it poss to get the spool number(s) generated as a result of job execution inside the loop i.e. after Job_Submit and before job_Close.
I suppose spool number is generated after Job_Close.
Please assist!!!
Answers will be rewarded.
- Rohan
2008 Mar 20 9:26 AM
Yes it is possible to get the spool number before JOB_CLOSE.
make use of below code snippet.
1) SELECT MAX( RQIDENT ) INTO G_SPOOL_NUM
FROM TSP01
WHERE RQCLIENT = SY-MANDT AND
RQOWNER = SY-UNAME.
Or else u can make use of system variable..........
2) SY-SPONO.
Reward if useful.....
2010 Nov 30 2:31 PM
2) SY-SPONO.
That's not working, it's empty
Spool number is stored on that system var (sy-spono) but it's cleared before going out of the submit so there's no data on it after.
Regards,
John
Edited by: John Smith on Nov 30, 2010 3:31 PM
Edited by: John Smith on Nov 30, 2010 3:43 PM
2010 Nov 30 2:48 PM
Hi John,
If you are submitting the job, you will have the job name and the job number.
Within a DO-ENDDO use the function module 'BDL_READ_JOB_STATUS' passing it job name and job number (I believe the spool numbers are only assigned once the job is complete but I could be wrong here).
If the job status returned from 'BDL_READ_JOB_STATUS' = 'F' then the job is finished and exit the DO-ENDDO.
Select the SPOOLID from table TBTC_SPOOLID based on your job name and job number.
This should return all the spools you require.
Hope this helps.
Kind Regards,
Richard.
Edited by: Richvdl on Nov 30, 2010 3:49 PM
2010 Nov 30 2:52 PM
Using the job number would be a great idea since you can differ them clearly between different executions.
But, what if you use just the submit without being in a job?
Thanks and regards,
John
2010 Nov 30 3:52 PM
Hi John,
I'm not too sure on your requirements, so to answer the question is rather difficult. I suppose you could export spool numbers to memory and then import or use similar methods etc. I afraid don't have a clear-cut method besides the use of the JOB_OPEN/JOB_CLOSE approach.
Have a look at this thread as it will give you some other approaches...
Kind Regards,
Richard.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |