<?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: Make rows editable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965510#M947116</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ya that I have done already lakshmi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;gs_layout-stylefname = 'CELLSTYLES'.

CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display
      EXPORTING
        i_save                        = 'X'
        is_layout                     = *gs_layout*
        it_toolbar_excluding          = pt_exclude
      CHANGING
        it_outtab                     = i_output[]
        it_fieldcatalog               = i_fldctlg
      EXCEPTIONS
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        OTHERS                        = 4.
    IF sy-subrc &amp;lt;&amp;gt; 0.
*--Exception handling
    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2008 11:30:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-11T11:30:28Z</dc:date>
    <item>
      <title>Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965502#M947108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;CASE e_ucomm .
      WHEN 'CHANGE' .
        CALL METHOD gr_alvgrid-&amp;gt;get_selected_rows
          IMPORTING
            et_row_no = lt_selected_rows.
*        READ TABLE lt_selected_rows INTO ls_selected_row INDEX 1 .
*        IF sy-subrc NE 0 .
*          MESSAGE s000(su) WITH 'Select a row!'(203) .
*        ENDIF .

        LOOP AT lt_selected_rows INTO ls_selected_row.
          READ TABLE i_output INDEX ls_selected_row-row_id TRANSPORTING NO FIELDS.
          IF sy-subrc = 0 .
            ls_stylerow-fieldname = 'MINIMUM' .
            ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_enabled .
            APPEND ls_stylerow TO lt_styletab .
          ENDIF .
          INSERT LINES OF lt_styletab INTO table ls_listrow-cellstyles .
          APPEND ls_listrow to i_output.
        ENDLOOP .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have given the code as above to make by field 'MINIMUM' as editable in my final alv display. But when i execute it its not getting displayed in the editable mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u find th problem and tell me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:32:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965502#M947108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T10:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965503#M947109</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 your fieldcat table for this field. EDIT = 'X' should be there for this particular field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Bujji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:34:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965503#M947109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T10:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965504#M947110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND 'MINIMUM' TO fcode. &lt;/P&gt;&lt;P&gt;SET PF-STATUS 'STATUS_0100' EXCLUDING fcode. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include all buttons you want to exclude into fcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now go to your pf status thru menu painter - right click on application tool bar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select radio button - attributes.&lt;DEL&gt;&amp;gt; display of inactive functions&lt;/DEL&gt;&amp;gt; Select radio button display all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;activate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will display the inactive functions..but in a grayed out mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards ponts if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mustapha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:35:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965504#M947110</guid>
      <dc:creator>MusAbaper</dc:creator>
      <dc:date>2008-06-11T10:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965505#M947111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use method refresh_table_display of grid to refresh the alv with the changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of your code, call this method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:36:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965505#M947111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T10:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965506#M947112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I gave refresh display. But what is happeniong is a new row is getting added at the end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:43:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965506#M947112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T10:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965507#M947113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your code, you have used APPEND for modifying ls_listrow. Instead of APPEND you need to modify i_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT lt_selected_rows INTO ls_selected_row.&lt;/P&gt;&lt;P&gt;          READ TABLE i_output INTO wa_output INDEX ls_selected_row-row_id.&lt;/P&gt;&lt;P&gt;          l_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;          IF sy-subrc = 0 .&lt;/P&gt;&lt;P&gt;            ls_stylerow-fieldname = 'MINIMUM' .&lt;/P&gt;&lt;P&gt;            ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_enabled .&lt;/P&gt;&lt;P&gt;            APPEND ls_stylerow TO lt_styletab .&lt;/P&gt;&lt;P&gt;          ENDIF .&lt;/P&gt;&lt;P&gt;          Append lt_listrow to wa_output-lt_listrow.  "lt_listrow is a field in your output table &lt;/P&gt;&lt;P&gt;          MODIFY i_output FROM wa_output INDEX l_tabix TRANSPORTING lt_listrow.&lt;/P&gt;&lt;P&gt;        ENDLOOP .&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;Lakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:54:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965507#M947113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T10:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965508#M947114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ya i have made the changes.Even then the list comes in display mode. Should i need to change anything to make the MINIMUM as editable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 11:14:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965508#M947114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T11:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965509#M947115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Layout, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_layout-stylefname = 'IT_STYLETAB'. - This should be the field name in your output table for styles. In this case lt_listrow i think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set this and pass layout to Set_table_for_first_display if not done already.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 11:27:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965509#M947115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T11:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965510#M947116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ya that I have done already lakshmi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;gs_layout-stylefname = 'CELLSTYLES'.

CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display
      EXPORTING
        i_save                        = 'X'
        is_layout                     = *gs_layout*
        it_toolbar_excluding          = pt_exclude
      CHANGING
        it_outtab                     = i_output[]
        it_fieldcatalog               = i_fldctlg
      EXCEPTIONS
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        OTHERS                        = 4.
    IF sy-subrc &amp;lt;&amp;gt; 0.
*--Exception handling
    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 11:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965510#M947116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T11:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965511#M947117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Call this method before refresh_table_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD tt_gr_alvgrid-&amp;gt;set_ready_for_input&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;      i_ready_for_input = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 11:35:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965511#M947117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T11:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965512#M947118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I called that method. But what it made is, it deleted all my data in the alv list and is displaying a empty alv list instaed of my data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 12:19:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965512#M947118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T12:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965513#M947119</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;Paste your entire code if problem is not solved yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2008 03:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965513#M947119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-12T03:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965514#M947120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My entire code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS lcl_event_receiver DEFINITION DEFERRED.
DATA event_receiver TYPE REF TO lcl_event_receiver.
*----------------------------------------------------------------------*
*       CLASS lcl_event_receiver DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_event_receiver DEFINITION.

  PUBLIC SECTION.

    METHODS:
    handle_toolbar
        FOR EVENT toolbar OF cl_gui_alv_grid
            IMPORTING e_object e_interactive,

    handle_user_command
        FOR EVENT user_command OF cl_gui_alv_grid
            IMPORTING e_ucomm.

  PRIVATE SECTION.
ENDCLASS.                    "lcl_event_receiver DEFINITION
*----------------------------------------------------------------------*
*       CLASS lcl_event_receiver IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_event_receiver IMPLEMENTATION.

  METHOD handle_toolbar.

    DATA: ls_toolbar TYPE stb_button.
    CLEAR ls_toolbar.

*    MOVE 3 TO ls_toolbar-butn_type.
*    APPEND ls_toolbar TO i_object-&amp;gt;mt_toolbar.
*    CLEAR ls_toolbar.

    MOVE 'CHANGE' TO ls_toolbar-function.                   "#EC NOTEXT
    MOVE icon_change TO ls_toolbar-icon.
    MOVE 'Change rows' TO ls_toolbar-quickinfo.
*    MOVE 'Passenger Info'(201) TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.                        "#EC NOTEXT
    APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.

    MOVE 'DELETE' TO ls_toolbar-function.                   "#EC NOTEXT
    MOVE icon_delete TO ls_toolbar-icon.
    MOVE 'Delete rows' TO ls_toolbar-quickinfo.
*    MOVE 'Passenger Info'(201) TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.                        "#EC NOTEXT
    APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.

    MOVE 'NEW ENTRIES' TO ls_toolbar-function.              "#EC NOTEXT
    MOVE icon_create TO ls_toolbar-icon.
    MOVE 'New records' TO ls_toolbar-quickinfo.
    MOVE 'New Entry'(201) TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.                        "#EC NOTEXT
    APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.

  ENDMETHOD.                    "handle_toolbar

  METHOD handle_user_command.
    DATA lt_selected_rows TYPE lvc_t_roid .
    DATA ls_selected_row TYPE lvc_s_roid .
*    DATA i_ucomm LIKE sy-ucomm.
    DATA ls_listrow LIKE LINE OF i_output .
    DATA ls_stylerow TYPE lvc_s_styl .
    DATA lt_styletab TYPE lvc_t_styl .
    DATA l_index TYPE i.

    CASE e_ucomm .
      WHEN 'CHANGE' .
        CALL METHOD gr_alvgrid-&amp;gt;get_selected_rows
          IMPORTING
            et_row_no = lt_selected_rows.
*        READ TABLE lt_selected_rows INTO ls_selected_row INDEX 1 .
*        IF sy-subrc NE 0 .
*          MESSAGE s000(su) WITH 'Select a row!'(203) .
*        ENDIF .

        LOOP AT lt_selected_rows INTO ls_selected_row.
          l_index = sy-tabix.
          READ TABLE i_output INDEX ls_selected_row-row_id TRANSPORTING NO FIELDS.
          IF sy-subrc = 0 .
            ls_stylerow-fieldname = 'MINIMUM' .
            ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_enabled .
            APPEND ls_stylerow TO lt_styletab .
          ENDIF .
          INSERT LINES OF lt_styletab INTO TABLE ls_listrow-cellstyles .
*          MODIFY i_output FROM wa_output INDEX l_tabix TRANSPORTING lt_listrow
          MODIFY i_output FROM ls_listrow INDEX l_index.
          PERFORM s_input_ready.
          PERFORM s_refresh_display.
        ENDLOOP .

    ENDCASE .
  ENDMETHOD.                    "handle_user_command
ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION

*Building ALV layout
FORM s_build_layout .
  gs_layout-cwidth_opt = c_x.
  gs_layout-zebra = c_x.
  gs_layout-sel_mode = 'D'. "For rows, columns and cells
  gs_layout-grid_title = 'ASSORTMENT LIST'.
*  gs_layout-no_toolbar = 'X'.
  gs_layout-stylefname = 'CELLSTYLES'.
ENDFORM.                    " S_BULID_LAYOUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  S_DISPLAY_ALV
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM ss_display_alv.
  IF gr_alvgrid IS INITIAL .
*----Creating custom container instance
    CREATE OBJECT gr_ccontainer
      EXPORTING
        container_name              = gc_custom_control_name
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.
    IF sy-subrc &amp;lt;&amp;gt; 0.
*--Exception handling
    ENDIF.
*----Creating ALV Grid instance
    CREATE OBJECT gr_alvgrid
      EXPORTING
        i_parent          = gr_ccontainer
      EXCEPTIONS
        error_cntl_create = 1
        error_cntl_init   = 2
        error_cntl_link   = 3
        error_dp_create   = 4
        OTHERS            = 5.
    IF sy-subrc &amp;lt;&amp;gt; 0.
*--Exception handling
    ENDIF.
*----Preparing field catalog.
    PERFORM s_build_fldctlg.
    PERFORM s_status USING rt_extab.
*----Preparing layout structure
    PERFORM s_build_layout.
    PERFORM hide_standard." CHANGING ls_exclude." TYPE ui_functions.
********************************************
    CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display
      EXPORTING
        i_save                        = 'X'
        is_layout                     = gs_layout
        it_toolbar_excluding          = pt_exclude
      CHANGING
        it_outtab                     = i_output[]
        it_fieldcatalog               = i_fldctlg
      EXCEPTIONS
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        OTHERS                        = 4.
    IF sy-subrc &amp;lt;&amp;gt; 0.
*--Exception handling
    ENDIF.
  ELSE .
  ENDIF .
ENDFORM.                    " S_DISPLAY_ALV
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  S_DISPLAY_ALV  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE s_display_alv OUTPUT.
*  SET PF-STATUS 'MAIN100'.
*  SET TITLEBAR 'MAIN100'.
  PERFORM ss_display_alv.
  CREATE OBJECT event_receiver.
  SET HANDLER event_receiver-&amp;gt;handle_user_command FOR gr_alvgrid.
  SET HANDLER event_receiver-&amp;gt;handle_toolbar FOR gr_alvgrid.

  CALL METHOD gr_alvgrid-&amp;gt;set_toolbar_interactive.
ENDMODULE.                 " S_DISPLAY_ALV  OUTPUT
FORM s_refresh_display .
  CALL METHOD gr_alvgrid-&amp;gt;refresh_table_display
*                   EXPORTING
*                     is_stable      =
*                     i_soft_refresh =
    EXCEPTIONS
      finished       = 1
      OTHERS         = 2
          .
  IF sy-subrc &amp;lt;&amp;gt; 0.
  ENDIF.

ENDFORM.                    " S_REFRESH_DISPLAY
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  S_INPUT_READY
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form S_INPUT_READY .
CALL METHOD gr_alvgrid-&amp;gt;set_ready_for_input
  EXPORTING
    i_ready_for_input = 1
    .

endform.                    " S_INPUT_READY&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2008 04:25:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965514#M947120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-12T04:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965515#M947121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still there are some confusions in the code. Change it as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   CASE e_ucomm .
  WHEN 'CHANGE' .
    CALL METHOD gr_alvgrid-&amp;gt;get_selected_rows
      IMPORTING
        et_row_no = lt_selected_rows.
*        READ TABLE lt_selected_rows INTO ls_selected_row INDEX 1 .
*        IF sy-subrc NE 0 .
*          MESSAGE s000(su) WITH 'Select a row!'(203) .
*        ENDIF .

    LOOP AT lt_selected_rows INTO ls_selected_row.
* Refresh tables for each pass
      REFRESH lt_styletab.
*         l_index = sy-tabix. "sy-tabix here will have an index to lt_selected_rows table. You can use ls_selected_row-row_id itself. No need to have index separately.
*          READ TABLE i_output INDEX ls_selected_row-row_id TRANSPORTING NO FIELDS.
* You are not reading any data from i_output into workarea, then how can you modify it later?
      READ TABLE i_output INTO ls_listrow INDEX ls_selected_row-row-id.
      IF sy-subrc = 0 .
        ls_stylerow-fieldname = 'MINIMUM' .
        ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_enabled .
        APPEND ls_stylerow TO lt_styletab .
* Clear workarea
        CLEAR: ls_stylerow.
*  ENDIF
        INSERT lines of lt_styletab INTO TABLE ls_listrow-cellstyles .
*          MODIFY i_output FROM wa_output INDEX l_tabix TRANSPORTING lt_listrow
*          MODIFY i_output FROM ls_listrow INDEX l_index . "l_index is not required
        MODIFY i_output FROM ls_listrow INDEX ls_selected_row-row_id TRANSPORTING cellstyles. 
      ENDIF.
*          PERFORM s_input_ready.
*         PERFORM s_refresh_display.
    ENDLOOP .
    PERFORM s_input_ready.
    PERFORM s_refresh_display.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it should work now. If you have problems, debug and see the structure of i_output at the end of the loop. Structure should be something like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1 field2 field3 field4 minimum cellstyles&lt;/P&gt;&lt;P&gt;10     10     10     10                   filedname  style&lt;/P&gt;&lt;P&gt;                                                MINIMUM enabled&lt;/P&gt;&lt;P&gt;i_output is a deep structure where field cellstyles is again a table with fieldname and style for each row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2008 04:52:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965515#M947121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-12T04:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965516#M947122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok lakshmi i ll do as per u advised.&lt;/P&gt;&lt;P&gt;Lets c wat happens..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2008 07:31:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965516#M947122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-12T07:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Make rows editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965517#M947123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;CALL METHOD gr_alvgrid-&amp;gt;get_selected_rows
    IMPORTING
      et_row_no = lt_selected_rows.
  LOOP AT lt_selected_rows INTO ls_selected_row.
    REFRESH lt_styletab.
    READ TABLE i_output INTO ls_listrow INDEX ls_selected_row-row_id.
    IF sy-subrc = 0 .
      ls_stylerow-fieldname = 'ZZ_ACC_ASSGN'.
      ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled .
      APPEND ls_stylerow TO lt_styletab .
      CLEAR ls_stylerow.
 
      ls_stylerow-fieldname = 'ZZ_DEPT_NAME' .
      ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled .
      APPEND ls_stylerow TO lt_styletab .
      CLEAR ls_stylerow.
 
      ls_stylerow-fieldname = 'ZZ_ROOM_NR' .
      ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled .
      APPEND ls_stylerow TO lt_styletab .
      CLEAR ls_stylerow.
 
      ls_stylerow-fieldname = 'ZZ_LOC' .
      ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled .
      APPEND ls_stylerow TO lt_styletab .
      CLEAR ls_stylerow.
    ENDIF .
    APPEND LINES OF lt_styletab TO ls_listrow-cellstyles.
    MODIFY i_output FROM ls_listrow INDEX ls_selected_row-row_id TRANSPORTING cellstyles.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi I have given the code as above to disable my fields. But I am getting a runtime error as "A line is to be inserted or changed at position 3 in the sorted&lt;/P&gt;&lt;P&gt;internal table (type SORTED_TABLE)&lt;/P&gt;&lt;P&gt;"\PROGRAM=ZIAB_E_03_COPY\FORM=S_DISABLE_FIELDS\DATA=LT_STYLETAB".&lt;/P&gt;&lt;P&gt;In doing so, the sorting sequence - determined by the table key - was&lt;/P&gt;&lt;P&gt;destroyed."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do anybody know wat it is??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Jun 2008 07:11:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-rows-editable/m-p/3965517#M947123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-14T07:11:12Z</dc:date>
    </item>
  </channel>
</rss>

