Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

submit statement ..to execute a program in backgorund..

Former Member
0 Likes
581

hai guys,

using submit ..how can i give a program to run ion background?

5 REPLIES 5
Read only

Former Member
0 Likes
562

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

Read only

0 Likes
562

can i submit BDC program this way?

Read only

0 Likes
562

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?

Read only

0 Likes
562

Dear Gaurav,

After executing wait for sometime and then go to SM37 and have a look

Read only

Former Member
0 Likes
562

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