‎2008 May 05 9:41 AM
hai guys,
using submit ..how can i give a program to run ion background?
‎2008 May 05 9:47 AM
Hi Gaurav,
Good question: thanks
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.
syntax is see the below example;
Try with this example:
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.
Hope answered your question.
Reward if helpful
Thanks
abdul
‎2008 May 05 10:20 AM
‎2008 May 05 10:57 AM
Re: submit statement ..to execute a program in backgorund..
Posted: May 5, 2008 11:54 AM in response to: kumar gaurav Edit E-mail this message Reply
i have given the following code..
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.
in this i havent not given any values for print_parameters...
when i execute the program..i see no effect...
like when i submited program zwrite in background, i dont find it in sm37? so wats happening to the submited job?
‎2008 May 05 12:05 PM
Dear Gaurav,
After executing wait for sometime and then go to SM37 and have a look
‎2008 May 05 9:47 AM
You can use SUBMIT TO SAP-SPOOL.
Have a lok at below link for details:
[SUBMIT TO SAP-SPOOL|http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/submit_t.htm]
I hope it helps.
Best Regards,
Vibha
Please mark all the helpful answers