<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: method get_selected_rows not working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538809#M851387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Badri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD grid1-&amp;gt;get_selected_rows&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;et_index_rows = lt_index_rows&lt;/P&gt;&lt;P&gt;et_row_no = lt_row_no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure that this call is made in the PAI of the ALV screen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is not in the PAI then its not going to be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also,  its better if it is done before the CASE statemet (if any ....for user commands) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Mar 2008 05:11:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-17T05:11:00Z</dc:date>
    <item>
      <title>method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538804#M851382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using method get_selected_rows of cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: lt_index_rows TYPE lvc_t_row,&lt;/P&gt;&lt;P&gt;  lt_row_no TYPE lvc_t_roid.&lt;/P&gt;&lt;P&gt;  DATA: l_selected_row TYPE lvc_s_row,&lt;/P&gt;&lt;P&gt;  l_tabix TYPE sytabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD grid1-&amp;gt;get_selected_rows&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      et_index_rows = lt_index_rows&lt;/P&gt;&lt;P&gt;      et_row_no     = lt_row_no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it's not working. it's not going inside the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lt_index_rows is remaining as initial and there are no entries in lt_row_no .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what could be reason? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Badhri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 12:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538804#M851382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T12:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538805#M851383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to give this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ALL METHOD grid1-&amp;gt;get_selected_rows
IMPORTING
et_index_rows = lt_index_rows[] "&amp;lt;&amp;lt;&amp;lt;
et_row_no = lt_row_no.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 18:10:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538805#M851383</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-03-14T18:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538806#M851384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Badhri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have a &lt;STRONG&gt;selection mode&lt;/STRONG&gt; (LVC_S_LAYO-SEL_MODE) which allows &lt;STRONG&gt;multiple&lt;/STRONG&gt; selection on your ALV list? If you you should have a "marking" column on the left border of the ALV grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your list does not allow to select multiple rows then I expect that this method does not make sense in this context and, therefore, returns nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 19:49:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538806#M851384</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-03-14T19:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538807#M851385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Badri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you pass the selection mode &lt;/P&gt;&lt;P&gt;     &lt;STRONG&gt;LVC_S_LAYO-SEL_MODE = 'X'&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;which allows multiple selection on your ALV list? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have not done that, then your list will not allow to select multiple rows. In that case, the &lt;STRONG&gt;get_selected_rows&lt;/STRONG&gt; method does not make any sense and therefore returns nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 03:27:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538807#M851385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T03:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538808#M851386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But still it's not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Badri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 04:48:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538808#M851386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T04:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538809#M851387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Badri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD grid1-&amp;gt;get_selected_rows&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;et_index_rows = lt_index_rows&lt;/P&gt;&lt;P&gt;et_row_no = lt_row_no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure that this call is made in the PAI of the ALV screen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is not in the PAI then its not going to be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also,  its better if it is done before the CASE statemet (if any ....for user commands) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 05:11:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538809#M851387</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T05:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538810#M851388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before createing control, please check control is initial.&lt;/P&gt;&lt;P&gt;  IF control is INITIAL.&lt;/P&gt;&lt;P&gt;        create_control.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;I feel this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subramanian.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 16:49:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538810#M851388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T16:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538811#M851389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Badri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following sample report &lt;STRONG&gt;ZUS_SDN_ALV_EDITABLE_1E&lt;/STRONG&gt; shows how this method works and the effect of the layout attribute &lt;STRONG&gt;NO_ROWMARK&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_ALV_EDITABLE_1E
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Thread: method get_selected_rows not working
*&amp;amp; &amp;lt;a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="782759"&amp;gt;&amp;lt;/a&amp;gt;
*&amp;amp;---------------------------------------------------------------------*
* Flow logic of screen '100' (no elements, ok-code =&amp;gt; gd_okcode ):
**PROCESS BEFORE OUTPUT.
**  MODULE STATUS_0100.
***
**PROCESS AFTER INPUT.
**  MODULE USER_COMMAND_0100.
*&amp;amp;---------------------------------------------------------------------*

REPORT  zus_sdn_alv_editable_1e.


TYPE-POOLS: abap.


CONSTANTS:
  gc_tabname       TYPE tabname  VALUE 'KNB1'.


TYPES: BEGIN OF ty_s_outtab.
INCLUDE TYPE knb1.
TYPES: END OF ty_s_outtab.
TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                      WITH DEFAULT KEY.

DATA:
  gd_okcode        TYPE ui_func,
*
  gt_fcat          TYPE lvc_t_fcat,
  gs_layout        TYPE lvc_s_layo,
  gs_variant       TYPE disvariant,
  go_docking       TYPE REF TO cl_gui_docking_container,
  go_grid          TYPE REF TO cl_gui_alv_grid.


DATA:
  gs_outtab        TYPE ty_s_outtab,
  gt_outtab        TYPE ty_t_outtab.

" 'X' = no rowmark, no selection of rows possible
PARAMETER:
  p_nomark         AS CHECKBOX  DEFAULT ' '.

*---------------------------------------------------------------------*
*       CLASS lcl_eventhandler DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_eventhandler DEFINITION.

  PUBLIC SECTION.
    CLASS-METHODS:
      handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
        IMPORTING
          er_data_changed
          e_onf4
          e_onf4_before
          e_onf4_after
          e_ucomm
          sender.


ENDCLASS.                    "lcl_eventhandler DEFINITION



*---------------------------------------------------------------------*
*       CLASS lcl_eventhandler IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_eventhandler IMPLEMENTATION.

  METHOD handle_data_changed.
*   define local data
    DATA: ld_answer(1)  TYPE c.



    " Triggers PAI -&amp;gt; required for list refresh
    CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code
      EXPORTING
        new_code = 'REFRESH'
*        IMPORTING
*          rc       =
        .




  ENDMETHOD.                    "handle_data_changed

ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION



START-OF-SELECTION.

  SELECT * FROM  (gc_tabname)
    INTO CORRESPONDING FIELDS OF TABLE gt_outtab UP TO 99 ROWS.





* Create docking container
  CREATE OBJECT go_docking
    EXPORTING
      parent = cl_gui_container=&amp;gt;screen0
      ratio  = 90
    EXCEPTIONS
      OTHERS = 6.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* Create ALV grid
  CREATE OBJECT go_grid
    EXPORTING
      i_parent = go_docking
    EXCEPTIONS
      OTHERS   = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  SET HANDLER:
    lcl_eventhandler=&amp;gt;handle_data_changed FOR go_grid.

  " Triggers event DATA_CHANGED by pushing ENTER
  CALL METHOD go_grid-&amp;gt;register_edit_event
    EXPORTING
      i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter
    EXCEPTIONS
      error      = 1
      OTHERS     = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* Build fieldcatalog and set hotspot for field KUNNR
  PERFORM build_fieldcatalog.

  PERFORM set_layout_and_variant.
  gs_layout-no_rowmark = p_nomark.


* Display data
  CALL METHOD go_grid-&amp;gt;set_table_for_first_display
    EXPORTING
      is_layout       = gs_layout
      is_variant      = gs_variant
      i_save          = 'A'
    CHANGING
      it_outtab       = gt_outtab
      it_fieldcatalog = gt_fcat
    EXCEPTIONS
      OTHERS          = 4.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

* NOTE:
* Documenation of I_SAVE ("An Easy Reference for ALV Grid Control")
*I_SAVE
*Determines the options available to the user for saving a layout:
*? 'X': global saving only
*? 'U': user-specific saving only
*? 'A': corresponds to 'X' and 'U'
*? SPACE: no saving



* Link the docking container to the target dynpro
  CALL METHOD go_docking-&amp;gt;link
    EXPORTING
      repid                       = syst-repid
      dynnr                       = '0100'
*      CONTAINER                   =
    EXCEPTIONS
      OTHERS                      = 4.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* ok-code field = GD_OKCODE
  CALL SCREEN '0100'.


END-OF-SELECTION.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'STATUS_0100'.
*  SET TITLEBAR 'xxx'.


ENDMODULE.                 " STATUS_0100  OUTPUT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

  go_grid-&amp;gt;check_changed_data( ).




  CASE gd_okcode.
    WHEN 'BACK'  OR
         'EXIT'  OR
         'CANC'.
      SET SCREEN 0. LEAVE SCREEN.



    WHEN 'REFRESH'.
      CALL METHOD go_grid-&amp;gt;refresh_table_display
*        EXPORTING
*          is_stable      =
*          i_soft_refresh =
*        EXCEPTIONS
*          finished       = 1
*          others         = 2
              .
      IF sy-subrc &amp;lt;&amp;gt; 0.
*       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.


    WHEN OTHERS.
      PERFORM get_selected_rows.
  ENDCASE.

  CLEAR: gd_okcode.

ENDMODULE.                 " USER_COMMAND_0100  INPUT


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_FIELDCATALOG
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM build_fieldcatalog .
* define local data
  DATA:
    ls_fcat        TYPE lvc_s_fcat.

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
*     I_BUFFER_ACTIVE              =
      i_structure_name             = gc_tabname
*     I_CLIENT_NEVER_DISPLAY       = 'X'
*     I_BYPASSING_BUFFER           =
*     I_INTERNAL_TABNAME           =
    CHANGING
      ct_fieldcat                  = gt_fcat
    EXCEPTIONS
      inconsistent_interface       = 1
      program_error                = 2
      OTHERS                       = 3.
  IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  ls_fcat-edit = abap_true.
  MODIFY gt_fcat FROM ls_fcat
      TRANSPORTING edit
    WHERE ( key NE abap_true ).

ENDFORM.                    " BUILD_FIELDCATALOG


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  SET_LAYOUT_AND_VARIANT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM set_layout_and_variant .

  CLEAR: gs_layout,
         gs_variant.

  gs_layout-cwidth_opt = abap_true.
  gs_layout-zebra      = abap_true.
*

  gs_variant-report = syst-repid.
  gs_variant-handle = 'GRID'.

ENDFORM.                    " SET_LAYOUT_AND_VARIANT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  GET_SELECTED_ROWS
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM get_selected_rows .
* define local data
  DATA: lt_rows   TYPE lvc_t_row,
        ls_row    TYPE lvc_s_row,
        ls_outtab TYPE ty_s_outtab,
        lt_outtab TYPE ty_t_outtab.


  CALL METHOD go_grid-&amp;gt;get_selected_rows
    IMPORTING
      et_index_rows = lt_rows
*        et_row_no     =
      .

  LOOP AT lt_rows INTO ls_row.
    READ TABLE gt_outtab INTO ls_outtab INDEX ls_row-index.
    APPEND ls_outtab TO lt_outtab.
  ENDLOOP.

  IF ( lt_outtab IS INITIAL ).
    MESSAGE 'No rows selected'  TYPE 'I'.
  ELSE.
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
      EXPORTING
        i_title                       = 'Selected Rows'
*       I_SELECTION                   = 'X'
        i_allow_no_selection          = 'X'
        i_zebra                       = 'X'
        i_tabname                     = 'KNB1'
        i_structure_name              = 'KNB1'
      TABLES
        t_outtab                      = lt_outtab
      EXCEPTIONS
        program_error                 = 1
        OTHERS                        = 2.
    IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  ENDIF.



ENDFORM.                    " GET_SELECTED_ROWS
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 21:57:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538811#M851389</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-03-31T21:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538812#M851390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try this code if required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ygrid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE &amp;lt;icon&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_receiver DEFINITION DEFERRED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ok_code LIKE sy-ucomm,&lt;/P&gt;&lt;P&gt;      gt_vbak TYPE TABLE OF vbak,&lt;/P&gt;&lt;P&gt;      gt_vbap TYPE TABLE OF vbap,&lt;/P&gt;&lt;P&gt;      g_repid LIKE sy-repid,&lt;/P&gt;&lt;P&gt;      g_max TYPE i VALUE 100,&lt;/P&gt;&lt;P&gt;      gs_layout   TYPE lvc_s_layo,&lt;/P&gt;&lt;P&gt;      cont_on_main   TYPE scrfname VALUE 'BCALVGRID_CUSTOM1',&lt;/P&gt;&lt;P&gt;      cont_on_dialog TYPE scrfname VALUE 'BCALVGRID_CUSTOM2',&lt;/P&gt;&lt;P&gt;      grid1  TYPE REF TO cl_gui_alv_grid,&lt;/P&gt;&lt;P&gt;      grid2  TYPE REF TO cl_gui_alv_grid,&lt;/P&gt;&lt;P&gt;      custom_container1 TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;      custom_container2 TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;      event_receiver TYPE REF TO lcl_event_receiver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET SCREEN 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS lcl_event_receiver DEFINITION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_receiver DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;    handle_toolbar&lt;/P&gt;&lt;P&gt;        FOR EVENT toolbar OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;            IMPORTING e_object e_interactive,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    handle_user_command&lt;/P&gt;&lt;P&gt;        FOR EVENT user_command OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;            IMPORTING e_ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_event_receiver DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS lcl_event_receiver IMPLEMENTATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_receiver IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_toolbar.&lt;/P&gt;&lt;P&gt;    DATA: ls_toolbar  TYPE stb_button.&lt;/P&gt;&lt;P&gt;    CLEAR ls_toolbar.&lt;/P&gt;&lt;P&gt;    MOVE 3 TO ls_toolbar-butn_type.&lt;/P&gt;&lt;P&gt;    APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;    CLEAR ls_toolbar.&lt;/P&gt;&lt;P&gt;    MOVE 'ITEMS' TO ls_toolbar-function.&lt;/P&gt;&lt;P&gt;    MOVE icon_employee TO ls_toolbar-icon.&lt;/P&gt;&lt;P&gt;    MOVE 'SHOW  DETAILS'(111) TO ls_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    MOVE 'Detail'(112) TO ls_toolbar-text.&lt;/P&gt;&lt;P&gt;    MOVE ' ' TO ls_toolbar-disabled.&lt;/P&gt;&lt;P&gt;    APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_toolbar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_user_command.&lt;/P&gt;&lt;P&gt;    DATA: lt_rows TYPE lvc_t_row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CASE e_ucomm.&lt;/P&gt;&lt;P&gt;      WHEN 'ITEMS'.&lt;/P&gt;&lt;P&gt;        CALL METHOD grid1-&amp;gt;get_selected_rows&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;            et_index_rows = lt_rows.&lt;/P&gt;&lt;P&gt;        CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;        IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;          CALL FUNCTION 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;              titel = g_repid&lt;/P&gt;&lt;P&gt;              txt2  = sy-subrc&lt;/P&gt;&lt;P&gt;              txt1  = 'Error in Flush'.&lt;/P&gt;&lt;P&gt;        ELSE.&lt;/P&gt;&lt;P&gt;          PERFORM show_items TABLES lt_rows.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_user_command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION&lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'CUSTOM100'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SET TITLEBAR 'xxx'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  g_repid = sy-repid.&lt;/P&gt;&lt;P&gt;  IF custom_container1 IS INITIAL.&lt;/P&gt;&lt;P&gt;    PERFORM select_table_vbak CHANGING gt_vbak.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT custom_container1&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = cont_on_main&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        OTHERS                      = 6.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          titel = g_repid&lt;/P&gt;&lt;P&gt;          txt1  = 'The control could not be created'&lt;/P&gt;&lt;P&gt;          txt2  = sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CREATE OBJECT grid1&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_parent = custom_container1.&lt;/P&gt;&lt;P&gt;    gs_layout-grid_title = 'SALES HEADER'.&lt;/P&gt;&lt;P&gt;    gs_layout-sel_mode = 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD grid1-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_structure_name = 'VBAK'&lt;/P&gt;&lt;P&gt;        is_layout        = gs_layout&lt;/P&gt;&lt;P&gt;      CHANGING&lt;/P&gt;&lt;P&gt;        it_outtab        = gt_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CREATE OBJECT event_receiver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CREATE OBJECT event_receiver.&lt;/P&gt;&lt;P&gt;    SET HANDLER event_receiver-&amp;gt;handle_user_command FOR grid1.&lt;/P&gt;&lt;P&gt;    SET HANDLER event_receiver-&amp;gt;handle_toolbar FOR grid1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD grid1-&amp;gt;set_toolbar_interactive&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_control=&amp;gt;set_focus&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      control = grid1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module USER_COMMAND_0100 input.&lt;/P&gt;&lt;P&gt;CASE ok_code.&lt;/P&gt;&lt;P&gt;    WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;      PERFORM exit_program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;  CLEAR ok_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmodule.     &lt;/P&gt;&lt;P&gt;form exit_program .&lt;/P&gt;&lt;P&gt; CALL METHOD custom_container1-&amp;gt;free.&lt;/P&gt;&lt;P&gt;  IF not custom_container2 is initial.&lt;/P&gt;&lt;P&gt;    CALL METHOD custom_container2-&amp;gt;free.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;       titel         = g_repid&lt;/P&gt;&lt;P&gt;       txt1          = 'Error in Flush'&lt;/P&gt;&lt;P&gt;       txt2          = sy-subrc&lt;/P&gt;&lt;P&gt;             .&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;MODULE status_0101 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SET PF-STATUS 'xxxxxxxx'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SET TITLEBAR 'xxx'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF custom_container2 IS INITIAL.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT custom_container2&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = cont_on_dialog&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        OTHERS                      = 6.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          titel = g_repid&lt;/P&gt;&lt;P&gt;          txt1  = 'The control could not be created'(510)&lt;/P&gt;&lt;P&gt;          txt2  = sy-subrc.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT grid2&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_parent = custom_container2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    gs_layout-grid_title = 'ITEM DETAILS'(101).&lt;/P&gt;&lt;P&gt;    gs_layout-sel_mode = ' '.&lt;/P&gt;&lt;P&gt;    CALL METHOD grid2-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_structure_name = 'VBAP'&lt;/P&gt;&lt;P&gt;        is_layout        = gs_layout&lt;/P&gt;&lt;P&gt;      CHANGING&lt;/P&gt;&lt;P&gt;        it_outtab        = gt_vbap.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    CALL METHOD grid2-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_control=&amp;gt;set_focus&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      control = grid2.&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;add your handling, for example&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL FUNCTION 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        titel = g_repid&lt;/P&gt;&lt;P&gt;        txt2  = sy-subrc&lt;/P&gt;&lt;P&gt;        txt1  = 'Error in Flush'(500).&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0101  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module USER_COMMAND_0101 input.&lt;/P&gt;&lt;P&gt;CASE ok_code.&lt;/P&gt;&lt;P&gt;    WHEN 'RETURN'.&lt;/P&gt;&lt;P&gt;      LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;  CLEAR ok_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmodule.                 " USER_COMMAND_0101  INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM select_table_vbak  CHANGING p_gt_vbak LIKE gt_vbak[].&lt;/P&gt;&lt;P&gt;  SELECT * FROM vbak INTO TABLE p_gt_vbak UP TO g_max ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " select_table_VBAK&lt;/P&gt;&lt;P&gt;FORM show_items  TABLES   p_et_rows STRUCTURE lvc_s_row.&lt;/P&gt;&lt;P&gt;  DATA: ls_selected_line LIKE lvc_s_row,&lt;/P&gt;&lt;P&gt;          lf_row_index TYPE lvc_index,&lt;/P&gt;&lt;P&gt;          ls_vbak LIKE LINE OF gt_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLEAR gt_vbap[].&lt;/P&gt;&lt;P&gt;  LOOP AT p_et_rows INTO ls_selected_line.&lt;/P&gt;&lt;P&gt;    lf_row_index = ls_selected_line-index.&lt;/P&gt;&lt;P&gt;    READ TABLE gt_vbak INDEX lf_row_index INTO ls_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM select_table_vbap USING ls_vbak&lt;/P&gt;&lt;P&gt;                               CHANGING gt_vbap.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call dialog screen and display new alv control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL SCREEN 101 STARTING AT 10 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " show_ITEMS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2008 12:18:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538812#M851390</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-25T12:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538813#M851391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Badhri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yesterday I had the same problem. Looking into this forum didn't helped me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But today I figured out a simple but logical probelm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you create your objects for alv grid?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Olaf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...Sometimes you don't see abap, because of to much abap in front of you...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 08:39:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538813#M851391</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-26T08:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538814#M851392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Badhri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yesterday I had the same problem. Looking into this forum didn't helped me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But today I figured it out with an example report from sap (BCALV_EDIT_05) . It is a simple but logical problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you create your objects for alv grid? You can see the correct object generation in the coding of  Mani Nandiwada who first checks if a container is initial and creates the object only if this is the case (look for: IF custom_container2 IS INITIAL.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Olaf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Olaf Bahrenburg on Sep 26, 2008 10:49 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 08:48:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538814#M851392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-26T08:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: method get_selected_rows not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538815#M851393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Badri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If get_selected_rows remains empty after the second selection than the problem can be the missing call of &lt;EM&gt;CL_GUI_ALV_GRID&lt;/EM&gt;&amp;gt;-&amp;gt;&lt;EM&gt;refresh_table_display &lt;/EM&gt;in your PBO.&lt;/P&gt;&lt;P&gt;In this case in your PBO you have explicit call refresh_table_display it is not enough to call once set_table_for_first_display...I guess that's why you don't get the selected rows or cells.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards:&lt;/P&gt;&lt;P&gt;Szilard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Sep 2012 00:08:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-get-selected-rows-not-working/m-p/3538815#M851393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-29T00:08:21Z</dc:date>
    </item>
  </channel>
</rss>

