<?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: Object ALV Grid - Line selection in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-alv-grid-line-selection/m-p/2390476#M531496</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;check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    call method grid1-&amp;gt;set_table_for_first_display
      exporting
        is_layout                     = gs_layout
        is_variant                    = gs_variant
        i_save                        = v_save
        i_default                     = v_default
        it_toolbar_excluding          = i_exclude[]
      changing
        it_outtab                     = i_output[]
        it_fieldcatalog               = i_fieldcat[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
    if sy-subrc ne 0.
      message id sy-msgid type sy-msgty number sy-msgno
                  with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.

    call method grid1-&amp;gt;refresh_table_display.

* Creating object for the single clickevents
    if event_receiver_grid is initial.
      create object event_receiver_grid.
    endif.
    set handler event_receiver_grid-&amp;gt;handle_toolbar_200 for grid1.
    call method grid1-&amp;gt;set_toolbar_interactive.
    set handler event_receiver_grid-&amp;gt;user_command_200 for grid1.



module user_command_0200 input.
  call method cl_gui_cfw=&amp;gt;dispatch.
  case ok_code.
    when c_ddno.
      perform f__display.
    when c_exit.
      perform f_exit_program.
    when c_back.
      perform f_exit_program.
    when c_canc.
      perform f_exit_program.
    when others.
  endcase.
  clear ok_code.
endmodule.                               " User_command_0200 INPUT

form f_display.
  refresh: i_sel_alvrows,
           i_dblclk.
  clear :  i_sel_alvrows,
           i_dblclk,
           wa_dblclk.
  v_dbcnt = c_0.
  call method grid1-&amp;gt;get_selected_rows
    importing
      et_index_rows = i_sel_alvrows[].
  call method cl_gui_cfw=&amp;gt;flush.
  describe table i_sel_alvrows lines v_dbcnt.

  if i_sel_alvrows[] is initial.
    message i176.
  endif.
  if v_dbcnt gt 1.
    message i177.         " You cannot select more that one row
  else.
    loop at i_sel_alvrows into wa_sel_alvrows.
      read table i_output into wa_output index wa_sel_alvrows-index.
      if sy-subrc eq c_0.
        move-corresponding wa_output to wa_dblclk.
        append wa_dblclk to i_dblclk.
        clear: wa_dblclk.
      endif.
    endloop.
  endif.
endform.                                  
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jun 2007 16:30:31 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2007-06-19T16:30:31Z</dc:date>
    <item>
      <title>Object ALV Grid - Line selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-alv-grid-line-selection/m-p/2390475#M531495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to force my grid to have allways a selected line.&lt;/P&gt;&lt;P&gt;If possible I would like to see the row marker and I don't want users to be able to select more than one line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried all layout sel_mode... but I didn't find the result I desire...&lt;/P&gt;&lt;P&gt;Do you have an idea ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 11:13:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-alv-grid-line-selection/m-p/2390475#M531495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T11:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Object ALV Grid - Line selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-alv-grid-line-selection/m-p/2390476#M531496</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;check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    call method grid1-&amp;gt;set_table_for_first_display
      exporting
        is_layout                     = gs_layout
        is_variant                    = gs_variant
        i_save                        = v_save
        i_default                     = v_default
        it_toolbar_excluding          = i_exclude[]
      changing
        it_outtab                     = i_output[]
        it_fieldcatalog               = i_fieldcat[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
    if sy-subrc ne 0.
      message id sy-msgid type sy-msgty number sy-msgno
                  with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.

    call method grid1-&amp;gt;refresh_table_display.

* Creating object for the single clickevents
    if event_receiver_grid is initial.
      create object event_receiver_grid.
    endif.
    set handler event_receiver_grid-&amp;gt;handle_toolbar_200 for grid1.
    call method grid1-&amp;gt;set_toolbar_interactive.
    set handler event_receiver_grid-&amp;gt;user_command_200 for grid1.



module user_command_0200 input.
  call method cl_gui_cfw=&amp;gt;dispatch.
  case ok_code.
    when c_ddno.
      perform f__display.
    when c_exit.
      perform f_exit_program.
    when c_back.
      perform f_exit_program.
    when c_canc.
      perform f_exit_program.
    when others.
  endcase.
  clear ok_code.
endmodule.                               " User_command_0200 INPUT

form f_display.
  refresh: i_sel_alvrows,
           i_dblclk.
  clear :  i_sel_alvrows,
           i_dblclk,
           wa_dblclk.
  v_dbcnt = c_0.
  call method grid1-&amp;gt;get_selected_rows
    importing
      et_index_rows = i_sel_alvrows[].
  call method cl_gui_cfw=&amp;gt;flush.
  describe table i_sel_alvrows lines v_dbcnt.

  if i_sel_alvrows[] is initial.
    message i176.
  endif.
  if v_dbcnt gt 1.
    message i177.         " You cannot select more that one row
  else.
    loop at i_sel_alvrows into wa_sel_alvrows.
      read table i_output into wa_output index wa_sel_alvrows-index.
      if sy-subrc eq c_0.
        move-corresponding wa_output to wa_dblclk.
        append wa_dblclk to i_dblclk.
        clear: wa_dblclk.
      endif.
    endloop.
  endif.
endform.                                  
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 16:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-alv-grid-line-selection/m-p/2390476#M531496</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-06-19T16:30:31Z</dc:date>
    </item>
  </channel>
</rss>

