Background ID in ALV Grid

Hi all,
I am developing one report in ALV Grid with header and footer.
Now i also want background.....
I am giving 'ALV_BACKGROUND' as background id in RESUSE_ALV_GRID_DISPLAY.....
Now my problem is background not coming...
And when i remove information from Header and Footer background is comin.
So please can anyone help me.
Thanks in advance

Hi,
Thanks for ur help.
But still not workin.
can u just go through my code
Thanks
*& report  ztest_ds
REPORT  ztest_ds.
TABLES : mseg,
         mkpf,
         mara,
         t023t.
TYPE-POOLS : slis.
DATA : BEGIN OF i_tab OCCURS 0,
       matnr LIKE mseg-matnr,   " MAT NUMBER
       maktx LIKE makt-maktx,   " MATERIAL DESCIPTION
       werks LIKE mseg-werks,   " PLANT
       lgort LIKE mseg-lgort,    "STORAGE LOCATION
       matkl LIKE t023t-matkl,  " MATERIAL GROUP
       END OF i_tab.
DATA: checkmatnr LIKE mara-matnr, checkmatnr1 LIKE mara-matnr.
DATA: w_mtart LIKE mara-mtart.
DATA : t_fcat   TYPE slis_t_fieldcat_alv,
       t_event TYPE slis_t_event,
       t_list_top_of_page TYPE slis_t_listheader,
       t_list_end_of_page TYPE slis_t_listheader.
DATA:
       st_line TYPE slis_listheader,
       st_layout TYPE slis_layout_alv,
       st_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
       st_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
CONSTANTS:c_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
CONSTANTS:c_formname_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : p_matnr FOR mara-matnr OBLIGATORY .
SELECTION-SCREEN : END OF BLOCK blk1.
DATA : BEGIN OF i_tab2 OCCURS 0,
       matnr LIKE mseg-matnr,   " MAT NUMBER
       lgort LIKE mseg-lgort,    "STORAGE LOCATION
       werks LIKE mseg-werks,   " PLANT
       matkl LIKE t023t-matkl,   " MATERIAL GROUP
       maktx LIKE makt-maktx,   " MATERIAL DESCRIPTION
       END OF i_tab2.
AT SELECTION-SCREEN.
  PERFORM get_data1.
  PERFORM   create_field_catalog.
  PERFORM   header_eventtab_build USING t_event[].
  PERFORM   header_build  USING t_list_top_of_page[].
  PERFORM   footer_build  USING t_list_end_of_page[].
  PERFORM   write_alv_list.
*&      FORM  GET_DATA
FORM get_data1.
  SELECT maramatnr maktmaktx msegwerks mseglgort mara~matkl INTO CORRESPONDING
  FIELDS OF i_tab FROM mara
  INNER JOIN makt ON maramatnr = maktmatnr
  INNER JOIN mseg ON maramatnr = msegmatnr
  WHERE  mseg~matnr = p_matnr-low.
    APPEND i_tab.
  ENDSELECT.
  LOOP AT i_tab.
    MOVE-CORRESPONDING i_tab TO i_tab2.
    APPEND i_tab2.
  ENDLOOP.
ENDFORM.                                                    "GET_DATA1
**&      FORM  CREATE_FIELD_CATALOG
FORM create_field_catalog .
  PERFORM add_field_catalog USING :
  '01' 'MATNR'   'I_TAB2'  'PRODUCT CODE'             '08' ' ' 'C50',
  '02' 'MAKTX'   'I_TAB2'  'PRODUCT NAME'             '40' ' ' 'C60',
  '03' 'WERKS'   'I_TAB2'  'PLANT'                    '4' ' ' 'C70',
  '04' 'LGORT'   'I_TAB2'  'STORAGE LOCATION'         '4' ' ' 'C80',
  '05' 'MATKL'   'I_TAB2'  'GROUP'                    '9' ' ' 'C100'.
ENDFORM.                    " CREATE_FIELD_CATALOG
*&      FORM  HEADER_EVENTTAB_BUILD
FORM header_eventtab_build  USING   p_gt_event TYPE slis_t_event.
  DATA: ls_event TYPE slis_alv_event.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type = 0
    IMPORTING
      et_events   = p_gt_event.
READ TABLE p_gt_event WITH KEY name =  slis_ev_top_of_page INTO ls_event.
IF sy-subrc = 0.
   MOVE c_formname_top_of_page TO ls_event-form.
   MODIFY p_gt_event FROM ls_event INDEX sy-tabix.
ENDIF.
  READ TABLE p_gt_event WITH KEY name =  slis_ev_end_of_list INTO ls_event.
  IF sy-subrc = 0.
    MOVE c_formname_end_of_page TO ls_event-form.
    MODIFY p_gt_event FROM ls_event INDEX sy-tabix.
  ENDIF.
ENDFORM.                    " HEADER_EVENTTAB_BUILD
*&      FORM  HEADER_BUILD
FORM top_of_page.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = t_list_top_of_page.
     I_LOGO             = 'TORRENT'.
ENDFORM.                    "TOP_OF_PAGE
*&      FORM  HEADER_BUILD
FORM header_build  USING  p_gt_list_top_of_page TYPE slis_t_listheader.
  DATA:BEGIN OF tab_info OCCURS 0,
       mat_no LIKE mara-matnr,
       mat_desc LIKE makt-maktx,
       END OF tab_info.
  SELECT SINGLE maramatnr maktmaktx INTO (tab_info-mat_no,tab_info-mat_desc) FROM mara JOIN makt ON maramatnr = maktmatnr
  WHERE mara~matnr = p_matnr-low.
  APPEND tab_info.
  CLEAR st_line.
  st_line-typ   = 'H'.
  st_line-info  = tab_info-mat_no.
  APPEND st_line TO p_gt_list_top_of_page.
  CLEAR st_line .
  st_line-typ   = 'S'.  "H-HEADER,S-SELECTION,A-APPLICATION
  st_line-info  = tab_info-mat_desc.  " FOR START DATE
  APPEND  st_line TO p_gt_list_top_of_page.
ENDFORM.                    " HEADER_BUILD
*&      FORM  WRITE_ALV_LIST
FORM write_alv_list .
  st_layout-info_fieldname = 'COLOR'.
  st_layout-no_vline = ''.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program     = 'ZTEST_DS'
      i_callback_top_of_page = 'TOP_OF_PAGE'
      i_background_id        = 'ALV_BACKGROUND'
      is_layout              = st_layout
      it_fieldcat            = t_fcat
      it_events              = t_event
    TABLES
      t_outtab               = i_tab2
    EXCEPTIONS
      program_error          = 1
      OTHERS                 = 2.
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " WRITE_ALV_LIST
*&      FORM  ADD_FIELD_CATALOG
FORM add_field_catalog  USING
                                p_col_pos
                                p_fieldname
                                p_tabname
                                p_text
                                p_outputlen
                                p_round
                                p_colour.
  st_fcat-row_pos         = '1'.
  st_fcat-col_pos         = p_col_pos.
  st_fcat-fieldname       = p_fieldname.
  st_fcat-tabname         = p_tabname.
  st_fcat-reptext_ddic    = p_text.
  st_fcat-outputlen       = p_outputlen.
  st_fcat-round           = p_round.
  st_fcat-emphasize       = p_colour. "COLOUR A  COLUMN
  APPEND st_fcat TO t_fcat.
  CLEAR st_fcat.
ENDFORM.                    " ADD_FIELD_CATALOG
*&      FORM  END_OF_PAGE
FORM end_of_page.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = t_list_end_of_page
      i_end_of_list_grid = 'X'.
ENDFORM.                    "TOP_OF_PAGE
*&      FORM  FOOTER_BUILD
FORM footer_build  USING  p_gt_list_end_of_page TYPE slis_t_listheader.
  DATA:BEGIN OF tab_info1 OCCURS 0,
        mat_no LIKE mara-matnr,
        mat_desc LIKE makt-maktx,
        END OF tab_info1.
  SELECT SINGLE maramatnr maktmaktx INTO (tab_info1-mat_no,tab_info1-mat_desc) FROM mara JOIN makt ON maramatnr = maktmatnr
  WHERE mara~matnr = p_matnr-low.
  APPEND tab_info1.
  CLEAR st_line.
  st_line-typ   = 'H'.
  st_line-info  = tab_info1-mat_no..   " ONLY FOR NEW LINE DISPLAY PURPOSE
  APPEND st_line TO p_gt_list_end_of_page.
  CLEAR st_line.
  st_line-typ   = 'S'.
  st_line-info  = tab_info1-mat_desc.
  APPEND st_line TO p_gt_list_end_of_page.
ENDFORM.              " FOOTER_BUILD

Similar Messages

  • How to display more than 255 chars in background job with ALV Grid ????

    Hi All,
    I am using ALV grid with OO.
    I have used call screen for ALV grid display. I have to display more than 255 characters in width. While running it, I can see the list perfectly.
    But in background mode, the list is truncated after 255 chars.
    Can anybody help how to send complete list(width more than 255 chars) to spool.
    Thanks and Regards,
    Neha

    Hi SAP fan,
    <b>YES you can run the ALV report in background mode.
    To run the report in background do F9 instead of F8, then give immediate and save.
    Now goto Sm35 goto job overview and view the job listed
    Choose the job and press the spool button. It will show the list created on the next page. When u clcik the list u can see the ALV output.
    To see this the job should be in the finished status.
    How to define Periodic Jobs
    1.Execute transaction SM36
    2.Define Job name, Job class, Target server
    3.Click on 'START CONDITION' button
    4.Click on 'Date/Time' button
    5.Enter Scheduled start DATE & TIME. Check mark 'Periodic Job' field. Click on 'Period values' button and select 'Hourly' or 'Dialy' or 'Weekly' or 'Monthly' or Other period and SAVE. Go back to main screen.
    6.Click on 'STEPS' button and enter Program name and Variant under box 'ABAP Program'. Click on 'Print Specification' button and enter Printer name under 'Output device' and SAVE
    7.Click on SAVE button until you get message on bottom of the screen that describes 'Job XYZ saved with status: Scheduled'.
    8.Click on 'Job overview' button or execute SM37 transaction.
    9.Select the appropriate 'Job name', 'User name', 'Job Status' & Schedule date under 'Job start condition' and click on 'Execute' button or press F8.
    10.You will now see all your scheduled JOBS.
    <b>Case: 2</b>
    You can 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.
    <b>Case: 3</b>
    if you are using OO ALV.
    Just before creating the custom container check for the following condition.
    Batch or Web Reporting
    IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    CREATE OBJECT o_custcontainer
    EXPORTING
    container_name = lc_custcontrol
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    create_error = 3
    lifetime_error = 4
    lifetime_dynpro_dynpro_link = 5
    OTHERS = 6
    ENDIF.
    You can see the output in Spool in transaction SP01.</b>
    Good Luck and thanks
    AK

  • About filter in alv grid display

    Hi,
       I am practicing on REUSE_ALV_GRID_DISPLAY in that i want to know about how to use some fields like
       *ITFILTER*_
       IT_ALV_GRAPHICS
       IT_HYPERLINK
       IT_ADD_FIELDCAT
       IT_EXCEPT_QINFO

    Hi Rock.
    I would like to suggest you a couple of references which quite relate to your case,
    REUSE_ALV_GRID_DISPLAY -  Output of a simple list (single-line)
    [SDN - Reference for Using REUSE_ALV_GRID_DISPLAY - Basic Program|alv prog;
    [SDN - Reference for Use of IT_FILTER in REUSE_ALV_GRID_DISPLAY |Doubts in ALV?;
    [SDN - Reference for use of IT_FILTER with CODE in REUSE_ALV_GRID_DISPLAY|ALV Report;
    [SDN - Refernce for Using IT_ALV_GRAPHICS in REUSE_ALV_GRID_DISPLAY|OOPs :  SAVE and ALV Display Variant;
    [SDN - Reference for Editing a graph in ALV (IT_ALV_GRAPHICS) using REUSE_ALV_GRID_DISPLAY|Edit Graph display ALV list display;
    [SDN - Reference for use of IT_HYPERLINK in REUSE_ALV_GRID_DISPLAY|editable fields on ALV grid;
    [SDN - Reference including example of IT_ADD_FIELDCAT in REUSE_ALV_GRID_DISPLAY|building top of page in ALV list;
    [SDN - Reference for scenario for use of IT_EXCEPT_QINFO in REUSE_ALV_GRID_DISPLAY|Background ID in ALV Grid;
    [SDN - Reference for application example of IT_EXCEPT_QINFO in REUSE_ALV_GRID_DISPLAY|PF Status in ALV list.;
    Hope That's Usefull.
    Good Luck & Regards.
    Harsh Dave

  • Data not getting displayed in ALV grid when run in background

    Hello experts!
    Could anyone help me out please?
    I need to display an ALV grid in the background. My requirements are as follows:
    I first display an ALV grid in the foreground based on some input parameters. The user selects a few records for updating it and clicks on the "update" button. On the click of this button another report must be called and here the ALV report is displayed in the background.I am using "reuse_alv_grid_display" to display the grid.
    I am using Import/Export to get the selected rows in my called report. When i execute this report in the foreground i get the ALV grid along with the data. But when i execute it in the background, i get only the grid with the fieldnames and not the data when i check in SP01.
    Thanks in advance!
    Smitha

    Hi Smitha,
    If you are able to see in SP01 and only see the output layout or "List contains no data" shows clealry that the data is not getting passed in the called program or the data is not being used correctly in the called program.
    Cheers
    VJ

  • Running report with alv grid in background and exporting to excel

    Hi Guys,
                  I've created a report program that uses the alv grid. When I run the report in foreground, I can easily export it to excel. However, if I run it in background, then display the spooled report and try to export to excel, it does not put it in excel format (seems to go over as one big column rather than individual columns that are defined in the report). Is there a way to run it in background ,export to excel properly and i have to email also in Excel sheet format.?
    Thanks,
    Gopi.

    In background u cannot do a download to excel. you can do is create CSV format file
    or
    write a report for output with tabs then call that report using
      submit yXXXX exporting list to memory
               and return.
      call function 'LIST_FROM_MEMORY'
        tables
          listobject = report_list
        exceptions
          not_found  = 1
          others     = 2.
    and send the report_list to email users

  • Submit...to Spool in background, ALV Grid

    Hello,
    I am trying to using the SUBMIT to SPOOL statement for SAP std. program RKPEP003.
    Now this works well when i execute in the foreground mode but doesnt work in the background mode, it gives an error "Make an Entry in All Required fields"
    RKPEP003 output is ALV Grid, so is this the probable reason or something else becoz the code works fine in the foreground mode
    Thanks in advance
    Minhaj

    Hello,
    Following is my code:
    MOVE:
          'CN_PSPNR'  TO I_SELTAB_WA_ANLAGE-SELNAME,
                    'S'      TO I_SELTAB_WA_ANLAGE-KIND,     " SELECT-OPTION
                    'I'      TO I_SELTAB_WA_ANLAGE-SIGN,
                    'EQ'     TO I_SELTAB_WA_ANLAGE-OPTION,
              'W-000001-01-101' TO I_SELTAB_WA_ANLAGE-LOW,
              'W-000001-01-101'  TO I_SELTAB_WA_ANLAGE-HIGH.
          APPEND I_SELTAB_WA_ANLAGE TO I_SELTAB_ANLAGE.
          MOVE: 'R_BUDAT'  TO I_SELTAB_WA_ANLAGE-SELNAME,
                'S'      TO I_SELTAB_WA_ANLAGE-KIND,      " SELECT-OPTION
                'I'      TO I_SELTAB_WA_ANLAGE-SIGN,
                'BT'     TO I_SELTAB_WA_ANLAGE-OPTION,
                S_DAT  TO I_SELTAB_WA_ANLAGE-LOW,
                E_DAT  TO I_SELTAB_WA_ANLAGE-HIGH.
          APPEND I_SELTAB_WA_ANLAGE TO I_SELTAB_A
    SUBMIT RKPEP003
          WITH selection-table I_SELTAB_ANLAGE
          WITH P_DISVAR = '/5SAP'
          TO SAP-SPOOL
          SPOOL PARAMETERS PARAMS
          ARCHIVE PARAMETERS ARPARAMS
          WITHOUT SPOOL DYNPRO AND RETURN.
    Now this works well in the foreground mode but other otherwise even with JOBNAME AND NUMBER
    Thanks,
    Minhaj

  • Background Execution Problem-Docking Container with 2 ALV Grids in one scre

    Hi Friends,
    I have created 2 ALV Grids in one screen - one below another using DOCKING CONTAINER.
    The objects are 'g_dock_cont' and 'g_dock_cont1'.
    I am getting the foreground output as expected with 2 ALV Grids.
    While executing in background (F9), I am getting only output of first ALV grid. Second ALV is not getting displayed in BACKGROUND(F9) mode.
    How to solve this.
    FORM create_objects.
    * Materials with data
      IF   g_dock_cont IS INITIAL.
       IF sy-batch NE 'X'.
    *CREATE THE OBJECT FOR DOCKING CONTAINER
        CREATE OBJECT g_dock_cont
          EXPORTING
            side                  = cl_gui_docking_container=>dock_at_top
            extension             = 300.
        ENDIF.
    *CREATE THE OBJECT FOR ALV GRID
        CREATE OBJECT g_alvgrid
               EXPORTING i_parent = g_dock_cont.
        wa_layout-grid_title =
              'Materials with Data'.
      ENDIF.
    IF NOT I_DETAIL[] IS INITIAL.
    CALL METHOD g_alvgrid->set_table_for_first_display
      EXPORTING
        IS_VARIANT                    = WA_VARIANT_STX
        IS_LAYOUT                     = wa_layout
      CHANGING
        it_outtab                     = I_DETAIL
        IT_FIELDCATALOG               = LIT_FIELDCATALOG[]
      EXCEPTIONS
        INVALID_PARAMETER_COMBINATION = 1
        PROGRAM_ERROR                 = 2
        TOO_MANY_LINES                = 3
        others                        = 4
    IF sy-subrc <> 0.
    ENDIF.
    ENDIF.
    *MATERIALS WITHOUT DATA
      IF   g_dock_cont1 IS INITIAL.
       IF sy-batch NE 'X'.
    *CREATE THE OBJECT FOR DOCKING CONTAINER
        CREATE OBJECT g_dock_cont1
          EXPORTING
            side                  = cl_gui_docking_container=>dock_at_bottom
            extension             = 300.
       ENDIF.
    *CREATE THE OBJECT FOR ALV GRID
        CREATE OBJECT g_alvgrid1
               EXPORTING i_parent = g_dock_cont1.
        wa_layout1-grid_title =
              'Materials without Data'.
      ENDIF.
    IF NOT I_MARA[] IS INITIAL.
    CALL METHOD g_alvgrid1->set_table_for_first_display
      EXPORTING
        IS_LAYOUT                     = wa_layout1
      CHANGING
        it_outtab                     = I_MARA
        IT_FIELDCATALOG               = i_fieldcat[]
      EXCEPTIONS
        INVALID_PARAMETER_COMBINATION = 1
        PROGRAM_ERROR                 = 2
        TOO_MANY_LINES                = 3
        others                        = 4
    IF sy-subrc <> 0.
    ENDIF.
    ENDIF.
    ENDFORM.                    " create_objects
    Regards,
    Viji.

    Hi,
    What i was saying is that you need to code again for background mode of execution.
    AT END OF SELECTION.
    IF SY-BATCH EQ 'X'.
      PERFORM DISPLAY1.
      PERFORM DISPLAY2.
    In DISPLAY1 use REUSE_ALV_LIST_DISPLAY to display data from outtab1.
    In DISPLAY2 use REUSE_ALV_LIST_DISPLAY to display data from outtab2.
    For example : execute this report in background mode.this will not execute in online mode.
    After execution you will get two spools one for KNA1 and one for LFA1 data. Spool can be controlled via IS_PRINT structure.
    report  zrbackground.
    data gt_lfa1 type standard table of lfa1.
    data gt_kna1 type standard table of kna1.
    start-of-selection.
      select * from lfa1 into table gt_lfa1 up to 10 rows.
      select * from kna1 into table gt_kna1 up to 20 rows.
    end-of-selection.
      if sy-batch eq 'X'.
        perform display_lfa1.
        perform display_kna1.
      endif.
    *&      Form  DISPLAY_LFA1
          text
    -->  p1        text
    <--  p2        text
    form display_lfa1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'LFA1'
        tables
          t_outtab           = gt_lfa1
        exceptions
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " DISPLAY_LFA1
    *&      Form  DISPLAY_KNA1
          text
    -->  p1        text
    <--  p2        text
    form display_kna1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'KNA1'
        tables
          t_outtab           = gt_kna1
        exceptions
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " DISPLAY_KNA1
    Please let me know if its not clear or you need more info.
    Thanks,
    Abhishek
    Edited by: abhishek sinha on May 8, 2009 7:42 PM
    Edited by: abhishek sinha on May 8, 2009 8:45 PM

  • Background task problem with alv grid display

    Hello !
    I have a problem when executing my program in background.
    In foreground I have no problem, my ALV appears. In the background I have a dump.
    The current ABAP program "SAPLKKBL" had to be terminated because one of the statements could not be executed.
    I use the function module 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
            i_callback_program      = gd_repid
            i_callback_user_command = 'F533_USER_COMMAND'
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            it_special_groups       = i_fgroup[]
            i_save                  = 'X'
            it_sort                 = gd_sort
            i_buffer_active         = ' '
            i_callback_pf_status_set = 'F534_SET_PF_STATUS'
         TABLES
            t_outtab                = mytab
         EXCEPTIONS
            program_error           = 1
            OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    I don't understand where the problem is. Please help me.
    Thank you.

    I love replying to old threads:
    Try this link
    http://scn.sap.com/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job

  • ALV GRID FORMAT IN BACKGROUND

    Dear All,
             There is t code called MB51 which the user use, we recommend them to execute that report in the background using this method -- t code-- execute in background--- enter the printer name and generate the temporary spool to veiw the report, however when we veiw that report using spo2, the <b>tool bar</b> (that comes when we execute  in the foreround) is missing, which is used to veiw it in the ALV grid format, actually the user easily select the feilds in that format and download them to excel sheets, in the background that <b>" Details"</b> <b>option</b> is not there, is there any work around for this.
    Thanks,..
    Ravi.

    Hi Clemens,
    Thanks for that valuable suggestion, atleast I got a direction to think about, so from here on its gotta be xml...
    But, since I have no idea about xml coding, also I went through those 2 links you had sent, but I'm still unable to understand the following points:
    1.How do I generate the xml code, relevant to formatting that I did in ALV Grid using the FM "REUSE_ALV_GRID_DISPLAY"?
    2. How do I go about saving the xml file onto the Application server?
    3. Can you please provide any sample ALV report code, where such XML formatting has been used?
    Thanks in advance.
    Regards,
    Azeem Ahmed Matte

  • ALV Grid output in background Job

    Hello everyone,
    Can someonen plz tell me if I execute my report (with Grid ALV Display) in background (sy-batch not initial ) , will the ALV Grid be displayed ?
    If no, then in order to show success do I have to 'WRITE' the success message ?
    Thanks

    Hello,
    The grid will be generated as a list & spool will be generated. REUSEALVGRID* FM handles this explicitly no need to code for it.
    You do not need to use WRITE for this
    Also FYI for OO ALV you have to code for the batch handling: [CNTL_ERROR while running a report in background mode|CNTL_ERROR while running a report in background mode]
    BR,
    SUhas
    Edited by: Suhas Saha on Jan 18, 2010 4:52 PM

  • Save ALV grid to local excel-file in background

    Hi,
    i want to save a alv grid to an excel-file on a local fileshare using an background job..
    Does anybody know how this works?
    Thanks ahead

    DATA: file TYPE string VALUE `flights.dat`,
          wa   TYPE spfli.
    FIELD-SYMBOLS TYPE x.
    OPEN DATASET file FOR OUTPUT IN BINARY MODE.
    SELECT *
           FROM spfli
           INTO wa.
      ASSIGN wa TO CASTING.
      TRANSFER TO file.
    ENDSELECT.
    CLOSE DATASET file.
    <b>The binary data from database table SPFLI is transferred to a binary file flights.dat</b>

  • ALV Grid display  IN BACKGROUND

    Hi,
        When I run the ALV grid display in foreground(32 fields) its running well. But when I run it in background many fields get truncated. I know we can only use 255 characters in background. Is there any way out?....let me put it in this way.....i have 32 fields in the foreground but I just want to display 20 of them in background.
    Please suggest.?

    hi
    good
    check with your length of the screen in the background ,though you have mentioned your some of the field length may be varying in the foreground and background.
    Check with the field length in the background and foreground.
    thanks
    mrutyun^

  • 2 ALV grids display in background

    Hello,
    I am using 2 ALV grids in my report output. But while running this is background it shows only one in the spool.
    Can somebody please suggest the possible solutions ?
    Following is the code I am using:-
    Create grid to display deleted entries
        CREATE OBJECT go_alv_grid
          EXPORTING
            i_parent          = go_container
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
    Create grid to display completed entries
        CREATE OBJECT go_alv_grid2
          EXPORTING
            i_parent          = go_container2
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
    Prepare fieldcatalog
        PERFORM perpare_fieldcat.
    Set layout
        lv_layout-cwidth_opt = 'X'.
    Call display for deleted entries
        CALL METHOD go_alv_grid->set_table_for_first_display
          EXPORTING
            is_layout                     = lv_layout
          CHANGING
            it_outtab                     = gt_wflog
            it_fieldcatalog               = gt_fldcat
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
    Call display for completed entries
        CALL METHOD go_alv_grid2->set_table_for_first_display
          EXPORTING
            is_layout                     = lv_layout
          CHANGING
            it_outtab                     = gt_wflog_rec
            it_fieldcatalog               = gt_fldcat
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
    Please suggest.

    yes it displays only one grid in the spool. the other will miss. For background run you have to proceed differently in this case.

  • Alv grid background column headings

    HI EVERYONE,
    I was able to execute the ALV grid report in background .But columns heading is reeating for
    each page.
    Can't we just just have the Column Headings once for all pages.?

    For the IS_LAYOUT parameter it is possible to set NO_COLHEAD = 'X'. Then the header is gone. Then you have to create first line in table with texts. But then all fields must be character fields.
    Regards
    Roy

  • Way to get alv grid varients info during background execution

    I have used the function module 'REUSE_ALV_GRID_LAYOUT_INFO_GET' to get info alv grid varients i.e already created layout info. Is there any other way of getting this info as this is not giving the exact layout during background execution.

    Hi Vijaya,
    It should work. I am giving you a sample code. Try this and let me know.
    REPORT TEST.
    data gt_lfa1 type standard table of lfa1.
    data gt_kna1 type standard table of kna1.
    start-of-selection.
      select * from lfa1 into table gt_lfa1 up to 10 rows.
      select * from kna1 into table gt_kna1 up to 20 rows.
    end-of-selection.
      if sy-batch eq 'X'.
        perform display_lfa1.
        perform display_kna1.
      endif.
    form display_lfa1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'LFA1'
        tables
          t_outtab           = gt_lfa1
        exceptions
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " DISPLAY_LFA1
    form display_kna1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'KNA1'
        tables
          t_outtab           = gt_kna1
        exceptions
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " DISPLAY_KNA1
    copy and paste the code and create a program. Activate it and come back to SE38 screen.
    Now, in program name give the name of the report created and then
    select PROGRAM->EXECUTE->BACKGROUND from the MENU bar.
    This will generate two separate spools . One for KNA1 data & one for LFA1 data.
    Let me know how it goes.
    Thanks,
    Abhishek

Maybe you are looking for

  • Executing a shell script from java using runtime.exec()

    Hi I am trying to create a script (test_script) and execute it -- all within one java program... the code compiles and executes perfectly but nothing happens. This is probably because the script does not get changed to the '777' mode although i am tr

  • What should I purchase for video out?

    Do I only need to purchase the Mini DisplayPort to VGA Adapter in order to get video out on my iMac G5? Will this same cable work to get video out to a VGA monitor from a Mac Mini Sever as well?

  • Embedded PDF Form Not Appearing in Explorer 8

    I have a Joomla site where I have embedded an interactive PDF form that was created on FormsCentral. The embedded form appears using Window 7 and 8 with Internet Explorere 10 and 11 ... but will show on machines running Windox XP with Internet Explor

  • Is Prompted (Case When Statement)

    I created a column in an answers report and used a CASE WHEN statement as the formula. I set this column to an Is Prompted filter. But when i try to run the report from the dashboard prompt, it just ignores this filter. What am i doing wrong?

  • Delivery notification on text

    when i send a text message on my iphone 5 i get an automated "delivered" status under the message, on my mates phone it shows "delivered" and once the message has been read she gets a "read" status under her message. how do i set my phone to do this