Regarding : back ground jobs

Hi,
Please let me know , in how many ways we can shedule a program as a background job, and  how we pass variants to the job.
Thanks in advance
jogu

hi,
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
In SM37 u can check the status of the jobs that u have assigned to background...
Here u mention the job name or the report name to check the status of the job...
After mentioning the job name or program name u just execute it.. ( without any name also u can execute then it gives u all the jobs set by your user name..
the status colud be released,active,finished etc..
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.
http://help.sap.com/saphelp_bw30b/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm
<b>Reward if usefull</b>

Similar Messages

  • Regarding back ground job scheduling

    Hi,
        one of our program was sheduled for back ground job, by another user, so just i need to knwo when this job is sheduled and it is executing daily, so, i need to knwo whether he has created a background job through , sm36, or through a program, how could i found it out.
    thanks in advance.
    jogu

    It is difficult to say. But if you can go to SM37 and check the log of the JOB it will dispaly you some messages.
    This might help you.
    Regards,
    Naimesh Patel

  • Hi regarding back ground jobs

    I have a report which is scheduled to run 2 times in the background.
    here i am using OO ALV when to display output when run in back ground.
    but i am getting an error when the same report is run in the back ground, stating there is a problem with the object references.
    but one of my friend tried it and is successful to run in the background but another problem, when run in foreground 10 records are displayed and when run in background only 2 records are displayed for the same criteria.in both the cases i am sending the output to the file on appl server.
    pls help me its urgent.
    pionts are assured.

    Ravi,
    I have faced the same problem when I schedule the job in background.
    When the report was run in forground, it gives expected results, and when it run in background, it will supress some fields and disply the report output.
    This problem, I have debugged it and corrected, and its application specific I can say, cant conclude it  by seeing the problem, needs to do much research and fix it up.
    Regards,
    Sujatha.

  • Regarding back ground job sheduling

    hi,
    could u plz clear my issu
             i am running a report which i want to shedule in back ground by writing the code within in that program.
    very urgent

    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
    In SM37 u can check the status of the jobs that u have assigned to background...
    Here u mention the job name or the report name to check the status of the job...
    After mentioning the job name or program name u just execute it.. ( without any name also u can execute then it gives u all the jobs set by your user name..
    the status colud be released,active,finished etc..
    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.
    *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

  • This is regarding back ground job scheduling

    Hi to all...........
    1....here iam using background job scheduling for a report to run under background.I difine the backgorund job at sm36 and i had given the job name and time ,date in sm37.
                            With this details the report executed sucessfully.Now i want to see the output list for that report.Please tell that where i have to see the output list.
    what is the transaction code for displaying that output list?????????????????
    Thanks and regards,
    k.swaminath

    Go to SM36.. select ownjobs..
    List will come.. Select your job (check box) and click SPOOL ...
    Output will come like this..
      Spool no.  Type Date       Time  Status  Pages Title
           16501      24.10.2007 11:25 Waiting    7  LIST1S LOCA Z00_SELECT_S
    Press the Icon under Type...
    Output will get displayed..
    Message was edited by:
            Rama Jyothi

  • Regarding back ground job

    hi,
    I have a  program which includes a bdc  code.when i run that program it will take me to mb1a i.e goods issue.i have to press enter each time for each and every item .Is there any way i can do this as background job. i haven't done anything related to background .can u please guide me each and every step.
    Thanks in advance

    hi suchitra,
    check the transaction <b>sm36</b> give ur job name.
    click on the <b>job wizard</b> button and flow the steps.
    http://help.sap.com/saphelp_nw04/helpdata/en/73/69ef5755bb11d189680000e829fbbd/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/2c513897110872e10000009b38f889/content.htm
    check ur job status in transaction<b>sm37</b>and press execute.
    hope this helps,
    <b>do reward if it helps,</b>
    priya.

  • Back Ground Job not Working

    Hi,
    I have watched all the threads regarding Back Ground job like SE36 & SE37. I have given a back ground job and its not working.
    Its an ABAP Program which is creating an OLEDB Connection to MSACCESS and then retrieving and updating database table. The program is working very fine on foreground but when it is given to back ground job then it shows that the program is running, i mean in delay the time is ticking. But at last it is canceled by the system.
    What's the thing i am missing or what should i do here? I have already set my program at high priority.
    Thanks.

    Hi Atish,
    Are you sure that we cannot run in background? Can you please explain me why it cant be done.
    Thanks,
    Inder.

  • How To Handle With Back Ground JOB From WEBUI When Click On "Appove"

    Hi
    How To Scheduled A Job Through ABAP Report In back end  Of CRM when i click on "Approve" Button in WEBUI  From result list.
    As per My requirement I have a Search View and Result View
    In Search View I have  Below Fields
    ITC Vendor ID    
    Claim Status
    User status (date status changed)
    Model
    Serial Number
    Date completed of Service Completion
    Based on Search Criteria I will get Result In Result View.(Suppose 10 Records I got In Result View)
    In the Result View I need to Add one Button As "Approve"
    When i Click On Approve button One Pop up Message Need to Open And In that popup window I need to Display Below Text
    "Approve  Claim Job Has Started In Background  
    Note: Only Claims Which are in Submitted  Status  Will be  Approved. you May Close This Window"
    In SAP CRM System  Back Ground Job Need To Start When Click On "Approve" Button In WEBUI .
    In the Back Ground ABAP Report which will validate based on Result List Records"
    In the Result List we may have all types of Claims which are status in "Submitted" "Pending" "Rejected" "Approve".
    I need to collect all records from Result list and validate Those Records who's Status in "Submitted
    1)Sort all the claims based on ITC Vendor ID.
    2)Grouped all the submitted claims against each ITC Vendor ID from the search result
    3)Change the status of the selected submitted claims to Approved.
    4)Displays information messages as mentioned whenever a claim is approved, the same message will be captured in the job log.
    ‘Claims <ClaimID 1>,…<ClaimID N> now approved for ITC Vendor ID’.
    5)Sending Email to each IRC.
    6)Capture all the approved claims in the below format (Format Attached "Screen Shot Attachment")
    7)Store the file in the Application Server AL11 in .csv format
    Please Find Attachement For Reference.
    1)ITC Claim Screen Shot
    2)Screen Shot For Attachment
    Thanks
    Raj

    Hi,
    You can add the following code in on approve method to show popup to the user,
    IF req_edit IS NOT BOUND. " gloabl attribute in impl class of the view
        REFRESH lt_buttons.
        lss_button-id  = 'btnyes'.
        lss_button-text = 'YES'.
        lss_button-on_click = 'YES'.
        APPEND lss_button TO lt_buttons.
        CLEAR lss_button.
        lss_button-id  = 'btnno'.
        lss_button-text = 'NO'.
        lss_button-on_click = 'NO'.
        APPEND lss_button TO lt_buttons.
        CLEAR lss_button.
        CALL METHOD comp_controller->window_manager->create_popup_2_confirm
          EXPORTING
            iv_title          = 'ATTENTION'
            iv_text           = 'Are you sure you want to edit this document?'
            iv_btncombination = '99'
            iv_custombuttons  = lt_buttons
          RECEIVING
            rv_result         = req_edit.
        req_edit->set_on_close_event( iv_event_name = 'EDIT' iv_view = me ). "#EC NOTEXT
        req_edit->open( ).
        RETURN.
      ELSE.
        lr_node ?= req_edit->get_context_node( 'OUTPUTNODE' ).
        lv_outbound = lr_node->get_event_name( ).
    *  CLEAR ptc_pricing_status.
    *    lv_outbound = req_edit->get_fired_outbound_plug( ).
        IF lv_outbound = 'YES'.
    you can use the submit report code here and you can al the validations here
        ELSE. " No
    if user clicks no nothing to do..
        ENDIF.
        CLEAR req_edit.
      ENDIF.
    Best Regards,
    Dharmakasi.

  • How to find the back ground job details

    Hi All,
       I have a back ground  job running from many days, now we would like to know when this job was created on what date this job actvlly created and schuduled.
               Please informe me how to check this.
    Thanks & Regards,
    Muralikrishna

    On SM37 screen there is plenty of options are there:
    This is what i got from SAP help
    Explanation for each selection field:                                                                               
    o   Jobname: Name of the job as an identifier.                                                                               
    o   Username: Name of the user who designed and planned the job.                                                                               
    o   Start date: The start condition of the job, which could be a time 
    frame or an event that the job is waiting for. Specifying both will   
    yield jobs whose starting condition is  either of the two             
    conditions.                                                                               
    ABAP program step: Name of an ABAP program that acts as a step in a   
    job.                                                                               
    Status selection: The current status of the job. By default, the      
    SCHEDULED option is not marked. To see the scheduled jobs, you must   
    explicitly check this.
    also give the proper values in Job Satus also.

  • Scheduling Back Ground job

    Hi All,
    I need to schedule a daily background job for MB52 transaction and need to save the output of MB52 in a specified directory .
    Can any one tell me whether it is possible to save back ground job output in specified directory?
    Thanks & Regards
    k.Nirmala

    Hi Nirmala,
    Set up variant at MB52 transaction and use SM37 and Sm36 transaction to schedule job.
    Define job at Sm36 and use program - RM07MLBS and use your variant.
    schedule job and set up time and date for periodcally.
    and it will run and you can see the status at SM37 Transaction .
    the background job will create spool and which will contain your output.
    if you want to download your output ,then you need to write custom program to get spool information from TSP01 table and use open dataset command to down load specifi directory.
    Reward Points if it is helpful
    Thanks
    Seshu

  • Error while activating ODS is not caught in the back ground job..

    Hi All,
    We have a back ground job to load data to ODS and to activate it..If there is any error while loading or activating the data, back ground job is going into loop instead of cancelling the job..As the job is going into loop we are unable to trace the error unless we cancel the job manually and checking it..We have switched off displaying any messages while doing the back ground job...also we can not set any time limit for the job as it always depends on the volume of the data.
    My requirement is , back ground job must get cancelled if there is any error while loading the ODS..Can anybody suggest any idea on this..
    Thanks for reading.
    Umamaheswar kumar

    Hi Uma,
    A few hints for running and schedule and monitoring process chains:
    - always schedule the process chain in tcode RSPC
    - check the log in RSPC for error messages, or
    - check BW monitor for the ODS concerned (tcode RSMO, tab Details)
    if anything is not working fine, the status of the corresponding load will show you the errors, warnings ...
    either in RSPC - log or RSMO.
    hope it helps.
    Regards,
    Lilly

  • How to download the application file to local file by back ground job?

    hi:
      can any one tell me how to download the application file to local file by back ground job? thanks in advance..
    Monson

    Hi,
    In order to download a file from application layer to a local file in background,
    first write a report(ZREPORT1) in which do the following steps:
    OPEN DATASET g_file_1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    loop the g_file and append all the data into another internal table.
    end of this report you shd have all the data in the application layer file into your internal table.
    Now create another report(ZREPORT2) and submit this report in background.
    that is,
    JOB_OPEN
    JOB_SUBMIT and
    JOB_CLOSE
    and in job_submit submit ZREPORT1 which downloads the file in application layer.
    Please reward points if helpful.
    Regards,
    Arul.

  • Back ground job scheduling

    hi,
    question regarding back ground scheduling, one program consists of a selection screen having some input field and program calling SMARTFORMS in the program. When I shedule it in back ground I am not seeing output in the spool, and job is not completed sucessfully, so what is the problem??

    Hi Rajesh,
    probably the report is not designed to work properly in background.
    Give some details.
    Regards,
    Clemens

  • Back ground job schduling

    hai  experts ,
    iam write report upload data from excell file and posting  tcode mb31 by useing bapi.
    but i schdule  back ground job   results come cancelled.
    error is like .
       job started                                                                00                     516       s
      step started001 (varient ,user id sapadmin)             00                    550      s
    error during import of clipboard content                   alsmex              037       a
    job cancelled                                                               00                   518       a
    thanks in advance.

    The dump suggests that your report use a clipboard GUI functionality in background, so i fear there are very few chance of success (Usage of ALSM_EXCEL_TO_INTERNAL_TABLE which call CLPB_IMPORT or CL_GUI_FRONTEND_SERVICES->CLIPBOARD_IMPORT in background ?)
    Perform some search at sdn with keywords Excel, upload and Background in [forums|http://forums.sdn.sap.com/search.jspa?threadID=&q=ExcelBackgroundupload&objID=&dateRange=last90days&numResults=15&rankBy=10001] and [wiki|http://wiki.sdn.sap.com/wiki/dosearchsite.action?searchQuery.queryString=ExcelBackgroundupload&searchQuery.spaceKey=conf_global].
    Regards,
    Raymond

  • Back ground job for dtp

    hi,
    is there any possibility to do back ground job for dtp.
    if possible can u tell me the necessary settings?

    Hi Venkat,
    The way to schedule a DTP in BI in NW 2004s is by putting it inside a process chain. The process chain can be scheduled.
    See the following link on process chains.
    http://help.sap.com/saphelp_nw04s/helpdata/en/d5/e80d3dbd82f72ce10000000a114084/frameset.htm
    Hope this helps,
    Regards
    Karthik
    Assign points if helpful.

Maybe you are looking for

  • How do I access files that I put in iCloud Drive on my iMac and MacBook Pro, and then access them with ANY iOS device?

    For example, I put some .pdf documents into iCloud Drive. Now I need those files but I'm not home any more----I have an iPhone and iPad at my disposal. They are ALL signed into the same iCloud account and they are all on the same WiFi network. Those

  • How to connect to Linksys Wireless Print Server (WPS54GU2) from WIndows 7

    I tried the Print Server Utility that was loaded from the WPS54GU2 user install disk. Ended up with an AddPort error. Went ahead and created local printer for printer I was trying to get to (Epson Color Stylus 400). Did a "Printer Properties" on the

  • Long Term Planning-Planning File Entry

    Hi Gurus/Friends In the long term planning after PIR with inactive version and creating Scenario, assinging versions, Plants,....then during Release+Save it is giving the Result of Planning File Entries Logically the system has suppose to give the Nu

  • MobileMe Gallery or flickr

    ...is better for sharing 15000 photos? Particularly I'd like to ask you two things: 1: I know that when you share an iPhoto album it auto syncs with MMe Gallery when you make changes. Correct? 2: Flickr does the same? I've tried both in the past and

  • In search of Projects based on Lab view.

    Hi,     Iam Chaitanya, pursuing M.tech.. Iam using Lab VIEW,it is a good platform to work in realistic so I interested to do Lab VIEW projects. Can you please suggest projects based on Real-time applications or electronics.