How to print an alv grid

Hello All,
I want to print data on an alv grid to spool according the current layout using code.
Can anyone give me suggestion, maybe some sample code?
Thanks in advance,
Alex

Hi,
I have 2 ALV grid in the screen and pront to spool of both ALV's using OOp.
Please find sample code. Whenever report runs in the background i simply call this print subroutine after creating fieldcatalog, layout, sorting table etc.
FORM list_append TABLES ut_table
                 USING  u_no      TYPE char1
                        u_tabname TYPE slis_tabname.
  IF u_no CA '13'.
    MOVE        'TOP_OF_PAGE'        TO ls_event-name.
    CONCATENATE 'TOP_OF_PAGE' u_no INTO ls_event-form.
    APPEND ls_event TO lt_events.
  ELSE.
    MOVE        'TOP_OF_LIST'        TO ls_event-name.
    CONCATENATE 'TOP_OF_LIST' u_no INTO ls_event-form.
    APPEND ls_event TO lt_events.
  ENDIF.
  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
       EXPORTING
            it_fieldcat                = lt_fieldcat
            is_layout                  = ls_layout
            i_tabname                  = u_tabname
            it_events                  = lt_events
            it_sort                    = lt_sort
*           i_text                     =
       TABLES
            t_outtab                   = ut_table
       EXCEPTIONS
            program_error              = 1
            maximum_of_appends_reached = 2
            OTHERS                     = 3.
  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.                               " LIST_APPEND
*       Form  f_list_display
FORM f_list_display.
  DATA ls_print TYPE slis_print_alv.
  ls_print-no_print_selinfos  = 'X'.   " Display no selection infos
  ls_print-no_print_listinfos = 'X'.   " Display no listinfos
  ls_print-reserve_lines      = 2.     " Lines reserved for end of page
  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
       EXPORTING
            i_interface_check = ' '
            is_print          = ls_print
       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.                               " F_LIST_DISPLAY
May this will help you.
aRs
Message was edited by:
        aRs

Similar Messages

  • How to print multiple ALV Grids with only one print dialog?

    Hi,
    I have a report that has multiple ALV grids in splitter containers. The users want to be able to print those ALVs by pushing only one print button. I got it to work (parameter IS_PRINT and method SET_FRONTEND_PRINT before calling SET_TABLE_FOR_FIRST_DISPLAY) but I can't find a way to avoid that the printer dialog pops up for every grid I print.
    I tried to use the function module approach with REUSE_ALV_LIST_DISPLAY but have the same issue. Any thoughts?
    Thanks,
    Guenther

    Hi Peluka,
    Well, that's exactly what I am doing. Putting one central button in the app is not the problem; the issue is that the print dialog (to select the printer) pops up for every  individual ALV grid. E.g. if I place 4 ALV grids on my screen and trigger their print from a central button, I am getting 4 print dialogs.
    Cheers,
    Guenther

  • How to send the ALV GRID output to spool by using the print button in std t

    How to send the ALV GRID output to spool by using the print button in standard tool bar.
    We have created a button in the va02 transaction.  If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept.  But i am unable to send the output to spool using the print button in the standard tool bar.
    I am able to display the Print parameter dialog box but i am not able to send it to spool.
    Kindly help.
    Thanks In Advance.
    G.V.Ramana

    Hi Shaik,
    There is not properties button in my print screen.
    MODULE user_command_0900 INPUT.
        WHEN 'EXCEL'.
          PERFORM excel_download.                              
        WHEN 'PRI'.
          PERFORM print_output.
    form Print_output.
    CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
               EXPORTING
                    columns        = 80
                    device         = 'ANY '
                    lines          = 65
                    maxpenality    = 1999
               TABLES
                    layouts        = lt_layouts1
               EXCEPTIONS
                    unknown_device = 1
                    OTHERS         = 2.
          IF sy-subrc = 0.
            LOOP AT lt_layouts1.
              IF lt_layouts1-penality < 1000        AND
                 lt_layouts1-penality < l_min_penality.
                l_layout       = lt_layouts1-layout.
                l_min_penality = lt_layouts1-penality.
              ENDIF.
            ENDLOOP.
            IF NOT l_layout IS INITIAL.
              CALL FUNCTION 'GET_PRINT_PARAMETERS'
                   EXPORTING
                        mode                   = 'CURRENT'
                        line_size              = 80             "#EC *
                new_list_id            = l_new_list_id
                        no_dialog              = l_no_dialog
                        layout                 = l_layout
                   IMPORTING
                        out_archive_parameters = rs_arc_params
                        out_parameters         = rs_pri_params
                        valid                  = l_valid
                   EXCEPTIONS
                        archive_info_not_found = 1
                        invalid_print_params   = 2
                        invalid_archive_params = 3
                        OTHERS                 = 4.
              IF sy-subrc NE 0.                                 " INS SLIN
              ENDIF.                                            " INS SLIN
              IF rs_pri_params-linsz LT 80 OR
                 rs_pri_params-linsz LT gt_stack-s_lprint-width.
                gt_stack-print_line_break = 'X'.
              ELSE.
                CLEAR gt_stack-print_line_break.
              ENDIF.
              IF l_valid NE 'X'.
                rs_pri_params = ls_pri_params_sav.
                rs_arc_params = ls_arc_params_sav.
              ENDIF.
            ENDIF.
          ENDIF.
    endform.                    " Print_output
        CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
                EXPORTING
                   is_layout         = gs_layout_cost_tot_grand
                CHANGING
                   it_fieldcatalog   = gt_fcat_cost_tot_grand[]
                   it_outtab         = gt_cost_tot_grand[].
    Please check my code

  • Re: Increasing Column Header Length While Printing in ALV Grid

    Hi
    For some column headers in a report, the translations in Turkey are more than 40 characters, because of which while executing the report in TR language, the column header is getting truncated.
    So, I would like to know if we can increase the column header length while printing the ALV Grid(OO ALV) output.
    Or else, Is there any way where we can divide the column header into 2 rows.
    Please let me know.
    Thanks and Regards,
    Vishwa.

    Jose and Sivaram,
    Thanks for replying.
    The problem we have is with the column headers, there is a limit of 40 characters for the column header in ALV reports. So, increasing the outputlen also did not help.
    Regards,
    Vishwa.

  • I'm trying to make a time sheet and include a grid, but I'm having a hard time figuring out how to print a full grid on my spreadsheet.  There are options for shaded grids but I want a defined grid, and I have spent the last 2 hours looking for the answer

    I'm trying to make a time sheet and include a grid, but I'm having a hard time figuring out how to print a full grid on my spreadsheet.  There are options for shaded grids but I want a defined grid, and I have spent the last 2 hours looking for the answer.  Any ideas?

    Hi Cynthia,
    Are you planning to have this table do any of the calculation, or is is to be used as the electronic equivalent of a sheet of paper with a grid printed on it—a place to record the data.
    For your seven column table:
    Are you using one or more rows at the top of the table to label the data below? If so, you might want this row (or these rows) to be set as Header Rows.
    Are you using the leftmost column to label the rows? If so, you may want this column to be a Header column.
    The default table supplied on the "Blank" templates contains one header row and one header column. If you need more (or fewer) Header rows or columns, select the table, then go Table (menu) > Header Rows > (choose the number you need). Repeat to set the number of Header Columns.
    To make a seven column table from the table supplied by default, click on any cell in column H (The eighth column), and drag right to add more cells to the selection, until you get to the last column of the table. With these cells selected, Go Table > Delete Columns.
    To make the remaining seven columns fit across a single page:
    Go View > Show Print View to show the table as it would appear when printed to paper.
    Select the table by clicking its icon in the Sheets List to the left (easy method), OR by carefully clicking on the outside boundary of the table itself (fiddley method).
    With the table selected, you will see square white handles at each corner and at the middle of each side (including the top and bottom).
    With the mouse, grab the handle in the middle of the right side of the table and drag right (or left) until the table just fits onto the width of the defined page.
    With the table still selected, set the thickness and colour of the cell boundaries using the Gaphics Inspector (as described by Jerry), or using the Stroke, Thickness and Color Well controls in the Format bar above the working portion of the Window.
    Regards,
    Barry

  • Printing from ALV Grid

    Hi Friends,
    I am facing a problem while printing a report from ALV grid .. The report display is coming perfectly based on the SORT criteria .. but while trying  to print or print preview or Download to  Excel  the sorting is not working .. If any one know how to print the report as it look like the  screen display ..Please let me know..
    Thanks in advance..
    Regards.
    Elango

    Hi Vinni,
    Thanks for your repaly , I am using 4.7.
    Function module used to display grid is  REUSE_ALV_GRID_DISPLAY and for  
    build the field catlog  I am using REUSE_ALV_FIELDCATALOG_MERGE 
    function module .
    Regards,
    Elango

  • How to  learn about ALV Grid?

    Hi Experts,
    I dont about ALV grid and how to implement it.So can anyone let me know how to implement the simple basic ALV grid with example?
    Please explain me with set by step procedure.
    Thanks a lot in Advance,
    Regards,
    Raghu

    hi,
    Process to create ALV with OOPs:
    Step 1:
    Create a container. There are 2 type of containers: docking and custom.
    Go to SE38.Create a program. Use Pattern button to create object for docking container. Click ABAP Object Pattern radio button. Click Create object radio button. Give Instance as o_docking and class as cl_gui_docking_contianer.
    Step 2:
    Create a grid inside the container.
    Use Pattern button to create the same. Make the parent of grid as container.
    Click ABAP Object Pattern radio button. Click Create object radio button. Give Instance as o_grid and class as cl_gui_alv_grid. Create object o_grid.
    Step 3:
    Call the function lvc_fieldcatalog_merge to get the field catalog.
    Pass the structure name.
    Step 4:
    Call the method of grid set_table_for_first_display to display the output.
    Click ABAP Object Pattern radio button. Click Call Method radio button. Give Instance as o_grid and Class/Interface as cl_gui_alv_grid and Method as set_table_for_first_display.
    w_variant-report = sy-repid.
    Call method o_grid->set_table_for_first_display
    Step 5:
    Fill the internal table itab with values by using logic.
    select * from mara into table itab up to 100 rows.
    call screen 9000.
    Create a screen by double clicking 9000 in the above line. Fill the description for the screen. In the flow logic, uncomment the PBO and PAI module and create those in main program (for simplicity).
    Step 6:
    Create GUI status. Create GUI Title if required. That can be done by using display object List (CtrlShiftF5).Then in left side, right click the program and create GUI Status and Title.
    Step 7:
    Free the memory occupied once the BACK, EXIT or CANCEL button is clicked. Use Pattern button to call the method FREE of cl_gui_alv_grid and cl_gui_docking_container.
    Click ABAP Object Pattern radio button. Click Call Method radio button. Give Instance as o_grid and Class/Interface as cl_gui_alv_grid and Method as Free.
    Similarly Click Call Method radio button. Give Instance as o_docking and Class/Interface as cl_gui_docking_container and Method as Free.
    Also follow these links.
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    Hope this helps, Do reward.

  • How to get the alv grid report in another screen when double click on basic

    Hi.
    I have created an alv report using class cl_gui_alv_grid.I got another report in the same screen,when double clicked on basic list(using double_click event).I want to get this report in another screen.What i have to do?(In classical reports i worked with sy-lsind = 1 ,but how to do here?)
    How to set color to the selected rows in the alv grid report?I worked with change_data_from_inside method of cl_gui_alv_grid.But it didn't work out..
    With Regards,
    Ramana.

    On double click event . you will have to call another screen say 9000.
    now within screen 900 PBO.. you will have to prepare the fieldcatalog/layout.. and the table to be displayed there.
    in PAI of screen 9000, you can return to the original ALV.
    method double_click.
    call screen 9000.
    endmethod.
    " now in PBO create a module display_alv2
    module display_alv2.
    'prepare the fieldcat/layout info for new alv
    'add the data to the new ALV table
    'instantiate the grid call.. etc
    'call the ALV
    endmodule
    "in PAI
    module exit.
    case sy-ucomm.
    when 'ENT1'.
      leave to screen 0.
    endcase.
    endmodule
    while preparing the field catalog you can mention the EMPHASIZE field, whish will give color to tht column
    E.g
    *--Service Order
        ls_fieldcat-tabname   = 'IT_FINAL_VALID'.
        ls_fieldcat-fieldname = 'AUFNR'.
        ls_fieldcat-scrtext_m = 'Service Order'.
        ls_fieldcat-ref_table = 'AUFK'.
        ls_fieldcat-ref_field = 'AUFNR'.
        ls_fieldcat-col_pos   = 1.
        ls_fieldcat-outputlen = 12.
        ls_fieldcat-emphasize = 'C400'.  "This will add color to the cell
        APPEND ls_fieldcat TO fcat_valid.
    Hope this helps.

  • How to print several ALV one one page

    Hi.
    This is my first post here. I have a problem, because I want to print one one page for example 2 alv grid or other component based on containers (like charts). This is big problem for me.
    If anybody has any idea, please help me.
    Thanks for help -
    Daniel

    Hi Daniel,
    Welcom to SDN.
    You need to use ALV Block for displaying multiple grids in one page.
    REUSE_ALV*BLOCK*APPEND
    http://www.geocities.com/mpioud/Z_ALV_LIST_BLOCK.html
    Or use OO ALV Grid Controls and display two grids in one screen. A example of the same is shown below
    http://www.geocities.com/mpioud/Z_DEMO_2_ALV_LIST.html
    http://www.geocities.com/mpioud/Z_ALV_GRID_AND_POPUP.html
    Refer the sample code:
    CLEAR w_event.
    w_event-name = slis_ev_top_of_page.
    w_event-form = 'TOP_OF_PAGE'.
    APPEND w_event TO i_events1.
    CLEAR w_event.
    w_event-name = slis_ev_top_of_page.
    w_event-form = 'XTOP_OF_PAGE'.
    APPEND w_event TO i_events2.
    DATA: lv_repid LIKE sy-repid.
    lv_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
    EXPORTING
    i_callback_program = lv_repid
    i_callback_user_command = 'USER_COMMAND'
    i_callback_pf_status_set = 'PF_STATUS'.
    *-- Vendor Schedule List
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
    it_fieldcat = i_field_cat1
    is_layout = w_lay_out1
    i_tabname = '<I_TABLE>'
    it_events = i_events1
    TABLES
    t_outtab = <i_table>.
    *-- Error Lsit display
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
    it_fieldcat = i_field_cat2
    is_layout = w_lay_out2
    i_tabname = 'I_ERROR'
    it_events = i_events2
    TABLES
    t_outtab = i_error[].
    w_print-reserve_lines = 2.
    w_print-no_print_listinfos = c_x.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    EXPORTING
    is_print = w_print.
    ENDFORM. " f0504_create_list
    *-- Top of Page
    FORM top_of_page.
      WRITE: sy-title.
    ENDFORM.
          FORM xtop_of_page                                             *
    FORM xtop_of_page.
      WRITE: 'Error Records'.
    ENDFORM.
    <b>Reward points if this Helps.
    Manish</b>

  • How to read a alv grid row data from standard program

    Hi All,
    I am working on transaction LBK1. Actually when you will open this transaction in the left hand side it will show you the data in tree. When you click on a notification node it will show the relevant data in right side. In which there is a operation tab . In this tab the data comes in alv grid. If user selects a row then I have to get that selected row value. There is also a toolbar above on the tree side. There are some buttons which execute our implementation class where I can put the code.  
    Can anyone please help me out? How I can read that selected row in our class/method?
    Thanks in advance.
    Best Regards
    Ritu

    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similiar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows fronm the table. In the examples below the grid table is named gi_sflight.
    Data declaratrion:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines = 0.
        CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
             EXPORTING
                  textline1 = 'You must choose a valid line'.
        EXIT.
      ENDIF.
      LOOP AT gi_index_rows INTO g_selected_row.
         READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
        ENDIF.
      ENDLOOP.
    Example 2: Set selected row(s).
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines > 0.
        CALL METHOD go_grid->set_selected_rows
            exporting
              it_index_rows = gi_index_rows.
      ENDIF.

  • How to use two ALV grids in a single program (pl read below for details)?

    Please read thoroughly::
    I have an ALV report using REUSE_ALV_GRID_DISPLAY.
    On the output of this report, when I click on a "change" button, a couple of columns should be made editable.
    I achieved this by modifying the fieldcatalog and triggering the output with another REUSE_ALV_GRID_DISPLAY.
    When I click on the back button of this second report, it is still taking me to the first one.
    How to over come this?
    Note:
    I used custom containers etc but the default buttons on the container are not controllable. I added custom buttons but could not suppress the default ones. So I did not pursue this much even though this is more comfortable to use.
    I am not able to get into the code in debug to see how the default buttons like COPY, INSERT ROW etc are working.
    Can any body throw some inputs into this?
    Thanks,
    Ven.

    >I achieved this by modifying the fieldcatalog and triggering the >output with another REUSE_ALV_GRID_DISPLAY.
    >When I click on the back button of this second report, it is still >taking me to the first one.
    >How to over come this?
    For this there is a solution
    i am thinking you are using user_command and calling the second time ALV Grid if so check this.
    form user_command using r_ucomm type sy-ucomm selfield type slis_selfield.
    case r_ucomm.
    when 'CHANGE'.
    selfield-exit = 'X'.   "use this , this will solve the problem
    "i hope you are calling the Function here
    endform.

  • Printing with ALV Grid

    Hi,
    I am using ALV List and ALV grid in one of my custom reports.
    There is no issue with ALV List when I print the report after running the program.
    But when I use ALV Grid , the report runs good and when I try to print the report I get short dump "OBJECTS_NOT_CHARLIKE" in program "LKKBLF99" of the main program "SAPLKKBL".
    I am using the function module "REUSE_ALV_GRID_DISPLAY" to run the report using ALV Grid and I get the above short dump when I try to print the report.
    Can anyone help me please?
    Thanks,
    Ashok.

    Hai Ashok
    Try with the following Code
    *& Report  ZALV_GRID                                           *
    REPORT  ZALV_GRID .
    TABLES: MARA.
    TYPE-POOLS : SLIS.
    Data declaration
    DATA: BEGIN OF I_MARA OCCURS 0.
            INCLUDE STRUCTURE MARA.
    DATA: END OF I_MARA.
    DATA: V_REPID LIKE SY-REPID.
    selection-screen
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
      SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.
      PARAMETERS: P_MTART LIKE MARA-MTART DEFAULT 'ROH'.
    SELECTION-SCREEN END OF BLOCK B1.
    initialisation
    INITIALIZATION.
    S_MATNR-LOW = '1400'.
    S_MATNR-HIGH = '1500'.
    APPEND S_MATNR.
    V_REPID = SY-REPID.
    start-of-selection
    START-OF-SELECTION.
    SELECT * FROM MARA
        INTO TABLE I_MARA
        WHERE MATNR IN S_MATNR AND
              MTART = P_MTART.
      CHECK SY-SUBRC = 0.
    end of selection
    END-OF-SELECTION.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
      I_CALLBACK_PROGRAM             = ' '
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
       I_STRUCTURE_NAME               = 'MARA'
      IS_LAYOUT                      =
      IT_FIELDCAT                    =
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB                       = I_MARA
    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.
    Thanks & Regards
    Sreenivasulu P

  • How do I save ALV Grid O/P to spool

    Hi All,
               I have a requirement of saving alv grid output to spool. How can this be done?
    could I get any help on this?
    Thanks & Regards,
    Deepak Raj

    DATA: BEGIN OF i_mara OCCURS 0,
      matnr LIKE mara-matnr.
      DATA: END OF i_mara.
      DATA: v_dest LIKE tsp01-rqdest,
      v_handle LIKE sy-tabix,
      v_spool_id LIKE tsp01-rqident,
      v_rc TYPE c,
      v_errmessage(100) TYPE c,
      v_text(70) TYPE c.
    START-OF-SELECTION.
      SELECT matnr FROM mara INTO TABLE i_mara.
      CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'
           EXPORTING
                dest            = 'LOCL'
               layout          =
               name            =
               suffix1         =
               suffix2         =
               copies          =
               prio            =
               immediate_print =
               auto_delete     =
               titleline       =
               receiver        =
               division        =
               authority       =
               posname         =
               acttime         =
                lifetime        = '8'
               append          =
               coverpage       =
               codepage        =
               doctype         =
           importing
                handle          = v_handle
                spoolid         = gd_spool_nr
                rc              = v_rc
                errmessage      = v_errmessage.
      LOOP AT i_mara.
        v_text = i_mara-matnr.
        CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'
             EXPORTING
                  handle           = v_handle
                  text             = v_text
                  length           =
                  codepage         =
                  truncate         =
             importing
                  rc               = v_rc
                  errmessage       = v_errmessage
             EXCEPTIONS
                  handle_not_valid = 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.
      ENDLOOP.
      CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'
           EXPORTING
                handle           = v_handle
           IMPORTING
                rc               = v_rc
                errmessage       = v_errmessage
           EXCEPTIONS
                handle_not_valid = 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.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    get the spool number
    Declaration of local variables.
      DATA:
      lv_rq2name LIKE tsp01-rq2name.
      CONCATENATE sy-repid+0(8)
      sy-uname+0(3)
      INTO lv_rq2name SEPARATED BY '_'.
    Get the spool number.
      SELECT * FROM tsp01 WHERE rq2name = lv_rq2name
      ORDER BY rqcretime DESCENDING.
        v_rqident = tsp01-rqident.
        EXIT.
      ENDSELECT.
      IF sy-subrc NE 0.
        CLEAR v_rqident.
      ENDIF

  • How to kill an alv-grid object and refresh the frontend

    Hello experts,
    i have created an alv-grid display!
    now i want to hide the whole alv-table on the screen when user e.g. hits a button!
    How can i kill this object and refresh the frontend?
    Thanks a lot,
    Marcel

    Hello Marcel
    For this requirement I would use the following approach:
    (1) main screen '0100': here you display your ALV grid
    (2) Define a dummy screen '0101' the user will never see
    (3) Link the container for the ALV grid (e.g. go_docking) to the dummy screen when the user pushes the HIDE button (method LINK)
    (4) Link the container back to your main screen when the user pushes the DISPLAY button
    I never ever destroy a grid control and re-build it from scratch but always use either of its methods REFRESH_TABLE_DISPLAY or SET_TABLE_FOR_FIRST_DISPLAY.
    Regards
       Uwe

  • How to create editable ALV grid/list

    Hi,
    I want to create editable ALV grid/list so that user can modify the data in the ALV.
    And when user presses save button data will get saved in Z table.
    I dont know how to create editable ALV so could anybody please help me regarding this?
    Thanks & regards,
    Sameer Dhuke

    HI
    check the demo programs BCALV_FULLSCREEN_GRID_EDIT
    BCALV_GRID_EDIT
    BCALV_TEST_GRID_EDIT_01
    BCALV_TEST_GRID_EDITABLE
    REUSE_ALV_GRID EDITABLE
    ALV Grid editable fields
    Just to make things a bit easy
    In the layout,there is a property called edit, make it 'X' for the particular field whichever you want to make editable.
    Hope this helps,
    Suruchi
    Message was edited by:
            Suruchi Mahajan

Maybe you are looking for

  • Error running new report in Siebel

    Hi All, I get this error when trying to run a new report in Siebel (on local web client): We detected an Error which may have occurred for one or more of the following reasons: BI Publisher engine failed to generate report.(SBL-RPT-50524) I have regi

  • Apple TV suddenly not working

    My Apple TV is suddenly not working. I have tried the trouble shooting suggestions of restarting, upgrading the system, checking everything etc,  but to no avail. When I do a system test, all is ok, but I just cannot download /view my purchase - I ge

  • Adding custom dim in planning but not showing up in essbase

    I'm on 11.1.2. When I add a member to a standard planning dimension it ends up in essbase just fine but when I add a new custom dimension no luck, dimension is missing. I thought it might have something to do with the fact that we were running on a e

  • CD icon will not show in the iTunes source list

    My brother just got the 5G iPod and whenever he puts a cd into the drive, iTunes will not show that there is a cd in the drive. What's wrong?

  • Get gnome&gdm running, in a minimal manner?

    hi every one, i'm loving arch but i'm disapointed in myself after wresteling! with my laptop all night+next morning and facing strange problems, which the last one was about failing allocating g object or something like that, and realizing that each