Application Development 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: 

Passing selection options and parameters to backround job

DanielleinaD
Advisor
Advisor

Hi expters,

i have a report with the selection screen in attachment. I need to run this report in a backround job. How can i pass the parameters and selection options to this job?

i am familiar with the principle of backround job. Jop Opening, then submit and a least job close. And i think i need to pass the attributes somewhere in the submit section. My question is where exactly ?

i could not find any code example.

Thanks

job.jpg

Somewhere here ?

*" IMPORTING*" VALUE(ARCPARAMS) LIKE ARC_PARAMS STRUCTURE ARC_PARAMS OPTIONAL*" VALUE(AUTHCKNAM) LIKE TBTCJOB-AUTHCKNAM*" VALUE(COMMANDNAME) LIKE SXPGCOLIST-NAME DEFAULT SPACE*" VALUE(OPERATINGSYSTEM) LIKE SY-OPSYS DEFAULT SPACE*" VALUE(EXTPGM_NAME) LIKE TBTCSTEP-PROGRAM DEFAULT SPACE*" VALUE(EXTPGM_PARAM) LIKE TBTCSTEP-PARAMETER DEFAULT SPACE*" VALUE(EXTPGM_SET_TRACE_ON) LIKE BTCH0000-CHAR1 DEFAULT SPACE*" VALUE(EXTPGM_STDERR_IN_JOBLOG) LIKE BTCH0000-CHAR1 DEFAULT 'X'*" VALUE(EXTPGM_STDOUT_IN_JOBLOG) LIKE BTCH0000-CHAR1 DEFAULT 'X'*" VALUE(EXTPGM_SYSTEM) LIKE TBTCSTEP-XPGTGTSYS DEFAULT SPACE*" VALUE(EXTPGM_RFCDEST) LIKE TBTCSTEP-XPGRFCDEST DEFAULT SPACE*" VALUE(EXTPGM_WAIT_FOR_TERMINATION) LIKE BTCH0000-CHAR1 DEFAULT*" 'X'*" VALUE(JOBCOUNT) LIKE TBTCJOB-JOBCOUNT*" VALUE(JOBNAME) LIKE TBTCJOB-JOBNAME*" VALUE(LANGUAGE) LIKE SY-LANGU DEFAULT SY-LANGU*" VALUE(PRIPARAMS) LIKE PRI_PARAMS STRUCTURE PRI_PARAMS DEFAULT*" SPACE*" VALUE(REPORT) LIKE SY-REPID DEFAULT SPACE*" VALUE(VARIANT) LIKE RALDB-VARIANT DEFAULT SPACE

1 ACCEPTED SOLUTION

roberto_forti
Contributor

Hi, below example... regards

DATA: lv_jobname  TYPE btcjob,
      lv_jobcount TYPE btcjobcnt.
...
  SUBMIT program_name USING SELECTION-SCREEN '1000'
 VIA JOB lv_jobname
  NUMBER lv_jobcount
    WITH p_f1 EQ gc_f1x
    WITH p_f2 EQ p_f2x
    WITH p_f3 EQ p_f3x
    WITH s_f4 IN s_f4x[] AND RETURN.

  IF sy-subrc NE 0.
*Job submit failed!
    MESSAGE...
  ENDIF.
...
2 REPLIES 2

roberto_forti
Contributor

Hi, below example... regards

DATA: lv_jobname  TYPE btcjob,
      lv_jobcount TYPE btcjobcnt.
...
  SUBMIT program_name USING SELECTION-SCREEN '1000'
 VIA JOB lv_jobname
  NUMBER lv_jobcount
    WITH p_f1 EQ gc_f1x
    WITH p_f2 EQ p_f2x
    WITH p_f3 EQ p_f3x
    WITH s_f4 IN s_f4x[] AND RETURN.

  IF sy-subrc NE 0.
*Job submit failed!
    MESSAGE...
  ENDIF.
...