<?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: Toggle edit functionality of ALV Grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/toggle-edit-functionality-of-alv-grid/m-p/1300314#M158214</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Check this Program .&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ata: ok_code like sy-ucomm,
      save_ok like sy-ucomm,
      g_container type scrfname value 'BCALV_GRID_DEMO_0100_CONT1',
      g_grid  type ref to cl_gui_alv_grid,
      g_custom_container type ref to cl_gui_custom_container,
      gs_layout type lvc_s_layo,
      g_max type i value 100.

data: gt_outtab type table of sflight.

*---------------------------------------------------------------------*
*       MAIN                                                          *
*---------------------------------------------------------------------*
call screen 100 starting at 1 1..

*---------------------------------------------------------------------*
*       MODULE PBO OUTPUT                                             *
*---------------------------------------------------------------------*
module pbo output.
  set pf-status 'MAIN100'.
  set titlebar 'MAIN100'.
  if g_custom_container is initial.
    create object g_custom_container
           exporting container_name = g_container.
    create object g_grid
           exporting i_parent = g_custom_container.
*§1.Set status of all cells to editable using the layout structure.
    gs_layout-edit = 'X'.

    select * from sflight into table gt_outtab up to g_max rows.

    call method g_grid-&amp;gt;set_table_for_first_display
         exporting i_structure_name = 'SFLIGHT'
                   is_layout        = gs_layout
         changing  it_outtab        = gt_outtab.
*§2.Use SET_READY_FOR_INPUT to allow editing initially.
*   (state "editable and ready for input").
    call method g_grid-&amp;gt;set_ready_for_input
          exporting i_ready_for_input = 1.

  endif.
endmodule.
*---------------------------------------------------------------------*
*       MODULE PAI INPUT                                              *
*---------------------------------------------------------------------*
module pai input.
  save_ok = ok_code.
  clear ok_code.
  case save_ok.
    when 'EXIT'.
      perform exit_program.
    when 'SWITCH'.
      perform switch_edit_mode.
    when others.
*     do nothing
  endcase.
endmodule.
*---------------------------------------------------------------------*
*       FORM EXIT_PROGRAM                                             *
*---------------------------------------------------------------------*
form exit_program.
  leave program.
endform.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  SWITCH_EDIT_MODE
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form switch_edit_mode.
*§3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
  if g_grid-&amp;gt;is_ready_for_input( ) eq 0.
*§4.Use SET_READY_FOR_INPUT to switch between the substates.
    call method g_grid-&amp;gt;set_ready_for_input
                     exporting i_ready_for_input = 1.
  else.
    call method g_grid-&amp;gt;set_ready_for_input
                     exporting i_ready_for_input = 0.
  endif.
endform.                               " SWITCH_EDIT_MODE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information check the standard programs :BCALV_EDIT_*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghav&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jun 2006 07:49:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-08T07:49:45Z</dc:date>
    <item>
      <title>Toggle edit functionality of ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/toggle-edit-functionality-of-alv-grid/m-p/1300313#M158213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an ALV Grid on my Dynpro with a self-defined button and event handling. Now I want to change the "display&amp;lt;-&amp;gt;edit" mode of the ALV with this button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 07:44:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/toggle-edit-functionality-of-alv-grid/m-p/1300313#M158213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-08T07:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Toggle edit functionality of ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/toggle-edit-functionality-of-alv-grid/m-p/1300314#M158214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Check this Program .&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ata: ok_code like sy-ucomm,
      save_ok like sy-ucomm,
      g_container type scrfname value 'BCALV_GRID_DEMO_0100_CONT1',
      g_grid  type ref to cl_gui_alv_grid,
      g_custom_container type ref to cl_gui_custom_container,
      gs_layout type lvc_s_layo,
      g_max type i value 100.

data: gt_outtab type table of sflight.

*---------------------------------------------------------------------*
*       MAIN                                                          *
*---------------------------------------------------------------------*
call screen 100 starting at 1 1..

*---------------------------------------------------------------------*
*       MODULE PBO OUTPUT                                             *
*---------------------------------------------------------------------*
module pbo output.
  set pf-status 'MAIN100'.
  set titlebar 'MAIN100'.
  if g_custom_container is initial.
    create object g_custom_container
           exporting container_name = g_container.
    create object g_grid
           exporting i_parent = g_custom_container.
*§1.Set status of all cells to editable using the layout structure.
    gs_layout-edit = 'X'.

    select * from sflight into table gt_outtab up to g_max rows.

    call method g_grid-&amp;gt;set_table_for_first_display
         exporting i_structure_name = 'SFLIGHT'
                   is_layout        = gs_layout
         changing  it_outtab        = gt_outtab.
*§2.Use SET_READY_FOR_INPUT to allow editing initially.
*   (state "editable and ready for input").
    call method g_grid-&amp;gt;set_ready_for_input
          exporting i_ready_for_input = 1.

  endif.
endmodule.
*---------------------------------------------------------------------*
*       MODULE PAI INPUT                                              *
*---------------------------------------------------------------------*
module pai input.
  save_ok = ok_code.
  clear ok_code.
  case save_ok.
    when 'EXIT'.
      perform exit_program.
    when 'SWITCH'.
      perform switch_edit_mode.
    when others.
*     do nothing
  endcase.
endmodule.
*---------------------------------------------------------------------*
*       FORM EXIT_PROGRAM                                             *
*---------------------------------------------------------------------*
form exit_program.
  leave program.
endform.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  SWITCH_EDIT_MODE
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form switch_edit_mode.
*§3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
  if g_grid-&amp;gt;is_ready_for_input( ) eq 0.
*§4.Use SET_READY_FOR_INPUT to switch between the substates.
    call method g_grid-&amp;gt;set_ready_for_input
                     exporting i_ready_for_input = 1.
  else.
    call method g_grid-&amp;gt;set_ready_for_input
                     exporting i_ready_for_input = 0.
  endif.
endform.                               " SWITCH_EDIT_MODE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information check the standard programs :BCALV_EDIT_*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghav&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 07:49:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/toggle-edit-functionality-of-alv-grid/m-p/1300314#M158214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-08T07:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Toggle edit functionality of ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/toggle-edit-functionality-of-alv-grid/m-p/1300315#M158215</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 demo program &amp;lt;b&amp;gt;BCALV_EDIT_02&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 07:49:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/toggle-edit-functionality-of-alv-grid/m-p/1300315#M158215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-08T07:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Toggle edit functionality of ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/toggle-edit-functionality-of-alv-grid/m-p/1300316#M158216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thx a lot for your helpful answers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 07:56:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/toggle-edit-functionality-of-alv-grid/m-p/1300316#M158216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-08T07:56:58Z</dc:date>
    </item>
  </channel>
</rss>

