2008 Mar 18 5:26 PM
Hi Gurus,
I have a quick question regarding the backgroud jobs. When we run a program in the background , it should create a spool for us, but, the problem comes when I am running a program in the background, its not creating the spool. This program uses SUBMIT statement. This program collects the data and it will submit to the other program and then retuen. In this case, its not creating a spool. Its very important for us to look at the spool for this program. Does anybody cam across this kind of problem? I need ur inputs.
Thanks in advance, <REMOVED BY MODERATOR>
Regards,
Srinivas.
Edited by: Alvaro Tejada Galindo on Mar 18, 2008 4:31 PM
2008 Mar 18 5:40 PM
try replacing that submit statement with the submit statement having TO SAP-SPOOL spool_options .
Once that spool is generated you can track it from table tsp01.
G@urav
2008 Mar 18 5:30 PM
hi check this link ...
Scheduling a submitable program as a background task with the number number in a background request name. After scheduling, the background task is completed by function module JOB_CLOSE and released immediately.
DATA: number TYPE tbtcjob-jobcount,
name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
print_parameters TYPE pri_params.
...
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = name
IMPORTING
jobcount = number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
SUBMIT submitable TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = number
jobname = name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0.
...
ENDIF.
ENDIF.
ENDIF.
https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=backgroundsubmit&adv=false&sortby=cm_rnd_rankvalue
sy-subrc Meaning
0 Background task scheduled successfully.
4 Scheduling cancelled by user on the selection screen.
8 Error during scheduling, i.e. when accessing JOB_SUBMIT internally.
12 Error in internal number assignment.
regards,
venkat.
Edited by: venkat appikonda on Mar 18, 2008 6:32 PM
2008 Mar 18 5:48 PM
Hi,
Thanks for ur quick reply. Do I need to write these job_open, submit and job_close in my program? Actually in my system, there is a job stream.
Fo example:
Jobstream 1:
Job 1 - This has the program with the submit statement.
job 2 - will read the file from job 1's output.
job 3 -
job 4 -
The above jobs are already set up in the system and it runs every day at scheduled time and we need the spool from job1 to see which documents are processed. The main program to which we are submitting from our program will have this information in the output screen. when I ran my program in the foreground, I can see the output, but only the problem is when I am running in the background.
Can you please let me know this. Thanks in advance.
Regards,
Srinivas.
Edited by: srinivas kari on Mar 18, 2008 6:50 PM
2008 Mar 18 5:40 PM
try replacing that submit statement with the submit statement having TO SAP-SPOOL spool_options .
Once that spool is generated you can track it from table tsp01.
G@urav
2008 Mar 18 5:58 PM
2008 Mar 18 6:03 PM
Hi,
We do not have the ALVs and its plain output screen with the wrte statements and the jobs are already been set up and they will run at the scheduled intervals. Do I need to write the above statements in my program.
Thanks in advance,
Srinivas
2008 Apr 30 4:50 PM
The issue is resolved. We used the "Exporting list to memory" in the submit statement and then we read this list and it worked for us.
Thanks for your help guys.