<?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: Making only particular cell of ALV editable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604870#M1085271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uday,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was just going through your thread.&lt;/P&gt;&lt;P&gt;If you have the code working could you please post it if you don't mind&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranjith N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Oct 2008 07:14:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-18T07:14:19Z</dc:date>
    <item>
      <title>Making only particular cell of ALV editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604867#M1085268</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 have a requirement where when the user clicks on an insert button a blank row should get appended to the ALV and only 1 of the cells in this row should be in editable mode. (Also the other rows of the ALV should be in display mode) I tried coding using the LVC_T_STYL properties but I come up with a screen of all non-editable rows. Please help suggest where I am going wrong. My coding is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My internal table is defined as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF it_mara OCCURS 1.
           INCLUDE STRUCTURE mara.
DATA:   cellstyles TYPE lvc_t_styl,
             END OF it_mara.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My other important attribute definitions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:   ls_cellstyles TYPE lvc_s_styl,
          ls_layout TYPE lvc_s_layo,&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the PAI event for handling the INSERT button I have coded as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHEN 'INSERT'.
      APPEND wa_mara TO it_mara. " Appending a blank row to ALV
      DESCRIBE TABLE it_mara LINES lv_count.
      read table it_mara index lv_count. 
      ls_cellstyles-fieldname = 'MATNR'.
      ls_cellstyles-style = cl_gui_alv_grid=&amp;gt;mc_style_enabled. " Setting only MATNR field of the appended row as enabled
      insert ls_cellstyles into table it_mara-cellstyles.

      MODIFY it_mara INDEX lv_count transporting cellstyles.
      o_grid-&amp;gt;refresh_table_display( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am also assigning cellstyles to the stylefname attribute of the layout &amp;amp; passing it to the SET_TABLE_FOR_FIRST_DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Uday&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 08:33:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604867#M1085268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-15T08:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Making only particular cell of ALV editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604868#M1085269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was wondering whether I might be going wrong somewhere so I tried setting the style property to cl_gui_alv_grid=&amp;gt;mc_style_button instead of the cl_gui_alv_grid=&amp;gt;mc_style_enabled. The program then comes up with the pushbutton being displayed in the lone specified cell. This confuses me as to why it doesnt work for making the cell editable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Uday&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 09:36:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604868#M1085269</guid>
      <dc:creator>uday_gubbala2</dc:creator>
      <dc:date>2008-10-15T09:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Making only particular cell of ALV editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604869#M1085270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi People,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for my mistake. I had forgot to call the set_ready_for_input method. I just had to call it &amp;amp; the codes working fine now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Uday&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      o_grid-&amp;gt;set_ready_for_input( exporting I_READY_FOR_INPUT = '1' ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 09:58:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604869#M1085270</guid>
      <dc:creator>uday_gubbala2</dc:creator>
      <dc:date>2008-10-15T09:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Making only particular cell of ALV editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604870#M1085271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uday,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was just going through your thread.&lt;/P&gt;&lt;P&gt;If you have the code working could you please post it if you don't mind&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranjith N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2008 07:14:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604870#M1085271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-18T07:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Making only particular cell of ALV editable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604871#M1085272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ranjith,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the coding as below. You need to create a screen 100 and place a custom control with name O_CONT &amp;amp; a pushbutton with the function code as INSERT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Uday&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  Z187442_OOALV5
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

REPORT  z187442_ooalv5 NO STANDARD PAGE HEADING.

DATA: BEGIN OF it_mara OCCURS 1.
        INCLUDE STRUCTURE mara.
DATA:   cellstyles TYPE lvc_t_styl,
       END OF it_mara.

DATA: it_fcat TYPE lvc_t_fcat,
      wa_fcat TYPE lvc_s_fcat,
      wa_mara LIKE LINE OF it_mara,
      o_cont TYPE REF TO cl_gui_custom_container,
      o_grid TYPE REF TO cl_gui_alv_grid,
      ls_cellstyles TYPE lvc_s_styl,
      ls_layout TYPE lvc_s_layo,
      okcode(20).


START-OF-SELECTION.
  PERFORM build_fcat.
  PERFORM build_layout.
  PERFORM build_mara_data.
  CALL SCREEN 100.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'Z187442_OOALV4'.
  IF o_cont IS INITIAL.

    CREATE OBJECT o_cont
      EXPORTING
        container_name = 'O_CONT'.

    CREATE OBJECT o_grid
      EXPORTING
        i_parent = o_cont.

    CALL METHOD o_grid-&amp;gt;set_table_for_first_display
      EXPORTING
        is_layout       = ls_layout
      CHANGING
        it_outtab       = it_mara[]
        it_fieldcatalog = it_fcat.
  ELSE.
    o_grid-&amp;gt;refresh_table_display( ).
  ENDIF.

ENDMODULE.                 " STATUS_0100  OUTPUT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
  DATA lv_count TYPE i VALUE 0.
  CASE okcode.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
      LEAVE PROGRAM.
    WHEN 'INSERT'.
      APPEND wa_mara TO it_mara.
      DESCRIBE TABLE it_mara LINES lv_count.
      READ TABLE it_mara INDEX lv_count.
      ls_cellstyles-fieldname = 'MATNR'.
      ls_cellstyles-style = cl_gui_alv_grid=&amp;gt;mc_style_enabled.
      INSERT ls_cellstyles INTO TABLE it_mara-cellstyles.

      MODIFY it_mara INDEX lv_count TRANSPORTING cellstyles.
      o_grid-&amp;gt;set_ready_for_input( exporting I_READY_FOR_INPUT = '1' ).
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_FCAT
*&amp;amp;---------------------------------------------------------------------*
FORM build_fcat .
  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name = 'MARA'
    CHANGING
      ct_fieldcat      = it_fcat.
ENDFORM.                    " BUILD_FCAT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_MARA_DATA
*&amp;amp;---------------------------------------------------------------------*
FORM build_mara_data .
  SELECT * FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara UP TO 10 ROWS.
ENDFORM.                    " BUILD_MARA_DATA

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_LAYOUT
*&amp;amp;---------------------------------------------------------------------*
FORM build_layout .
  ls_layout-stylefname = 'CELLSTYLES'.
ENDFORM.                    " BUILD_LAYOUT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2008 05:26:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/making-only-particular-cell-of-alv-editable/m-p/4604871#M1085272</guid>
      <dc:creator>uday_gubbala2</dc:creator>
      <dc:date>2008-10-20T05:26:18Z</dc:date>
    </item>
  </channel>
</rss>

