<?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: OOPS Alv grid: editable individaul fields or editable rows in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403073#M1046535</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;remove the following code..this will enable all the columns open for input..&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;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Aug 2008 20:54:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-28T20:54:15Z</dc:date>
    <item>
      <title>OOPS Alv grid: editable individaul fields or editable rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403072#M1046534</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 did the same thing, what you mentioned here except method name -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have used - mc_style_disabled since i need to disable in alv for certain field values and others should be enable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure where exactly i am doing wrong. As you said i did everything... apart from that do i need to do anything else...please suggest me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(     gw_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled.)&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------" /&gt;&lt;P&gt;Orrginal messge - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is possible in Class ALV (OOPS).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa.&lt;/P&gt;&lt;P&gt;IF wa-field1 = 'X'. "condition&lt;/P&gt;&lt;P&gt;wa_stylerow-fieldname = 'FIELD1'.&lt;/P&gt;&lt;P&gt;wa_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_enabled.&lt;/P&gt;&lt;P&gt;APPEND wa_stylerow TO wa-it_styletab.&lt;/P&gt;&lt;P&gt;CLEAR wa_stylerow.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;MODIFY itab FROM wa&lt;/P&gt;&lt;P&gt;TRANSPORTING it_styletab.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB is the output internal table. Along with the output fields, declare additional field it_styletab of type lvc_t_styl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after calling the method SET_TABLE_FOR_FIRST_DISPLAY, call another method,&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;Again refresh the grid using REFRESH_TABLE_DISPLAY method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set layout attribute gs_layout-stylefname = 'IT_STYLETAB'.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshmi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Santhanalakshmi V on Jun 18, 2008 6:15 PM&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 20:50:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403072#M1046534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T20:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS Alv grid: editable individaul fields or editable rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403073#M1046535</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;remove the following code..this will enable all the columns open for input..&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;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 20:54:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403073#M1046535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T20:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS Alv grid: editable individaul fields or editable rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403074#M1046536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Naren, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I have commented out but no use... even no change in the layout.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 20:58:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403074#M1046536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T20:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS Alv grid: editable individaul fields or editable rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403075#M1046537</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;Sorry for the confusion...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this sample code..in that first row I have disabled the werks column..second row it will be enabled..it is working fine for me..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: g_container TYPE scrfname VALUE 'CONTAINER1',
      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.

DATA: BEGIN OF wa,
       matnr TYPE matnr,
       werks TYPE werks,
       t_style TYPE lvc_t_styl,
      END OF wa,
      gt_outtab LIKE TABLE OF wa,
      t_style TYPE lvc_t_styl,
      s_style TYPE lvc_s_styl.

*---------------------------------------------------------------------*
*       MAIN                                                          *
*---------------------------------------------------------------------*


* Prepare dummy data. row 1 disable WERKS.
wa-matnr = 'test'.
wa-werks = '1000'.

s_style-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled.
s_style-fieldname = 'WERKS'.
APPEND s_style TO t_style.

wa-t_style = t_style.
APPEND wa TO gt_outtab.
CLEAR: t_style.

* Prepare dummy data. row 2 enable werks.
wa-matnr = 'test'.
wa-werks = '1000'.

wa-t_style = t_style.
APPEND wa TO gt_outtab.
CLEAR: t_style.



CALL SCREEN 100.

*---------------------------------------------------------------------*
*       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.

    gs_layout-stylefname = 'T_STYLE'.
    gs_layout-edit = 'X'.

    CALL METHOD g_grid-&amp;gt;set_table_for_first_display
      EXPORTING
        i_structure_name = 'WFCS_MARC_KEY'
        is_layout = gs_layout
      CHANGING
        it_outtab = gt_outtab.

  ENDIF.
ENDMODULE.                    "pbo OUTPUT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 21:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403075#M1046537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T21:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS Alv grid: editable individaul fields or editable rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403076#M1046538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the below code, in this i am disabling the sixth row , you can conditionally disable enable the columns. just take the Disable/enable logic from this code. i am using the LVC function , the same works in case of Class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ztest_edit.

TYPE-POOLS: slis.
*- Fieldcatalog
DATA: it_fieldcat TYPE lvc_t_fcat.
DATA: x_fieldcat TYPE lvc_s_fcat.
DATA: x_layout TYPE lvc_s_layo.
"{ FOR DISABLE
DATA: ls_edit TYPE lvc_s_styl,
lt_edit TYPE lvc_t_styl.
"} FOR DISABLE
DATA: BEGIN OF it_vbap OCCURS 0,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
check(1),
style TYPE lvc_t_styl, "FOR DISABLE
END OF it_vbap.
DATA: ls_outtab LIKE LINE OF it_vbap.
SELECT vbeln
posnr
UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE it_vbap
FROM vbap.

DATA:l_pos TYPE i VALUE 1.
CLEAR: l_pos.
l_pos = l_pos + 1.
x_fieldcat-coltext = 'CHECK'.
x_fieldcat-fieldname = 'CHECK'.
x_fieldcat-tabname = 'IT_VBAP'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-checkbox = 'X'.
x_fieldcat-edit = 'X'.
x_fieldcat-outputlen = '10'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
l_pos = l_pos + 1.
x_fieldcat-coltext = 'VBELN'.
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-tabname = 'IT_VBAP'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-edit = 'X'.
x_fieldcat-outputlen = '10'.
x_fieldcat-ref_field = 'VBELN'.
x_fieldcat-ref_table = 'VBAK'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
l_pos = l_pos + 1.
x_fieldcat-coltext = 'POSNR'.
x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-tabname = 'IT_VBAP'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-edit = 'X'.
x_fieldcat-outputlen = '5'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
l_pos = l_pos + 1.
"{FOR DISABLE HERE 6ROW IS DISABLED
LOOP AT it_vbap.
  CLEAR : lt_edit, ls_edit.
  IF sy-tabix NE 6.
    ls_edit-style = cl_gui_alv_grid=&amp;gt;mc_style_enabled.
  ELSE.
    ls_edit-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled.
  ENDIF.
  ls_edit-fieldname = 'VBELN'.
  ls_edit-style3 = space.
  ls_edit-style4 = space.
  ls_edit-maxlen = 10.
  INSERT ls_edit INTO TABLE lt_edit.
  ls_edit-fieldname = 'CHECK'.
  ls_edit-style3 = space.
  ls_edit-style4 = space.
  ls_edit-maxlen = 5.
  INSERT ls_edit INTO TABLE lt_edit.

  ls_edit-fieldname = 'POSNR'.
  ls_edit-style3 = space.
  ls_edit-style4 = space.
  ls_edit-maxlen = 6.
  INSERT ls_edit INTO TABLE lt_edit.

  INSERT lines of lt_edit INTO TABLE ls_outtab-style.
  MODIFY it_vbap INDEX sy-tabix FROM ls_outtab TRANSPORTING
  style .
  CLEAR ls_outtab.
ENDLOOP.
x_layout-stylefname = 'STYLE'.
x_layout-no_rowmark = 'X'.
"} UP TO HERE
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
  EXPORTING
    i_callback_program = sy-repid
    is_layout_lvc      = x_layout
    it_fieldcat_lvc    = it_fieldcat
  TABLES
    t_outtab           = it_vbap[]
  EXCEPTIONS
    program_error      = 1
    OTHERS             = 2.
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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2008 04:00:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv-grid-editable-individaul-fields-or-editable-rows/m-p/4403076#M1046538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-29T04:00:53Z</dc:date>
    </item>
  </channel>
</rss>

