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: 

any restictions on back ground job when submit the session?

Former Member
0 Kudos

Hello friends

below is my code part. problem is when i execute this program in back ground the data is not picking from APQI. but in fore ground it is picking . for this SESSION submission in back ground am i missing any thing here. please suggest me , any restiction is their in back ground? if possible please send a sample code to submit SESSION automatically in background.

SUBMIT rsbdcsub AND RETURN

USER sy-uname

WITH mappe = p_group

WITH von = sy-datum

WITH bis = sy-datum

WITH z_verarb = 'X' .

SELECT userid credate groupid qstate FROM apqi

INTO TABLE it_apqi

WHERE userid = sy-uname

AND credate = sy-datum

AND groupid = p_group

AND qstate = 'E'. "Only look for 'Error' status

DESCRIBE TABLE it_apqi[] LINES temp.

8 REPLIES 8

former_member555112
Active Contributor
0 Kudos

Hi,

To submit session in background you will have to create a job.

Create a job using JOB_OPEN JOB_SUBMIT and JOB_CLOSE FM.

Regards,

Ankur Parab

Former Member
0 Kudos

Because the batch input session has not yet completed.

Rob

0 Kudos

HI Anukar

thanks for your confirmation if i use JOB_OPEN JOB_SUBMIT and JOB_CLOSE FM's

does it work for both forre ground and back ground.

Hi Rob

thanks for ur answer .session has been completed before going to hit the data base APQI table

because i checked that , i have written (wait statement 50 sec)before going toi hit APQI table .

the entry is availble.

Thanks

0 Kudos

Hi,

The FMs will basically create a Job which will be scheduled to run in background as the parameters provided to them.

Regards,

Ankur Parab

0 Kudos

Thanks

could u please provide the sample code when we submiting the seesion through RSBDCSUB in back ground

Thanks

0 Kudos

Codes for Submitting the session through RSBDCSUB (via Job)...



" The function module JOB_OPEN is called to create the job.
    call function 'JOB_OPEN'
         exporting
              delanfrep        = 'X'  "Delete job after execution
              jobname        = fv_jobname  "Job name
         importing
              jobcount         = fv_jobcount  "Internally generated
         exceptions
              cant_create_job  = 1
              invalid_job_data = 2
              jobname_missing  = 3
              others           = 4.

    if sy-subrc = 0.
      submit rsbdcsub
             with       mappe = v_filec
             with            von = sy-datum      "From
             with            bis = sy-datum      "To
             with     z_verarb = 'X'
             with         fehler = ' '
             with      batchsys = space
             with         logall = ' '
             via  job          fv_jobname
                  number       fv_jobcount
             and return.

      call function 'JOB_CLOSE'
           exporting
                jobcount             = fv_jobcount
                jobname              = fv_jobname
                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.

Hope this helps!

Edited by: Vin on Jun 4, 2009 10:58 AM

0 Kudos

Hi Vin

could please confirm me what exactly the parameters do like below and all are mandatory?

mappe

von

bis

z_verarb

fehler

batchsys

logall

submit rsbdcsub

with mappe = v_filec

with von = sy-datum "From

with bis = sy-datum "To

with z_verarb = 'X'

with fehler = ' '

with batchsys = space

with logall = ' '

via job fv_jobname

number fv_jobcount

thanks in advance

0 Kudos

Hi Rob ur correct

job not yet completed .

but could u please confirm one thing if i use select statement to check the status of the session from APQI inside loop in foreground it is working but why it is not working back ground.

and if i use select statement in outside loop it is working in both cases .

why?

just give me replay so that i can close this thred , i give Fu11 credit to u.

Thanks.