<?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 ALV Grid Insert in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-insert/m-p/1348479#M175208</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an ALV grid that I am using to maintain a table.  I would like to protect the key fields from update for existing records, but just un-protect them (allow edit) when a new row is inserted.  I used LVC_FIELDCATALOG_MERGE to create my catalog.  I tried allowing edit on the catalog and on the layout but either way I seem to get 'all or nothing' in that I can always edit the field or I cannot even edit it for new lines.  I would have hoped this functionality would have been standard for fieldcatalog merge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,  Vanessa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Apr 2006 16:11:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-28T16:11:33Z</dc:date>
    <item>
      <title>ALV Grid Insert</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-insert/m-p/1348479#M175208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an ALV grid that I am using to maintain a table.  I would like to protect the key fields from update for existing records, but just un-protect them (allow edit) when a new row is inserted.  I used LVC_FIELDCATALOG_MERGE to create my catalog.  I tried allowing edit on the catalog and on the layout but either way I seem to get 'all or nothing' in that I can always edit the field or I cannot even edit it for new lines.  I would have hoped this functionality would have been standard for fieldcatalog merge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,  Vanessa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Apr 2006 16:11:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-insert/m-p/1348479#M175208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-28T16:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid Insert</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-insert/m-p/1348480#M175209</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;Basically you want to control the EDIT functionality at a CELL level. Here is what you need to do. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Add a field call STYLE TYPE LVC_T_STYLE to your data table.&lt;/P&gt;&lt;P&gt;2. This is a nested internal table.&lt;/P&gt;&lt;P&gt;3. For each row, specify the STYLE (MC_STYLE_ENABLED / MC_STYLE_DISABLED - &amp;lt;i&amp;gt; These are attributes of the class CL_GUI_ALV_GRID &amp;lt;/i&amp;gt;) for each column in this nested table. That mean this table will 5 rows (assuming 5 columns in the table) for each row in the main table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. This will enable edit at a cell level.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Set the EDIT field of the field catalog to X for all the fields and disable it via the individual cells.&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note - Please Mark the helpful answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ravikumar Allampallam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Apr 2006 16:20:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-insert/m-p/1348480#M175209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-28T16:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid Insert</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-insert/m-p/1348481#M175210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Welcome To SDN community&lt;/P&gt;&lt;P&gt;You would have to control the editablity at cell by cell basis n not based on column.&lt;/P&gt;&lt;P&gt;Use field for LVC_T_STYLE.&lt;/P&gt;&lt;P&gt;you can Enable and disable the new rows and old rows respectively.&lt;/P&gt;&lt;P&gt;Hope that helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tanveer.&lt;/P&gt;&lt;P&gt;Please mark helpful answers by clicking on the star&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Apr 2006 16:26:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-insert/m-p/1348481#M175210</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-28T16:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid Insert</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-insert/m-p/1348482#M175211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much for the reply.  It pointed me in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Relevant code changes that I made are below.  Problem is now solved.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vanessa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF outtab OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE zsdxref.&lt;/P&gt;&lt;P&gt;data: style type lvc_t_styl.&lt;/P&gt;&lt;P&gt;DATA: END OF outtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: style_ln like line of OUTTAB-STYLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_fieldcat.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;build the field catalogue&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create field catalogue from stucture&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            i_structure_name = 'ZSDXREF'&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;            ct_fieldcat      = i_catalog[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Change catalog entry for changeable fields.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT i_catalog.&lt;/P&gt;&lt;P&gt;    IF  i_catalog-fieldname = 'ORIG_MFR'&lt;/P&gt;&lt;P&gt;     OR i_catalog-fieldname = 'ORIG_IDNLF'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;all fields enabled for edit...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     OR i_catalog-fieldname = 'TECH_DESC'&lt;/P&gt;&lt;P&gt;     OR i_catalog-fieldname = 'XREF_TYPE'&lt;/P&gt;&lt;P&gt;     OR i_catalog-fieldname = 'LOEVM'.&lt;/P&gt;&lt;P&gt;      i_catalog-edit = 'X'.&lt;/P&gt;&lt;P&gt;      MODIFY i_catalog.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " build_fieldcat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE pbo_grid_display OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*tell the layout which outtab field is the style field.&lt;/P&gt;&lt;P&gt;    wa_layout-stylefname = 'STYLE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Key fields of existing rows disabled for edit.  In practice new rows will then&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;be available to edit as per the catalog setting.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*NB: field names need to be in alphabetical order.&lt;/P&gt;&lt;P&gt;    LOOP AT outtab.&lt;/P&gt;&lt;P&gt;      REFRESH outtab-style.&lt;/P&gt;&lt;P&gt;      CLEAR STYLE_ln.&lt;/P&gt;&lt;P&gt;      style_ln-fieldname = 'ORIG_IDNLF'.&lt;/P&gt;&lt;P&gt;      style_ln-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled.&lt;/P&gt;&lt;P&gt;      APPEND style_ln TO outtab-style.&lt;/P&gt;&lt;P&gt;      CLEAR STYLE_ln.&lt;/P&gt;&lt;P&gt;      style_ln-fieldname = 'ORIG_MFR'.&lt;/P&gt;&lt;P&gt;      style_ln-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled.&lt;/P&gt;&lt;P&gt;      APPEND style_ln TO outtab-style.&lt;/P&gt;&lt;P&gt;      MODIFY outtab.&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;    CALL METHOD grid1-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        is_layout                     = wa_layout&lt;/P&gt;&lt;P&gt;        it_toolbar_excluding          = i_toolbar_excl&lt;/P&gt;&lt;P&gt;      CHANGING&lt;/P&gt;&lt;P&gt;        it_outtab                     = outtab[]&lt;/P&gt;&lt;P&gt;        it_fieldcatalog               = i_catalog[]&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        invalid_parameter_combination = 1&lt;/P&gt;&lt;P&gt;        program_error                 = 2&lt;/P&gt;&lt;P&gt;        too_many_lines                = 3&lt;/P&gt;&lt;P&gt;        OTHERS                        = 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " pbo_grid_display  OUTPUT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2006 13:30:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-insert/m-p/1348482#M175211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-02T13:30:47Z</dc:date>
    </item>
  </channel>
</rss>

