<?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 new row insert. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-new-row-insert/m-p/1684884#M301639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;   I have an alv grid implemented through class cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;i am trying to inset new rows into the alv.I want the key fields of only the inserted rows to be editable and not the key fields of the already existing records.&lt;/P&gt;&lt;P&gt;If any one can give any link which has a detailed instruction and concepts for this.&lt;/P&gt;&lt;P&gt;there is one program &amp;lt;b&amp;gt;BCALV_EDIT_04&amp;lt;/b&amp;gt; which could not help me in having an idea for doing it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Nov 2006 14:29:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-23T14:29:14Z</dc:date>
    <item>
      <title>ALV new row insert.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-new-row-insert/m-p/1684884#M301639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;   I have an alv grid implemented through class cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;i am trying to inset new rows into the alv.I want the key fields of only the inserted rows to be editable and not the key fields of the already existing records.&lt;/P&gt;&lt;P&gt;If any one can give any link which has a detailed instruction and concepts for this.&lt;/P&gt;&lt;P&gt;there is one program &amp;lt;b&amp;gt;BCALV_EDIT_04&amp;lt;/b&amp;gt; which could not help me in having an idea for doing it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Nov 2006 14:29:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-new-row-insert/m-p/1684884#M301639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-23T14:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: ALV new row insert.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-new-row-insert/m-p/1684885#M301640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sandeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can insert the work area into the internal table.&lt;/P&gt;&lt;P&gt;Like.. &lt;/P&gt;&lt;P&gt;INSERT workarea INTO itab INDEX 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when you are trying to insert blank lines and display the same on the output, the display might create a problem, if the user tries to use the SORT / Total functions of the ALV Grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the internal table is updated, you can use the method REFRESH_TABLE_DISPLAY to refresh the screen data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help u.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Nov 2006 14:51:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-new-row-insert/m-p/1684885#M301640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-23T14:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: ALV new row insert.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-new-row-insert/m-p/1684886#M301641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the answer to ur question is make use of styles .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;firstly change the structure of ur internal table which u display in grid as follows &lt;/P&gt;&lt;P&gt;data: begin of line ,&lt;/P&gt;&lt;P&gt;          line type s_tab ,&lt;/P&gt;&lt;P&gt;          styletab type lvc_t_styl ,&lt;/P&gt;&lt;P&gt;        end of line ,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;        itab type line occurs 0 ." this is  the table to be displayed in the grid .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; now first u fill ur internal table with all the details u need to display .&lt;/P&gt;&lt;P&gt; and mark all the key fields of ur table in field catalouge as editable .&lt;/P&gt;&lt;P&gt; the before set table for first display call this subroutine .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form styletab  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: STYLE TYPE LVC_S_STYL ,&lt;/P&gt;&lt;P&gt;       itab_style type lvc_t_styl .&lt;/P&gt;&lt;P&gt; FIELD-SYMBOLS: &amp;lt;WA_ITEM&amp;gt; LIKE GS_ITEM1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab ASSIGNING &amp;lt;WA_ITEM&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  refresh itab_style .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT &amp;lt;WA_ITEM&amp;gt;-key_field1 IS INITIAL .&lt;/P&gt;&lt;P&gt;     clear ls_style .&lt;/P&gt;&lt;P&gt;     S_STYLE-FIELDNAME = 'key_field1'.&lt;/P&gt;&lt;P&gt;     s_STYLE-style = cl_gui_alv_grid=&amp;gt;mc_style_DISABLED.&lt;/P&gt;&lt;P&gt;     append s_style to itab_style .&lt;/P&gt;&lt;P&gt;  ELSE .&lt;/P&gt;&lt;P&gt;     S_STYLE-FIELDNAME = 'key_field1'.&lt;/P&gt;&lt;P&gt;     s_STYLE-style = cl_gui_alv_grid=&amp;gt;mc_style_ENABLED.&lt;/P&gt;&lt;P&gt;     APPEND S_STYLE TO itab_style .&lt;/P&gt;&lt;P&gt;  ENDIF .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT &amp;lt;WA_ITEM&amp;gt;-key_field2 IS INITIAL .&lt;/P&gt;&lt;P&gt;     clear ls_style .&lt;/P&gt;&lt;P&gt;     S_STYLE-FIELDNAME = 'key_field2'.&lt;/P&gt;&lt;P&gt;     s_STYLE-style = cl_gui_alv_grid=&amp;gt;mc_style_DISABLED.&lt;/P&gt;&lt;P&gt;     append s_style to itab_style .&lt;/P&gt;&lt;P&gt;  ELSEIF &amp;lt;WA_ITEM&amp;gt;-key_field2 IS INITIAL .&lt;/P&gt;&lt;P&gt;     clear ls_style .&lt;/P&gt;&lt;P&gt;     S_STYLE-FIELDNAME = 'key_field2'.&lt;/P&gt;&lt;P&gt;     s_STYLE-style = cl_gui_alv_grid=&amp;gt;mc_style_ENABLED.&lt;/P&gt;&lt;P&gt;     append s_style to itab_style .&lt;/P&gt;&lt;P&gt;  ENDIF .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;lwa_item&amp;gt;-style_tab = lt_style .&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;endform .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u hav to call this subroutine every time u refresh ur grid . &lt;/P&gt;&lt;P&gt;as all ur fields in field catalouge r editable wen u create new line the key fields will be initial and the above subroutine wil make them editable .&lt;/P&gt;&lt;P&gt;one more thing refresh this style table evrty time u call this subroutine .&lt;/P&gt;&lt;P&gt;and the table type lvc_t_styl is sorted table so plz enter the entries in sorted order .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope this should solve ur problem ..&lt;/P&gt;&lt;P&gt;if helpful then plz rewadr points .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if any doubts then i wud be glad to clarify them .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards ,&lt;/P&gt;&lt;P&gt;  swapnil .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Nov 2006 07:09:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-new-row-insert/m-p/1684886#M301641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-24T07:09:19Z</dc:date>
    </item>
  </channel>
</rss>

