2007 Aug 31 7:17 AM
Since in background it is not possible to get variant name so how the 'Submit' statement should be written
Since in background it is not possible to get variant name so how the 'Submit' statement should be written
2007 Aug 31 7:23 AM
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.
2007 Aug 31 7:24 AM
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.
2007 Aug 31 7:35 AM
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>
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |