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

Former Member
0 Likes
518

Hi,

does the below statement execute in background mode?

If not how can I attach Job name, job count to this statement.

I do not want to use ranges. When calling a different program I want it to open a selection-screen and then process(to retrieve data) in background with selection criteria



Job_open.....

SUBMIT ZABC
VIA SELECTION-SCREEN
EXPORTING LIST TO MEMORY
AND RETURN.

job_close....

Thanks

4 REPLIES 4
Read only

franois_henrotte
Active Contributor
0 Likes
494

look at F1 help on submit statement

you have to use additions USER user VIA JOB job NUMBER n.

Read only

0 Likes
494

Francois

I guess I can't use Via selection-screen

and Via job (both in one statement).

I tried F1 and couldn't find a syntax which clubs both of these.

Can some one plz let me know if the above submit statement executes in background with out specifying jobname???

Read only

Sm1tje
Active Contributor
0 Likes
494

This particular statement can be used in background processing. However, it seems that you want to use foreground and background processing in one program. In that case use the function modules created for this. I believe they are called something like 'JOB_OPEN', 'JOB_CLOSE', etc.

Read only

Former Member
0 Likes
494

Hi,

Please refer the code below:


*Submit report as job(i.e. in background)
data: jobname like tbtcjob-jobname value
                             ' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
      host like msxxlist-host.
data: begin of starttime.
        include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.

* Job open
  call function 'JOB_OPEN'
       exporting
            delanfrep        = ' '
            jobgroup         = ' '
            jobname          = jobname
            sdlstrtdt        = sy-datum
            sdlstrttm        = sy-uzeit
       importing
            jobcount         = jobcount
       exceptions
            cant_create_job  = 01
            invalid_job_data = 02
            jobname_missing  = 03.
  if sy-subrc ne 0.
                                       "error processing
  endif.

* Insert process into job
 SUBMIT zreport and return
                with p_param1 = 'value'
                with p_param2 = 'value'
                user sy-uname
                via job jobname
                number jobcount.
  if sy-subrc > 0.
                                       "error processing
  endif.

* Close job
  starttime-sdlstrtdt = sy-datum + 1.
  starttime-sdlstrttm = '220000'.
  call function 'JOB_CLOSE'
       exporting
            event_id             = starttime-eventid
            event_param          = starttime-eventparm
            event_periodic       = starttime-periodic
            jobcount             = jobcount
            jobname              = jobname
            laststrtdt           = starttime-laststrtdt
            laststrttm           = starttime-laststrttm
            prddays              = 1
            prdhours             = 0
            prdmins              = 0
            prdmonths            = 0
            prdweeks             = 0
            sdlstrtdt            = starttime-sdlstrtdt
            sdlstrttm            = starttime-sdlstrttm
            strtimmed            = starttimeimmediate
            targetsystem         = host
       exceptions
            cant_start_immediate = 01
            invalid_startdate    = 02
            jobname_missing      = 03
            job_close_failed     = 04
            job_nosteps          = 05
            job_notex            = 06
            lock_failed          = 07
            others               = 99.
  if sy-subrc eq 0.
                                       "error processing
  endif.

Thanks,

Sriram Ponna.