Regarding Back ground reports

Hi,
is it possible to get the o/p in alv-grid while executing in background
if so can any one plz explain points will be rewarded for sure..
thanks in advanace

Hi
Many a times there is a requirement to display ALV Grid (not ALV List) in the background Job. I have checked the SDN Forum for the same and it has been mentioned that ALV Grid cannot be displayed in Background, but the list output of ALV is possible. So user won’t have the actual Grid interface but the List interface.
There is a workaround to display ALV Grid in Background Job. The only restriction is you can’t schedule the job through SM36. You need to execute the transaction of the report program, fill in the selection screen data and hit Execute.
The job would be executed in background. User will be able to see the Job Log and Job Status after executing the program. User doesn’t have to go to SM37 to view the job status/log. Once the Job Status is changed to “COMPLETED”, user can click on “DISPLAY SPOOL” to view the ALV Grid.
/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job

Similar Messages

  • 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

  • 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

  • Regarding back ground processing for excel.

    Hi,
    i want to create the Excel sheet and i want to save in Back ground Processing....
    give me some suggestionss.......................

    This can create any file (spreadsheet/plain text/ dat files). but to add workbooks to the sheet you need to use OLE Object concepts.
    PARAMETERS:    p_terms(256) TYPE c OBLIGATORY,
                p_del(1)     TYPE c OBLIGATORY DEFAULT cl_abap_char_utilities=>horizontal_tab.
    DATA:       lv_str       TYPE string,
          lv_char(256) TYPE c,
          lr_descrref  TYPE REF TO cl_abap_typedescr.
    FIELD-SYMBOLS: <comp> TYPE ANY.
      IF itab IS NOT INITIAL.
        OPEN DATASET p_terms FOR OUTPUT IN LEGACY TEXT MODE .
        IF sy-subrc EQ 0.
          CLEAR : lv_str.
    Header of the file
          CONCATENATE
            'Action'
            'Name'
            'EE User ID'
            'Termination Date'
            'Last Day Worked'
            'End Of Notice'
            'Employee Type'
            'Department'
            'Department_type'
            'Office Location'
            'Manager Name'
            'Has Cellphone'
            'Has Home Office'
            'VP and Above'
           cl_abap_char_utilities=>cr_lf
          INTO lv_str SEPARATED BY p_del.
          LOOP AT itab INTO ls_terms.
            WHILE sy-subrc EQ 0.
              ASSIGN COMPONENT sy-index  OF STRUCTURE ls_terms TO <comp>.
              IF sy-subrc NE 0.
                EXIT.
              ENDIF.
              lr_descrref = cl_abap_typedescr=>describe_by_data( <comp> ).
              IF lr_descrref->type_kind = 'P'.
                WRITE <comp> TO lv_char DECIMALS 2.
              ELSE.
                WRITE <comp> TO lv_char.
              ENDIF.
              SHIFT lv_char LEFT DELETING LEADING space.
              IF sy-index NE 1.
                CONCATENATE lv_str lv_char INTO lv_str SEPARATED BY p_del.
              ELSE.
                CONCATENATE lv_str lv_char INTO lv_str.
              ENDIF.
              CLEAR: lv_char.
            ENDWHILE.
            TRY.
    This statement passes the content of data object to the file specified
                TRANSFER lv_str TO p_terms.
              CATCH cx_sy_file_authority .
                FORMAT COLOR 6 ON.
                WRITE:/ 'No authorization to access the Term file'.
            ENDTRY.
            CLEAR lv_str.
          ENDLOOP.
          CLOSE DATASET p_terms.
        ENDIF.
      ENDIF.

  • Back ground Report

    Hi ,
              I have a reqiurement where i have to change the structure of the report output running in background mode .
    For eg now when i am running the report in background in the output i am getting three lists an the sequence say
    X
    Y
    Z
    Now as per new reqiurement i need to change it in such a way that in back grnd i will get it as
    Y
    Z
    X
    Note-- There should Not Be any Changes in the foregruond Report .
    Please suggest me some way to look into this .

    Hi Arun,
    Just check the value of sy-batch
    IF sy-batch = 'X'.
    **background logic
    Else.
    normal logic.
    endif.
    Plz revert for further clarifications if required.
    Reward if helpful
    Thanks,
    Mandeep

  • 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 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>

  • Regarding Back ground

    If i set a flag at the initialization event of a program, i need to restrict that program to run in Background mode.
    How ?
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 6:03 PM

    Hi,
    INITIALIZATION.
    flag = 'X'.
    START-OF-SELECTION.
    IF sy-batch NE 'X'.    " foreground
    IF flag = 'X'.
    Message i000 WITH 'Program can be run only in background'.
    LEAVE-LIST PROCESSING.
    ENDIF.
    ENDIF.
    Hope thsi solves your problem.

  • 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.

  • Submiting report in back ground with values

    Hello all abapers,
      I m working on one application where one module pool program will take input from user for user id and password. After verification, one back ground report will be scheduled by this program to change user pw and add some role in user's profile.
    when i schedule the prg in background i need to pass some values like user id and password entered on module pool screen...
    how do i pass it to background job when scheduling and how bg job prg will read these values..
    please advise me as its needed asap...
    thanks in advance,
    jigs.
    any helpful suggestions will be rewarded.

    Hi,
    Put the following code in user command:
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname                = 'ZSUBMIT'
    IMPORTING
       jobcount               = jbcnt
    EXCEPTIONS
       cant_create_job        = 1
       invalid_job_data       = 2
       jobname_missing        = 3
       OTHERS                 = 4
    IF sy-subrc <> 0.
    ENDIF.
    SUBMIT <program to be submitted> WITH P_user_id = user id  VIA JOB 'ZSUBMIT' NUMBER jbcnt AND RETURN.
    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount                          = jbcnt
        jobname                           = 'ZSUBMIT'
        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
       INVALID_TARGET                    = 8
       OTHERS                            = 9
    IF sy-subrc <> 0.
    ENDIF.
    A job called 'ZSUBMIT' will be released in background.
    Please try and award points if useful.
    Thanks and regards,
    S. Chandra Mouli.

  • 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 proces.

    Hi all,
    i have a alv report when i say execute it is taking long time for the output.
    can anybody tell me regarding back ground process and later i can see the result.
    in simple i want to see the report may be next day.
    how can i do this.
    kindly help me regarding this if possible with example(sample code).
    surely rewarded with points.
    thanks in advance,
    regards,
    venu.

    report zrich_0004 .
    data:   sdate type sy-datum,
            stime type sy-uzeit,
            l_valid,
            ls_params like pri_params,
            l_jobcount like tbtcjob-jobcount,
            l_jobname  like tbtcjob-jobname.
    start-of-selection.
    * Get Print Parameters
      call function 'GET_PRINT_PARAMETERS'
           exporting
                no_dialog      = 'X'
           importing
                valid          = l_valid
                out_parameters = ls_params.
    * Open Job
      l_jobname = 'ZRICH_0005'.
      call function 'JOB_OPEN'
           exporting
                jobname  = l_jobname
           importing
                jobcount = l_jobcount.
    * Submit report to job
      submit zrich_0005
           via job     l_jobname
               number  l_jobcount
           to sap-spool without spool dynpro
               spool parameters ls_params
                  and return.
    * Kick job off 30 seconds from now.
      sdate = sy-datum.
      stime = sy-uzeit + 30.
    * Schedule and close job.
      call function 'JOB_CLOSE'
           exporting
                jobcount  = l_jobcount
                jobname   = l_jobname
                sdlstrtdt = sdate
                sdlstrttm = stime
    *            strtimmed = 'X'
    Regards,
    Rich Heilman

  • 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.

  • Alv report in back ground

    Hi All,
    Can we run alv report in back ground,if yes how?
    Thanks&Regards.
    Srikanth.V

    hi Ramu,
    Run in Background but make sure it is alv list, not alv Grid FM. if you are uisng alv list not problem , but if you are using alv grid then you can code like this..
    if sy-batch = ' '.
    call 'REUSE_ALV_GRID_DISPLAY'.
    else.
    call 'REUSE_ALV_LIST_DISPLAY'.
    endif.
    if you are using OO alv then write this code..
    CALL METHOD cl_gui_alv_grid=>offline
                    RECEIVING e_offline = off.
        IF off IS INITIAL.
          CREATE OBJECT g_custom_container
                 EXPORTING container_name = g_container.
        ENDIF.

Maybe you are looking for