07-27-2007 7:55 PM
I have a program that generated two spools, 1st is a regular list with Write statement, 2nd one is an ALV grid list. When the program is executed in batch job, <b>the job log only show the last spool request number.</b> (i.e. the ALV grid)
If I changed the sequence and made the ALV grid to display first, the job log still only shows the spool number for the ALV grid only, but when clicking the spool request display button on SM37, it actually displays the 2nd one (i.e. the non-ALV list).
I checked table TBTCP, it only has the last spool request number as well for both cased. <u>In conclusion, the job log always only show the ALV list spool request number</u> and the TBTCP only show the latest spool request. Does anyone know how to get both spool request into the job log?
If the lists are generated by different steps in a job then both spool will be saved in job log but not the case when both output are within the same step of a job.
Point will be rewarded.
Thanks.
07-27-2007 10:25 PM
Hi,
I just tried a program where i have a write statement and an alv funciton call.
1. write 'test output'.
2. call 'reuse_alv_grid_display'.
when i schedule this in background whichever is second in the program is showing up in sm37 spool and in table TBTCP.
how are you generating spool in ur program?
Thanks.
07-27-2007 10:25 PM
Hi,
I just tried a program where i have a write statement and an alv funciton call.
1. write 'test output'.
2. call 'reuse_alv_grid_display'.
when i schedule this in background whichever is second in the program is showing up in sm37 spool and in table TBTCP.
how are you generating spool in ur program?
Thanks.
07-30-2007 9:03 PM
Thanks for the response. I guess I did not make my issue clear enough. Yes, for both cases, (whether ALV list first or Write list first), the spool that shows up when clicking the SPOOL button from SM37 is always the last spool request.
However, in the job log (when clicking Job Log from SM37) always has the ALV spool number list as message like:
7/20/07 11:15:00 Job started
7/20/07 11:17:00 Spool request (number 0000102) sent to SAP printer PRT1
7/20/07 11:17:30 Job finished
Although there is another spool request (number 0000101) for the write list.
I can manually issue a message in the program after the write list to capture the spool request number and I assume that will output to the job log. However, I am wondering if there is any standard way or print parameter that I can modify so both spool requests number will be included in the job log itself.
Any advice is appreciated and point will be rewarded.
Thanks.
07-30-2007 11:38 PM
Hi,
If you check table TBTCP, the key fields are job name, job count and step number. so until we give the write statement and the alv list as different steps there is going to be only one entry in TBTCP for a program.
can you please explain me what you mean by
"I can manually issue a message in the program after the write list to capture the spool request number and I assume that will output to the job log."
Thanks,
MGS.
07-31-2007 1:04 AM
Since messages will be logged in the job log, so by issuing a system message after the write routine will add the message with the spool number the same way as the standard SAP program does.
message ID 'SY' type 'S' number 374 with sy-spono sy-pdest
I tested it and it does add the message of the first spool request number to the job log. This will at least give the user a better picture of what had been sent to the spool.