Skip to Content
avatar image
Former Member

Background jobs

how do u setup background jobs in sap?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

9 Answers

  • Best Answer
    avatar image
    Former Member
    May 15, 2007 at 05:51 AM

    Hi,

    SAP background processing automates routine tasks and helps you optimize your organization’s SAP computing resources. Using background processing, you tell the SAP System to run programs for you. Background processing lets you move long-running or resource-intensive program runs to times when the system load is low. It also lets you delegate to the system the task of running reports or programs. Your dialog sessions are not tied up, and reports that run in the background are not subject to the dialog-step run-time limit that applies to interactive sessions.

    yes we can run a call transaction program in background by using mode N.

    Create a Variant for your interface program and Schedule it using SM36 Tcode.

    SM37 tells you the status of the program, whether it is running normally or not.

    For further help you can check these links..which i find good.

    http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7ed1505211d189550000e829fbbd/frameset.htm

    http://help.sap.com/saphelp_nw04s/helpdata/en/ed/a9bb3f8e236d3fe10000000a114084/content.htm

    http://aspalliance.com/1129_Background_Processing_SAP_R3_System

    Hope it helps.

    Regards,

    Parvez

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 15, 2007 at 05:55 AM

    In bdc only we are mainly using background jobs....The t-code is sm37.

    Instead of transfering each record u can go for sm37 and give that program name...It performs in backgroun..

    Reward if usefu,

    regard,

    Zeemamanoj...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 15, 2007 at 05:50 AM

    hi,

    pls go through

    There are two ways for you to handle,

    one manually setting up the job through SM36 which is better and convinient,

    secondly through program using FM's JOB_OPEN, SUBMIT, JOB_CLOSE.

    Find below steps in doing both:

    Procedure 1:

    1. Goto Trans -> SM36

    2. Define a job with the program and variant if any

    3. Click on start condition in application tool bar

    4. In the pop-up window, click on Date/Time

    5. Below you can see a check box "Periodic Job"

    6. Next click on Period Values

    7. Select "Other Period"

    8. Now give '15' for Minutes

    9. Save the job

    Procedure 2 via Program:

    Below is a sample code for the same. Note the ZTEMP2 is the program i am scheduling with 15mins frequency.

    DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,

    L_RELEASE(1) TYPE c.

    CALL FUNCTION 'JOB_OPEN'

    EXPORTING

    JOBNAME = 'ZTEMP2'

    IMPORTING

    JOBCOUNT = P_JOBCNT

    EXCEPTIONS

    CANT_CREATE_JOB = 1

    INVALID_JOB_DATA = 2

    JOBNAME_MISSING = 3

    OTHERS = 4.

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    SUBMIT ZTEMP2 VIA JOB 'ZTEMP2' NUMBER P_JOBCNT

    TO SAP-SPOOL WITHOUT SPOOL DYNPRO

    WITH DESTINATION = 'HPMISPRT'

    WITH IMMEDIATELY = SPACE

    WITH KEEP_IN_SPOOL = 'X' AND RETURN.

    CALL FUNCTION 'JOB_CLOSE'

    EXPORTING

    JOBCOUNT = P_JOBCNT

    JOBNAME = 'ZTEMP2'

    STRTIMMED = 'X'

    PRDMINS = 15

    IMPORTING

    JOB_WAS_RELEASED = L_RELEASE

    EXCEPTIONS

    CANT_START_IMMEDIATE = 1

    INVALID_STARTDATE = 2

    JOBNAME_MISSING = 3

    JOB_CLOSE_FAILED = 4

    JOB_NOSTEPS = 5

    JOB_NOTEX = 6

    LOCK_FAILED = 7

    INVALID_TARGET = 8

    OTHERS = 9.

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    Hope the above helps you.

    pls give reward if it helpful

    thnaks

    Vana

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 15, 2007 at 05:58 AM

    hi lakshamn,

    t.code:sm35..in that select ur program and then execute and then do analyse the program strategy.

    thanks and regards

    vijay

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 15, 2007 at 05:48 AM

    hi lakshmanan,

    go to sm36 t.code,

    give job name 'zxxx',

    then press on 'STEP' button on application tool bar,

    then under the name give your report name and varinat name for that reprot,

    then save,

    go to start codition on application tool bar there deifne ur settings,

    then go to t.code sm37 and provide your job name and excute...

    regards..

    seshu.

    Message was edited by:

    maddipatla Seshu chowdary

    Message was edited by:

    maddipatla Seshu chowdary

    Add comment
    10|10000 characters needed characters exceeded

  • May 15, 2007 at 05:49 AM

    hi,

    Execute your report on the selection screen \

    Program--> Execute in background..

    Else you can schedule your job in SM35/SM36

    reward if useful

    regards,

    nazeer

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 15, 2007 at 05:50 AM

    Hi ,

    You can use SM36 and use the "Job Wizard" to define a background job in simple step by step procedure

    Or

    Goto SM37 and specify a job name.

    Next specify the ABAP Program Name of the report you want to execute under Job Step.

    Then click on "Extended Job Selection" and goto the Period Tab.

    There select "Only Periodic Jobs" and then specify the frequency of execution based on Months, Weeks, Days, Hours or Minutes.

    2)you can execute the report in background in SM37 , there are two options , one is as said using f9 or you can make SY-BATCH eq 'X'.

    if x run the report or exit from the program.

    so this way you can execute the report in background and check the spool in sm37

    In order to restrict the user to run it only in background , you can as well check for SY-BATCH condition.

    The other way is try to remove "execute in foreground" option from the menu and this can be done with the function module .

    data: begin of int_exc occurs 0,

    code like sy-ucomm,

    end of int_exc.

    data wf_repid .

    initialization.

    clear int_exc.

    int_exc-code = 'ONLI'.

    append int_exc.

    int_exc-code = 'PRIN'.

    append int_exc.

    move: sy-repid to wf_repid .

    call function 'RS_SET_SELSCREEN_STATUS'

    exporting

    p_status = '%_00'

    p_program = 'wf_repid'

    tables

    p_exclude = int_exc

    Hope this helps,

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 15, 2007 at 05:53 AM

    use tcode <b>SM36</b>

    add job name

    Click <b>Job wizard</b> in the button set (to op the screen)

    Click <b>Continue</b>

    Enter <b>Job name</b> and press <b>continue</b>

    Select <b>ABAP program</b> and press <b>Continue</b>

    enter Program name and pres continue

    Continue

    set Schedule type and continue

    ser scedule and continue

    when u finish

    use tcode SM37 for display

    Rewards if helpful.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 15, 2007 at 06:27 AM

    answered

    Add comment
    10|10000 characters needed characters exceeded