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 in back ground

Former Member
0 Likes
416

Since in background it is not possible to get variant name so how the 'Submit' statement should be written

3 REPLIES 3
Read only

Former Member
0 Likes
392

Hi,

You can use the options available with Submit statement like :

Variants:

1. ... USING SELECTION-SET vari

2. ... WITH p op f SIGN s

3. ... WITH p BETWEEN f1 AND f2 SIGN s

4. ... WITH p NOT BETWEEN f1 AND f2 SIGN s

5. ... WITH p IN sel

6. ... WITH SELECTION-TABLE seltab

7. ... WITH FREE SELECTIONS texpr

You can pass values to your variables in background, using the above variants, you can also pass tables, etc.

Regards,

Samson Rodrigues.

Read only

former_member189059
Active Contributor
0 Likes
392

Hello Praveen,

Use it this way.. everything after the with is the parameter names

everything after the '=' is the local variable names

    SUBMIT (lv_job_name)
        WITH applfile = applfile
        WITH p_lines = p_lines
        WITH rfc_dest = rfcdest
        WITH p_selmtd = lv_selmtd
        WITH px_shsim = px_shsim
        WITH px_sherr = px_sherr
        USER syst-uname
       VIA JOB lv_job_name NUMBER lv_job_nr AND RETURN.

Read only

varma_narayana
Active Contributor
0 Likes
392

Hii

You can create a Background Job using Submit without variant in this way..

This is the Sample code for that.

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.

<b> SUBMIT <report> TO SAP-SPOOL

SPOOL PARAMETERS print_parameters

WITHOUT SPOOL DYNPRO

VIA JOB name NUMBER number

with P_werks = v_werks

with s_matnr in r_matnr

AND RETURN.

</b>

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.

<b>reward if Helpful</b>