GET/SET ALV GRID scrollbar

Hi you,
after a refresh we want to restore all settings done in the ALV grid.
The grid control provides methods for getting and setting the FRONTEND_FIELDCATALOG, FILTER_CRITERIA, FRONTEND_LAYOUT, FRONTEND_PRINT and SELECTED_CELLS settings.
Imagine the user scrolled down the list without selecting any cell. Is it possible to determine (and possibly restore) this?
TIA,
Regards,
Clemens

Hi,
Try this...
when calling the REFRESH_TABLE_DISPLAY method..pass
IS_STABLE-row = 'X' and
IS_STABLE-col = 'X'.
Thanks
Naren

Similar Messages

  • Hi iam getting the alv grid data in excel format but iam facing one problem

    hi iam getting the alv grid data in excel format but iam facing one problem ,
    i.e., i want it read only  but iam getting it in edit mode i use layout default in excel iam getting in xl directly but in edit mode but i need it in read only mode
    what i have to do for that  and bdy knows reply me i need it urgently.

    there's always edit-mode if you choose excel-inplace - but noone can modify/rewrite the data
    A.

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

  • Setting ALV grid Graphic properties from program

    Hi all,
    Could any one tell me how to set the properties of the histogram generated by ALV output from program.
    I want to display the value on top of the bar, by setting this property from program.
    Manually i can do this by selecting the graph icon from the alv toolbar, and in the graph, right-click the bar, and from the context menu, select 'format data series', then choose 'Data labels' tab and then select 'Show value'.
    Thanks in advance.
    regards,
    Anup

    Hi Anup
    Yes, ALV Grid uses GFW for the graphics. However, it encapsulates the graphic object and let's your intervention to some extent. To do so, you can use the parameter at the interface of the method "<b>set_table_for_first_display</b>". Here is the information about the parameter:
    <u><b>IT_ALV_GRAPHICS</b></u>
    <i> Settings for displaying the ALV list as a diagram (for example, axis labels). The row type of the table has two fields (variables/value pairs):
    PROP_ID : Assign a constant attribute of the class CL_ALV_GRAPHICS_CU with prefix CO_PROPID_ to this field to determine the changes to be made to the graphic. Use the CL_ALV_GRAPHICS_CU=>CO_PROPID_TITLE attribute, for example, to refer to the title of the diagram.
    PROP_VAL : The value of the relevant topic, for example, 'My Title'.</i>
    You can also find <b>GFW</b> programs as "<b>GFW_DEMO_*</b>". If you want, you can prepare your own graphics and override the standard graphics function of the ALV Grid or add your own graphics functionality. For these you can refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference for ALV Grid Control"</a>.
    Kind regards...
    *--Serdar

  • 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

  • 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

  • Re-Displaying ALV Grid

    This is a follow-up to a question I posed earlier regarding my inability to get the ALV grid to display with a new table name.
    Can anyone tell me what I need to do to get it to re-display with the new table name?
    To use it, you enter a table name in the editor screen.  Screens 100 and 200 are just custom containers with no other attributes.
    Thanks (and points) for any help!
    PROGRAM zz_temp.
    TYPES: BEGIN OF type_text_lines,
      line(2048) TYPE c,
    END OF type_text_lines.
    DATA: g_editor             TYPE REF TO cl_gui_textedit,
          g_r_editor_container TYPE REF TO cl_gui_custom_container,
          g_r_alv_grid         TYPE REF TO cl_gui_alv_grid ,
          g_r_alv_container TYPE REF TO cl_gui_custom_container ,
          g_container          TYPE scrfname VALUE 'ALV_CUSTOM_CONTROL_0200' ,
          g_t_text_lines       TYPE TABLE OF type_text_lines,
          g_t_fcat             TYPE lvc_t_fcat,
          g_ok_code            TYPE sy-ucomm,
          g_save_ok            TYPE sy-ucomm,
          g_repid              TYPE sy-repid,
          l_tab(20)            TYPE c.
    FIELD-SYMBOLS <struc>  TYPE ANY.
    FIELD-SYMBOLS <tab>    TYPE table.
    DATA s_ref             TYPE REF TO data.
    DATA t_ref             TYPE REF TO data.
    START-OF-SELECTION.
      CALL SCREEN 100.
    FORM runsql.
      CONCATENATE LINES OF g_t_text_lines INTO l_tab.
      CREATE DATA s_ref      TYPE (l_tab).
      CREATE DATA t_ref      TYPE TABLE OF (l_tab).
      ASSIGN t_ref->*    TO <tab>.
      SELECT * FROM (l_tab) INTO TABLE <tab>.
      CALL SCREEN 200.
    ENDFORM."
    MODULE pbo OUTPUT.
      CASE sy-dynnr.
        WHEN '0100'.
          IF g_editor IS INITIAL.
            SET PF-STATUS 'MAIN100'.
            g_repid = sy-repid.
            CREATE OBJECT g_r_editor_container
            EXPORTING
              container_name = 'TEXTEDITOR1'
            EXCEPTIONS
              cntl_error = 1
              cntl_system_error = 2
              create_error = 3
              lifetime_error = 4
              lifetime_dynpro_dynpro_link = 5.
            CREATE OBJECT g_editor
            EXPORTING
              parent = g_r_editor_container
              wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
            EXCEPTIONS
              OTHERS = 1.
          ENDIF.
        WHEN '0200'.
          PERFORM create_alv_grid.
      ENDCASE.
    ENDMODULE."
    MODULE pai INPUT.
      g_save_ok = g_ok_code.
      CASE g_save_ok.
        WHEN 'BACK'.
        WHEN 'EXIT'.
        WHEN 'CANCEL'.
          PERFORM exit_program.
        WHEN 'RUNSQL'.
          CALL METHOD g_editor->get_text_as_r3table
            IMPORTING
              table  = g_t_text_lines
            EXCEPTIONS
              OTHERS = 1.
          PERFORM runsql.
      ENDCASE.
    ENDMODULE."
    FORM create_field_catalog.
      DATA: l_structure_name LIKE  dd02l-tabname.
      CLEAR g_t_fcat.
      l_structure_name = l_tab.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = l_structure_name
          i_bypassing_buffer     = 'X'
        CHANGING
          ct_fieldcat            = g_t_fcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    ENDFORM."
    FORM create_alv_grid.
      DATA:        l_s_layout      TYPE lvc_s_layo.
      CLEAR: g_r_alv_container,
             g_r_alv_grid.
      PERFORM create_field_catalog.
      CREATE OBJECT g_r_alv_container
             EXPORTING container_name = g_container.
      CREATE OBJECT g_r_alv_grid
             EXPORTING i_parent = g_r_alv_container.
      CALL METHOD g_r_alv_grid->set_table_for_first_display
        EXPORTING
          is_layout          = l_s_layout
          i_bypassing_buffer = 'X'
        CHANGING
          it_outtab          = <tab>
          it_fieldcatalog    = g_t_fcat.
      CALL METHOD g_r_alv_grid->refresh_table_display.
    ENDFORM."
    FORM exit_program.
      CALL METHOD cl_gui_cfw=>flush
        EXCEPTIONS
          OTHERS = 1.
      LEAVE PROGRAM.
    ENDFORM."

    Hello Bjorn
    I would recommend a few changes:
    (1) Create the container and ALV grid instance for screen '200' only once (in a PBO module of screen '200' using a switch:
    CHECK ( g_r_alv_container IS INITIAL ).
    (2) Call method SET_TABLE_FOR_FIRST_DISPLAY in a PBO module of screen '200'. Perhaps add a "flush" to this PBO module, too.
    Regards
       Uwe

  • Problem double click ALV GRID

    Hi folks,
    I'm trying to get an ALV GRID to make something if I double click one line, this is my code:
    FORM create_alv.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
                 i_callback_program = sy-repid
                 I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                 is_layout          = gs_layout
                 it_fieldcat        = gt_itab_catalog[]
                 i_default          = 'X'
                 i_save             = 'A'
                 it_events          = events[]
            TABLES
                 t_outtab           = itab_all
            EXCEPTIONS
                 program_error      = 1
                 OTHERS             = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM. 
    FORM USER_COMMAND USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
      break-point.
      CASE r_ucomm.
        WHEN '&IC1'.
          READ TABLE itab_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *      PERFORM build_fieldcatlog_ekpo.
    *      PERFORM event_call_ekpo.
    *      PERFORM populate_event_ekpo.
    *      PERFORM data_retrieval_ekpo.
    *      PERFORM build_listheader_ekpo USING it_listheader.
    *      PERFORM display_alv_ekpo.
      ENDCASE.
    ENDFORM. "user_command
    Why when I'm double clicking the form USER_COMMAND isn't being executed. The break-point I set in there doesn't get executed.
    Can anyone tell me if i'm missing something.
    Thanks for your help in advance.
    Regards,
    Gilberto Li

    Hi again,
    Ok here's the code:
    FORM init_catalog.
    * SOCIEDAD
        gt_itab_catalog-fieldname = 'BUKRS'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Sociedad'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 1.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * CONTRATO
        gt_itab_catalog-fieldname = 'EBELN'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Contrato Marco'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 2.
        gt_itab_catalog-outputlen = 15.
        gt_itab_catalog-hotspot = 'X'.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * CLASE DE DOC
        gt_itab_catalog-fieldname = 'BSART'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Clase de Contrato'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 3.
        gt_itab_catalog-outputlen = 15.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * RIGE DESDE
        gt_itab_catalog-fieldname = 'KDATB'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Rige desde'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 4.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * VENCE
        gt_itab_catalog-fieldname = 'KDATE'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Vence el'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 5.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * FECHA DE CREACION
        gt_itab_catalog-fieldname = 'AEDAT'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Creado el'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 6.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * PROVEEDOR
        gt_itab_catalog-fieldname = 'LIFNR'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Proveedor'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 7.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * NOMBRE DE PROVEEDOR
        gt_itab_catalog-fieldname = 'NAME1'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Nombre Proveedor'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 8.
        gt_itab_catalog-outputlen = 20.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * CED JURIDICA
        gt_itab_catalog-fieldname = 'STCD1'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Cédula Jurídica'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 9.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * MATERIAL
        gt_itab_catalog-fieldname = 'MATNR'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Material'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 10.
        gt_itab_catalog-outputlen = 18.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * NOMBRE DE MATERIAL
        gt_itab_catalog-fieldname = 'MAKTX'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Desc. Material'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 11.
        gt_itab_catalog-outputlen = 20.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * MONTO
        gt_itab_catalog-fieldname = 'NETPR'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Monto'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 12.
        gt_itab_catalog-outputlen = 16.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * MONEDA
        gt_itab_catalog-fieldname = 'WAERS'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Moneda'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 13.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    ENDFORM.                    "init_catalog
    FORM init_layout.
      gs_layout-zebra = 'X'.
      gs_layout-f2code = '&amp;ETA'.
      gs_layout-detail_popup = 'X'.
      gs_layout-no_totalline = 'X'.
    ENDFORM.  "init_layout
    FORM listado.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
                 i_callback_program = g_repid
                 I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                 it_fieldcat        = gt_itab_catalog[]
            TABLES
                 t_outtab           = itab_all
            EXCEPTIONS
                 program_error      = 1
                 OTHERS             = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM. 
    FORM USER_COMMAND USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
      break-point.
      CASE r_ucomm.
        WHEN '&IC1'.
          READ TABLE itab_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *      PERFORM build_fieldcatlog_ekpo.
    *      PERFORM event_call_ekpo.
    *      PERFORM populate_event_ekpo.
    *      PERFORM data_retrieval_ekpo.
    *      PERFORM build_listheader_ekpo USING it_listheader.
    *      PERFORM display_alv_ekpo.
      ENDCASE.
    ENDFORM. "user_command
      PERFORM init_catalog.
      PERFORM init_layout.
      PERFORM listado.
    I just post the ALV GRID creation code.
    Hope you guys can guide me through this.
    Thanks again.
    Regards,
    Gilberto Li

  • Capturing the current ALV grid contents. How?

    Hi forum,
    After lots of searching, I still can't find out how I can get the current contents of the ALV grid. I need this for an editable ALV grid to keep track of the data changes.
    By the way, I am using the traditional ALV, not OO ALV.
    Let me share the steps I already did but still failed.
    1
    I used the FM GET_GLOBALS_FROM_SLVC_FULLSCR to have access to the CL_GUI_ALV_GRID object. I tried using some of the methods inside that class, all to no avail.
    Some methods I tried were set_selected_columns and set_selected_rows and then call the method get_selected_cells. Basically, the idea is to simulate highlighting of cells, and select them using get_selected_cells. But the problem is that get_selected_cells is not returning the value (although it correctly returns the row and column that I set -- but not the value in that cell coordinates).
    2
    I also saw the protected method get_changed_data -- but the problem is that it is protected, so I created a subclass of CL_GUI_ALV_GRID to ZCL_GUI_ALV_GRID and copied the private attributes and methods that get_changed_data depends on. I was able to do this but GET_GLOBALS_FROM_SLVC_FULLSCR strictly returns CL_GUI_ALV_GRID. The upcast from CL_GUI_ALV_GRID to ZCL_GUI_ALV_GRID fails. So I still can't use/test get_changed_data.
    3
    I also saw some code regarding events. Here's a sample but this doesn't work:
        REFRESH lt_events.
        lwa_event-name = 'DATA_CHECK'. "Event name
        lwa_event-form = 'HANDLE_DATA_CHANGED'.
        APPEND lwa_event TO lt_events.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
            EXPORTING
                it_fieldcat_lvc         = it_fieldcat
                is_layout_lvc           = ls_layout
                it_events               = lt_events
    FORM handle_data_changed using ref_data_changed
                              type ref to cl_alv_changed_data_protocol.
        BREAK-POINT.
    ENDFORM.
    I would really appreciate it (and I know a lot of other ABAPers will, too) if you could point me to how I can get the ALV grid contents. Thanks.
    Kyle

    Hi Keshav,
    sure I will check those tomorrow when I get back to work.
    All,
    Here's the code if it helps:
    *& Report  Z_ALV_EDITABLE
    REPORT  Z_ALV_EDITABLE.
    TYPE-POOLS:
        slis
    DATA:
        BEGIN OF i_out OCCURS 0,
            operand1 TYPE i,
            operand2 TYPE i,
            operator TYPE c,
            result   TYPE i,
        END OF i_out
    START-OF-SELECTION.
        PERFORM prepareData.
        PERFORM refreshResults.
        PERFORM createALV_LVC.
    FORM prepareData.
        REFRESH i_out.
        DO 10 TIMES.
            i_out-operand1 = 1.
            i_out-operand2 = 2.
            i_out-operator = '+'.
            APPEND i_out.
        ENDDO.
    ENDFORM.
    FORM refreshResults.
        LOOP AT i_out.
            CASE i_out-operator.
                WHEN '+'.
                    i_out-result = i_out-operand1 + i_out-operand2.
                WHEN '-'.
                    i_out-result = i_out-operand1 - i_out-operand2.
                WHEN '*'.
                    i_out-result = i_out-operand1 * i_out-operand2.
                WHEN '/'.
                    IF i_out-operand2 NE 0.
                        i_out-result = i_out-operand1 - i_out-operand2.
                    ENDIF.
                WHEN OTHERS.
                    i_out-result = ''.
            ENDCASE.
            MODIFY i_out.
        ENDLOOP.
    ENDFORM.
    FORM createALV_LVC.
        DATA:
            it_fieldcat TYPE lvc_t_fcat,
            ls_layout   TYPE lvc_s_layo,
            lt_events   TYPE slis_t_event,
            lwa_event   TYPE slis_alv_event
        " Field Catalog
        PERFORM createFieldcat CHANGING it_fieldcat.
        " Sorting
        PERFORM createSort.
        " Layout
        ls_layout-cwidth_opt = 'X'.
        " Events
        REFRESH lt_events.
        lwa_event-name = 'DATA_CHECK'. "Event name
        lwa_event-form = 'HANDLE_DATA_CHANGED'.
        APPEND lwa_event TO lt_events.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
            EXPORTING
                it_fieldcat_lvc         = it_fieldcat
                is_layout_lvc           = ls_layout
    *            it_sort                 =
                it_events               = lt_events
                i_callback_program      = 'Z_ALV_EDITABLE'
                i_callback_user_command = 'USER_COMMAND'
                i_callback_pf_status_set = 'PF_STATUS_SET'
                i_save                  = 'X'
            TABLES
                t_outtab                = i_out
            EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    ENDFORM.
    FORM createFieldcat CHANGING it_fieldcat TYPE lvc_t_fcat.
        DATA:
            wa_fcat LIKE LINE OF it_fieldcat
        REFRESH it_fieldcat.
        DEFINE m_append_fieldcat.
            CLEAR wa_fcat.
            wa_fcat-edit      = &1.
            wa_fcat-fieldname = &2.
            wa_fcat-scrtext_m = &3.
            APPEND wa_fcat TO it_fieldcat.
        END-OF-DEFINITION.
        m_append_fieldcat '' 'OPERAND1' 'Operand 1'.
        m_append_fieldcat '' 'OPERAND2' 'Operand 2'.
        m_append_fieldcat 'X' 'OPERATOR' 'Operator'.
        m_append_fieldcat '' 'RESULT'   'Result'.
    ENDFORM.
    FORM createSort.
    ENDFORM.
    FORM PF_STATUS_SET USING    P_EXTAB TYPE SLIS_T_EXTAB.
        SET PF-STATUS 'Z_ALV_STATUS' EXCLUDING P_EXTAB.
    ENDFORM.                    "PF_STATUS_SET
    FORM user_command
        USING
            r_ucomm TYPE sy-ucomm
            ls_selfield TYPE slis_selfield.
        CASE r_ucomm.
            WHEN 'REFRESH'.
                " CHECK i_out HERE IF IT CHANGED ALONG WITH THE EDITS
                BREAK-POINT.
    *            PERFORM refreshALV.
        ENDCASE.
    ENDFORM.
    FORM handle_data_changed using ref_data_changed
                              type ref to cl_alv_changed_data_protocol.
        BREAK-POINT.
    ENDFORM.

  • How to supress dialog while ALV Grid output is send to Spool

    Hi,
    I need to get the ALV grid output in spool.But when i am executing my program using ALV grid function module with print parameter passed,first its giving a popup with default printer and number of copies and when i press ok for the popup ,spool request is created.But i dont want this popup to come while executing my program.It should create the spool request directly. How to solve this issue.
    Regards
    Shibin

    Hi Shibin,
    Try the below parameter in IS_PRINT Structure:
    is_print-print = 'N'.
    This will Supress the Dialog and create a Spool with no Immeadiate Output.
    Hope This Helps you..
    Thanks & Regards,
    Suresh Karri

  • ALV Grid update

    Hi All,
    I have a requirement.
    In the ALV grid, I have to select a row. When I click the change ICON, the data in the rows should be populated in the customized screen.
    I had already done this part.
    Now I had changed the values in the customized screen. When I click the 'SAVE' button in the customized screen, the data in the screen should be passed to the GRID.
    Here, I had updated the table which is used in the GRID. But, how to refresh the GRID, so that I can see the changed values in the GRID.
    I had used refresh_table_display method.. But it prompts me an error.. and the program is exited.
    If anyone had done this.. kindly send me the code.... or help me out how to proceed.
    Thanks in advance.
    Jaffer Ali.S

    From what you say, since you are using an Information Message, irrespective of whether the user wants it or not, the ALV Grid has to be updated with the calculations that you do. He cannot choose to cancel the operation. Am I correct?
    If yes, then all you need to do is to update the ALV output table with the calculations that you have done and call the method refresh_table_display.
    see this example program
    believe that the after the info message you are updating the ALV grid value. Then try these out,
    to update the ALV grid,
    call method addressbook_grid->set_ready_for_input
    exporting
    i_ready_for_input = 1. " Sets to edit mode
    data : w_intab1 like table of zc1address with header line .
    Here update is performed using a work area
    you can also specify the partcular column and update it.
    update zc1address from table t_intab1.
    if sy-subrc = 0.
    message i000. " success message
    else.
    message i001. " unsuccess message
    endif.
    refreshing the grid to display the modified values
    call method addressbook_grid->refresh_table_display.
    sets ALV grid to display mode.
    call method addressbook_grid->set_ready_for_input
    exporting
    i_ready_for_input = 0.

  • ALV Grid Field catalog

    Hi,
         I am trying to display data from two different tables, say 3 fields from one table and 3 fields from other table. in alv grid format using classes and using method CALL METHOD go_grid->set_table_for_first_display
    how can we build the field catalog for the internal table which consists of 6 fields from two different tables
    thanks in advance

    Hello,
    Please check,it is similar case.
    FORM set_grid.
      IF g_r_grid IS INITIAL.
        CREATE OBJECT g_r_cont
                     EXPORTING container_name = 'CUST1'.
        CREATE OBJECT g_r_grid
                     EXPORTING i_parent = g_r_cont.
        g_r_variant = sy-repid.
      Build Field Catalog
        PERFORM build_field_catalog.
      Exclude process options from ALV
        PERFORM alv_excl.
      setting ALV Grid layout
        PERFORM alv_layo.
        CALL METHOD g_r_grid->set_table_for_first_display
           EXPORTING
             is_layout                     = g_r_layo
             is_variant                    = g_r_variant
             it_toolbar_excluding          = g_r_excl
             i_save                        = 'X'
           CHANGING
             it_outtab                     = g_t_alv[]
             it_fieldcatalog               = g_t_fieldcat.
      ENDIF.
    ENDFORM.                    " set_grid
    *Form Routine ID    : build_field_catalog
    *Form Routine Name  : TO Build Field Catalog
    *Outline            : Subroutine for building the field catalog
    *Argument           : None
    *Return Value       : None
    FORM build_field_catalog.
      DATA : l_f_n TYPE i.
      REFRESH g_t_fieldcat.
      l_f_n  = 0.
    Add properties values to ALV Catalog
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MATNR' 'CHAR' l_f_n
                                text-001 'X' space ' ' 18 ' '  .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'TXZ01' 'CHAR' l_f_n
                                text-002 'X' space 'X' 40 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MFRPN' 'CHAR' l_f_n
                                text-003 ' ' space ' ' 40 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EBELN' 'CHAR' l_f_n
                                 text-004 space space ' ' 10 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EBELP' 'NUMC' l_f_n
                                 text-005 space space ' ' 5 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EINDT' 'DATS' l_f_n
                                 text-006 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MENGE' 'QUAN' l_f_n
                                 text-007 space space ' ' 13 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MEINS' 'UNIT' l_f_n
                                 text-008 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MENGE1' 'QUAN' l_f_n
                                 text-009 space space ' ' 13 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MEINS1' 'UNIT' l_f_n
                                 text-010 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LIFNR' 'CHAR' l_f_n
                                 text-011 space space ' ' 10 'ALPHA'.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'NAME1' 'CHAR' l_f_n
                                 text-012 space space 'X' 35 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BSART' 'CHAR' l_f_n
                                 text-013 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BEDAT' 'DATS' l_f_n
                                 text-014 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'AEDAT' 'DATS' l_f_n
                                 text-015 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'INSMK' 'CHAR' l_f_n
                                 text-016 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'WERKS' 'CHAR' l_f_n
                                 text-017 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LGORT' 'CHAR' l_f_n
                                 text-018 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EKGRP' 'CHAR' l_f_n
                                 text-019 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PSTYP' 'CHAR' l_f_n
                                 text-020 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LOEKZ' 'CHAR' l_f_n
                                 text-021 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'DISPO' 'CHAR' l_f_n
                                 text-022 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PO_TEXT' 'CHAR' l_f_n
                                 text-023 space space 'X' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BSGRU' 'CHAR' l_f_n
                                 text-024 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA1' 'CHAR' l_f_n
                                 text-025 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT1' 'CHAR' l_f_n
                                 text-026 space space 'X' 40 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA2' 'CHAR' l_f_n
                                 text-027 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT2' 'CHAR' l_f_n
                                 text-028 space space 'X' 40 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA3' 'CHAR' l_f_n
                                 text-029 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT3' 'CHAR' l_f_n
                                 text-030 space space 'X' 40 ' '.
    ENDFORM.                    " build_field_catalog
    *Form Routine ID    : add_catalog
    *Form Routine Name  : To Add the Catalog for the ALV
    *Outline            : Subroutine to add properties values to ALV Catalog
    *Argument           : p_fname        "Field Name
                        p_inttype      "Intenal Type
                        p_col_pos      "Column Position
                        p_coltext      "Column Text
                        p_key          "Key Field
                        p_hotspot      "Hotspot Enabled
                        p_outlen       "Internal Length
                        p_convexit     "conversion exit name
    *Return Value       : g_t_fieldcat   "Field Catalog Table
    FORM add_catalog USING   p_fname
                             p_inttype
                             p_col_pos
                             p_col_text
                             p_key
                             p_hotspot
                             p_lowercase
                             p_outlen
                             p_convexit.
      CLEAR g_r_fieldcat.
      g_r_fieldcat-fieldname = p_fname.
      g_r_fieldcat-inttype   = p_inttype.
      g_r_fieldcat-col_pos   = p_col_pos.
      g_r_fieldcat-coltext   = p_col_text.
      g_r_fieldcat-hotspot   = p_hotspot.
      g_r_fieldcat-lowercase = p_lowercase.
      g_r_fieldcat-outputlen = p_outlen.
      g_r_fieldcat-key       = p_key.
      g_r_fieldcat-convexit  = p_convexit.
      APPEND g_r_fieldcat TO g_t_fieldcat.
    ENDFORM.                    " add_catalog
    *Form Routine ID    : alv_excl
    *Form Routine Name  : ALV Exclude List
    *Outline            : Subroutine to exclude process options from ALV
    *Argument           : None
    *Return Value       : None
    FORM alv_excl.
      APPEND cl_gui_alv_grid=>mc_mb_sum          TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_mb_subtot       TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_graph        TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_info         TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_print_back   TO g_r_excl.
    ENDFORM.                    " alv_excl
    *Form Routine ID    : alv_layo
    *Form Routine Name  : alv_layo
    *Outline            : Subroutine to set alv layout
    *Argument           : None
    *Return Value       : None
    FORM alv_layo.
      g_r_layo-grid_title = text-100.
      g_r_layo-cwidth_opt = g_c_mark.
      g_r_layo-zebra      = g_c_mark.
      g_r_layo-no_rowmark = space.
      g_r_layo-sel_mode   = g_c_selmode.
    ENDFORM.                 
    Regards

  • Multiple ALV Grid Panes in single screen

    Hi all,
    How can we get multiple ALV Grid panes in single output.
    Is it possible to get the same without using OOPS.
    Thanks in advance. 
    Eswar

    Hi,
    You can do this by creating 2 custom controls on the layout of the screen, and then you will also need to create 2 custom containers in your ABAP program, 1 for each ALV.
    Ex :
    grid  TYPE REF TO cl_gui_alv_grid,
    custom_container TYPE REF TO cl_gui_custom_container,
    grid  TYPE REF TO cl_gui_alv_grid,
    custom_container TYPE REF TO cl_gui_custom_container,
    regards,
    Advait

  • BDC for ALV grid

    hi all,
    after a long search in the forums im posting this,
    i have a Z tcode for which im creating a BDC (in a FM). this tcode when i execute manually  i will get a ALV grid output with a check box(only 1 record).
    i have to select this check box and press a push button which will further proceed.
    now when i process the tcode manually this check box is identified and a method in PAI is ldentifying  the changed data before and after selecting the check box and further process is done.
    Now after searching i came to know that this BDC cannot capture the checkbox value.
    now my concern is how do i capture the value in checkbox and pass to the background program separately into the PAI module, or can i add a perform stmt to capture the value in BDC. or any IMPORT or EXPORT stmt will work.
    any help in this regard will be gratefull.
    regards,

    If not capturing the value,
    You can code that value
    in
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                                           'YOUR_FIELD'.
        PERFORM bdc_field       USING 'YOUR_FIELD'
                                                            'X'.
    Insert this code into your exact place.

  • Check box in ALV grid gets unselected for new selection

    Hi all,
    This is my code :
    TYPE-POOLS : slis.
    Variable
    DATA: g_repid LIKE sy-repid,
          g_title TYPE lvc_title,
          g_set_pf_stat TYPE slis_formname VALUE 'SET_PF_STATUS',
          g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
          g_layout TYPE slis_layout_alv,
          g_print_alv TYPE slis_print_alv,
          g_variant LIKE disvariant,
          c_char_a(1) VALUE 'A',
          c_char_x(1) VALUE 'X',
          itab_alv_sort TYPE slis_t_sortinfo_alv,
          itab_alv_fcat TYPE slis_t_fieldcat_alv,
          fm_name type rs38l_fnam," Function Module Name
    *      l_sfctrlparams LIKE ssfctrlop, " Form Print Parameter
    *      l_sfoutopt LIKE ssfcompop,
          pri_params LIKE pri_params,
          c_x type c .
    *       Internal tables          Begin with IT_                       *
    DATA : it_fcat TYPE SLIS_T_FIELDCAT_ALV,                           "---ALV
           it_disp type table of ZLOI.
    *       Work Area for Internal tables      Begin with WA_             *
    data : wa_fcat TYPE slis_fieldcat_alv ,              "---ALV
           wa_layout           TYPE lvc_s_layo,               "---ALV
           wa_it_disp like line of it_disp.
    *       Objects                                                       *
    DATA : cref TYPE REF TO cl_gui_custom_container,          "---ALV
           gref TYPE REF TO cl_gui_alv_grid.                  "---ALV
    *        Start-of-selection
    Start-of-selection.
      perform fetch_po_det.
      perform build_fcat.
      perform alv_display.
    *&      Form  FETCH_PO_DET
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FETCH_PO_DET .
      data : it_po type table of crmd_orderadm_h,
               wa_po like line of it_po,
               wa_header type BBP_PDS_PO_HEADER_D.
      select  guid
              object_id
              DESCRIPTION
              POSTING_DATE
              CREATED_BY
      from crmd_orderadm_h
      into corresponding fields of table it_po
      where object_type = 'BUS2201'.
      loop at it_po into wa_po.
        move wa_po-object_id to wa_it_disp-ZZPONO.
        move wa_po-DESCRIPTION to wa_it_disp-ZZPODESC.
        move wa_po-posting_date to wa_it_disp-ZZPODATE.
        move wa_po-created_by to wa_it_disp-ZZPOCREATOR.
        CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
          EXPORTING
            I_OBJECT_ID = wa_it_disp-zzpono
          IMPORTING
            E_HEADER    = wa_header.
        move wa_header-total_value to wa_it_disp-ZZPOVAL.
        move wa_header-currency to wa_it_disp-ZZPOCUR.
        append wa_it_disp to it_disp.
      endloop.
    *  write : wa_it_disp-zzpono.
    ENDFORM.                    " FETCH_PO_DET
    *&      Form  BUILD_FCAT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BUILD_FCAT .
      g_repid = sy-repid.
      g_title = 'LOI details'.
      g_print_alv-no_print_listinfos = 'X'.
      g_variant-report = sy-repid.
      g_variant-variant = sy-title.
      CLEAR g_layout.
      g_layout-f2code = ' '.
      wa_layout-zebra       = 'X'.
      g_layout-flexible_key = 'X'.
      g_layout-colwidth_optimize = 'X'.
      g_layout-detail_initial_lines = 'X'.
      g_layout-box_fieldname = 'ZZCHECK'.
    *g_layout-box_tabname = 'ITAB_REPORT'.
    *Check box
      wa_fcat-fieldname = 'ZZCHECK'.
      wa_fcat-checkbox = 'X'.
      wa_fcat-outputlen = '1'.
      wa_fcat-col_pos = '1'.
      wa_fcat-edit = '1'.
      wa_fcat-seltext_m = 'No'.
      append wa_fcat to it_fcat.
    *Po no
      clear wa_fcat.
      wa_fcat-fieldname = 'ZZPONO' .
    wa_fcat-tabname = 'IT_DISP'.
    *  wa_fcat-seltext = 'Purchase Order'.
      wa_fcat-seltext_m  = 'Purchase Order'.
    *wa_fcat-seltext_s = 'Purchase Order.
    wa_fcat-icon = 'X'.
      wa_fcat-col_pos = '2'.
      wa_fcat-outputlen = 10.
      append wa_fcat to it_fcat.
    *Desc
      wa_fcat-fieldname = 'ZZPODESC' .
    wa_fcat-tabname = 'IT_DISP'.
    *wa_fcat-seltext_l = 'Description'.
      wa_fcat-seltext_m = 'Description'.
    *wa_fcat-seltext_s = 'Description'.
      wa_fcat-col_pos = '3'.
      wa_fcat-outputlen = 10.
      append wa_fcat to it_fcat.
    *Postign date
      wa_fcat-fieldname = 'ZZPODATE' .
    wa_fcat-tabname = 'IT_DISP'.
    wa_fcat-seltext_l = 'Posting Date'.
      wa_fcat-seltext_m = 'Posting Date'.
    *wa_fcat-seltext_s = 'Posting Date'.
      wa_fcat-col_pos = '4'.
      wa_fcat-outputlen = 8.
      append wa_fcat to it_fcat.
    *value
      wa_fcat-fieldname = 'ZZPOVAL' .
    wa_fcat-tabname = 'IT_DISP'.
    *wa_fcat-seltext_l = 'PO value'.
      wa_fcat-seltext_m = 'PO value'.
    *wa_fcat-seltext_s = 'PO value'.
      wa_fcat-col_pos = '5'.
      wa_fcat-outputlen = 15.
      append wa_fcat to it_fcat.
    *Currency
      wa_fcat-fieldname = 'ZZPOCUR' .
    wa_fcat-tabname = 'IT_DISP'.
    *wa_fcat-seltext_l = 'PO Currency'.
      wa_fcat-seltext_m = 'PO Currency'.
    *wa_fcat-seltext_s = 'PO Currency'.
      wa_fcat-col_pos = '6'.
      wa_fcat-outputlen = 5.
      append wa_fcat to it_fcat.
    *Creator
      wa_fcat-fieldname = 'ZZPOCREATOR' .
    wa_fcat-tabname = 'IT_DISP'.
    *wa_fcat-seltext_l = 'Buyer'.
      wa_fcat-seltext_m = 'Buyer'.
    *wa_fcat-seltext_s = 'Buyer'.
      wa_fcat-col_pos = '7'.
      wa_fcat-outputlen = 12.
      append wa_fcat to it_fcat.
    ENDFORM.                    " BUILD_FCAT
    *&      Form  ALV_DISPLAY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM ALV_DISPLAY .
      sort it_disp by ZZPONO.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = g_repid
         I_CALLBACK_PF_STATUS_SET          = g_set_pf_stat
         I_CALLBACK_USER_COMMAND           = g_user_command
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
          I_GRID_TITLE                      = g_title
    *   I_GRID_SETTINGS                   =
          IS_LAYOUT                         = g_layout
          IT_FIELDCAT                       = it_fcat[]
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
          IS_VARIANT                        = g_variant
    *   IT_EVENTS                         =
    *   IT_EVENT_EXIT                     =
          IS_PRINT                          = g_print_alv
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = it_disp[]
       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.                    " ALV_DISPLAY
    *&      Form  user_command
    *       text
    *      -->R_UCOMM      text
    *      -->RS_SELFIELD  text
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.                             "#EC CALLED
      CASE R_UCOMM.
        WHEN 'PRINT'.
          READ TABLE IT_disp INTO WA_IT_DISP WITH KEY ZZCHECK = 'X'.
          IF SY-SUBRC EQ 0.
            loop at it_DISP INTO WA_IT_DISP.
              CALL FUNCTION 'POPUP_TO_CONFIRM'
                EXPORTING
                  TEXT_QUESTION = 'Print the LOI details?'
                  TEXT_BUTTON_1 = 'Yes'
                  TEXT_BUTTON_2 = 'No'.
    *      IMPORTING
    *        ANSWER        = w_answer.
              IF SY-SUBRC  0.
              ENDIF.
    *          PERFORM CALL_SF.
            endloop.
          ENDIF.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
      ENDCASE.
      rs_selfield-refresh = 'X'.
    ENDFORM.                    "user_command
    *&      Form  set_pf_status
    *       text
    *      -->RT_EXTAB   text
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZSTANDARD' EXCLUDING rt_extab.
      SET TITLEBAR sy-tcode.
    ENDFORM.                    "set_pf_status
    Now in my ALV grid o/p i can  see the check box  but if i select one row and then try to slect another the first one gets deselected.
    Can anybody tell me what is missing?

    Hi,
    if you need just a check box for each line, try to get rid of this line from your layout.
    g_layout-box_fieldname = 'ZZCHECK'.
    SAP uses this field to store info about selected lines. Hence you click on the second check box, you select different line and the first line is erased. You can select more line by holding SHIFT + CTRL
    Cheers

Maybe you are looking for

  • Upgrading and Partitioning

    Hi there, I'm going to be upgrading my OS (currently Tiger), over to Snow Leopard.  I purchased a 1TB external Firewire 800 Harddrive to back-up my current OS.  My plan is to create two partitions on the external HD... - the first partition for a boo

  • Offline Form Issue in SAP GRC System

    Experts: I am working on creating a Offline Form for GRC Process Control  in SAP GRC System. I have couple of doubts. 1. In the Form property, there is a new field call 'Inbound Handler'.    The document which I referred says  that, this 'inbound han

  • Custom profile not appearing in "Devices to simulate"

    I've downloaded a custom printer/paper profile from Dry Creek Photo for my local Costco. I've saved the .icc profile to to the Users\[user name]\Library\ColorSync\Profiles folder. However, when I try to soft proof using View > Proof Setup > Custom, I

  • Can I take external disk imaage with me?

    I have been able to put some disk images on my external hardrive. I mount them sometimes in order to view via the DVD player. Here's my question. If I want to "load" a disk image of something I've made on my Macbook in order to show someone. How do I

  • IPhone 5c time not changing

    My wife and I decided to change from sprint to verizon 20 days ago. We both got the new iPhone 5c's. Over the last week I noticed my phones time would be off by couple minutes, sometimes a few hours. My wife went to the verizon store and the customer