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: 

back ground job needed to scheduled immedietly using ABAP coding

Former Member
0 Kudos

is there anything in ABAP coding in JOB_OPEN and JOB_SUBMIT, i can trigger immedtiely ,i need not to goto SM#& and do manualy

please help me in this

thanking you 'sridhar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I use parameter STRTIMMED with function module JOB_CLOSE.



  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      jobname          = local_job-jobname
    IMPORTING
      jobcount         = local_job-jobcount
    EXCEPTIONS
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      OTHERS           = 4.

SUBMIT abap
          WITH param = p_param AND RETURN TO SAP-SPOOL
                VIA JOB local_job-jobname NUMBER local_job-jobcount
              WITHOUT SPOOL DYNPRO
              DESTINATION 'ZMD'
              IMMEDIATELY ' '
              KEEP IN SPOOL 'X'.


    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount             = local_job-jobcount
        jobname              = local_job-jobname
        strtimmed            = 'X'
        targetserver         = w_sys
        .
        .

Cheers

Allan

5 REPLIES 5

Former Member
0 Kudos

Hi,

This can be done for a Single Step Jobs only using BP_JOBVARIANT_SCHEDULE - Schedule a simple background job from an ABAP program. This function module can be used to maintain only one step jobs.

http://help.sap.com/saphelp_40b/helpdata/en/fa/096ccb543b11d1898e0000e8322d00/content.htm

http://help.sap.com/saphelp_40b/helpdata/en/fa/096f0c543b11d1898e0000e8322d00/content.htm

0 Kudos

thnak you very much,

should we use along with JOB_OPEN and JOB_SUBMIT

this fuction module

or just use this fuction module

thanking you

Sridhar

0 Kudos

Hi,

in one more way you can do this also.

make a check box for Background scheduling.


AT Selection Screen.
 IF sy-batch IS INITIAL.
    IF  sscrfields-ucomm EQ 'ONLI' AND ch1 = 'X'.
      sscrfields-ucomm = 'SJOB'.
    ENDIF.
  ENDIF.

if you press f8 it will ask you to schedule the program.

Regards

Sandipan

0 Kudos

THANKS YOU ,

but as i doing coding for Proxy , i dont have option for selection screen , will you please help me in this case

thanking you

sridhar

Former Member
0 Kudos

Hi,

I use parameter STRTIMMED with function module JOB_CLOSE.



  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      jobname          = local_job-jobname
    IMPORTING
      jobcount         = local_job-jobcount
    EXCEPTIONS
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      OTHERS           = 4.

SUBMIT abap
          WITH param = p_param AND RETURN TO SAP-SPOOL
                VIA JOB local_job-jobname NUMBER local_job-jobcount
              WITHOUT SPOOL DYNPRO
              DESTINATION 'ZMD'
              IMMEDIATELY ' '
              KEEP IN SPOOL 'X'.


    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount             = local_job-jobcount
        jobname              = local_job-jobname
        strtimmed            = 'X'
        targetserver         = w_sys
        .
        .

Cheers

Allan