<?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: New ABAP Syntax for modifying internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680782#M30326</link>
    <description>&lt;P&gt;I'm confused:&lt;/P&gt;&lt;P&gt;The question title let think people that you want to just update one component of one internal table.&lt;/P&gt;&lt;P&gt;But the question inside is about to transfer to another internal table, with one component set to a fixed value and all the other components of the structure should be transferred unchanged.&lt;/P&gt;&lt;P&gt;So I will answer to both questions (because other answers confused me).&lt;/P&gt;&lt;P&gt;1) To answer what's in the title: "new ABAP"? If you mean via a "construction expression" only, NO, because it's only to "create" data, not to "update". To update, you have to use the "old" ABAP statements... but you may still use a construction expression inside them (parentheses are needed because &amp;lt;tab&amp;gt; has a generic line type):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODIFY &amp;lt;tab&amp;gt; FROM VALUE ygt_cost( new_update = 'X' ) TRANSPORTING ('new_update') WHERE (`new_update &amp;lt;&amp;gt; 'X'`). &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;More information: &lt;A href="https://help.sap.com/doc/abapdocu_753_index_htm/7.53/en-US/index.htm?file=abapmodify_itab_multiple.htm"&gt;MODIFY itab_lines&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2) To answer the actual question, to transfer all other components, use &lt;STRONG&gt;BASE&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(lt_table) = VALUE tt_1( FOR &amp;lt;line&amp;gt; IN &amp;lt;tab&amp;gt; ( VALUE ygt_cost( BASE &amp;lt;line&amp;gt; new_update = 'X' ) ) ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;More information: &lt;A href="https://help.sap.com/doc/abapdocu_753_index_htm/7.53/en-US/index.htm?file=abenvalue_constructor_params_struc.htm"&gt;VALUE #|dtype( BASE ... ) for structures&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2019 05:12:40 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2019-07-18T05:12:40Z</dc:date>
    <item>
      <title>New ABAP Syntax for modifying internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680777#M30321</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Is there any way to modify an internal table using new abap syntax, possibly within FOR...IN iteration? I need to modify the value in a column of each row of an existing internal table and assign it to a new internal table. I was trying to use something like this:&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;TYPES: tt_1 TYPE TABLE OF YGT_COST WITH EMPTY KEY.&lt;/P&gt;
  &lt;P&gt;DATA: lr_gen TYPE REF TO data.&lt;/P&gt;
  &lt;P&gt;FIELD-SYMBOLS: &amp;lt;tab&amp;gt; TYPE STANDARD TABLE.&lt;/P&gt;
  &lt;P&gt;FIELD-SYMBOLS: &amp;lt;line1&amp;gt; TYPE ANY.&lt;/P&gt;
  &lt;P&gt;CREATE DATA lr_gen TYPE STANDARD TABLE OF YGT_COST WITH EMPTY KEY.&lt;/P&gt;
  &lt;P&gt;ASSIGN lr_gen-&amp;gt;* TO &amp;lt;tab&amp;gt;.&lt;/P&gt;
  &lt;P&gt;CREATE DATA lr_gen TYPE YGT_COST.&lt;/P&gt;
  &lt;P&gt;ASSIGN lr_gen-&amp;gt;* TO &amp;lt;line1&amp;gt;.&lt;EM&gt;* &lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt; &amp;lt;tab&amp;gt; = ct_table.&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;DATA(lt_table) = VALUE tt_1( FOR &amp;lt;line&amp;gt; IN &amp;lt;tab&amp;gt; ( new_update = 'X' ) ).&lt;/P&gt;
  &lt;P&gt;*// However, the above statement is creating an internal table lt_table with the line type of &amp;lt;line&amp;gt; but it's only populating &lt;STRONG&gt;new_update&lt;/STRONG&gt; colum with 'X'. Remaining columns are rendering as initial into the new internal table &lt;STRONG&gt;lt_table&lt;/STRONG&gt;. &lt;/P&gt;
  &lt;P&gt;What i am expecting is to only update column &lt;STRONG&gt;new_update&lt;/STRONG&gt; with 'X' and remaining columns should have values from &amp;lt;line&amp;gt; structure. Please note, Column to column mapping from &amp;lt;line&amp;gt; to the corresponding fields of lt_table is not feasible because of large number of columns involved.&lt;/P&gt;
  &lt;P&gt;Best Rgds,&lt;/P&gt;
  &lt;P&gt;Vish&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 05:46:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680777#M30321</guid>
      <dc:creator>VishwanathV</dc:creator>
      <dc:date>2018-11-23T05:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: New ABAP Syntax for modifying internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680778#M30322</link>
      <description>&lt;P&gt;Using LET expression you can assign a value or assign value using logic to the intend field.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types:
  begin of ty_tab1,
    val1 type char1,
    val2 type i,
  end of ty_tab1,
  tt_tab1 type standard table of ty_tab1 with empty key.

data(lt_tab1) = value tt_tab1(
                   ( val1 = 'A' val2 = 100 )
                   ( val1 = 'B' val2 = 200 ) ).

cl_demo_output=&amp;gt;write( lt_tab1 ).

* LET
data(lt_tab2) = value tt_tab1(
                  for wa in lt_tab1 index into idx
                  let x = wa-val2 + idx
                  in ( val1 = wa-val1 val2 = x ) ).

cl_demo_output=&amp;gt;write( lt_tab2 ).
cl_demo_output=&amp;gt;display( ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Nov 2018 14:35:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680778#M30322</guid>
      <dc:creator>srikanthnalluri</dc:creator>
      <dc:date>2018-11-23T14:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: New ABAP Syntax for modifying internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680779#M30323</link>
      <description>&lt;P&gt;Did you find any solution to this  ?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 09:25:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680779#M30323</guid>
      <dc:creator>VijayCR</dc:creator>
      <dc:date>2019-07-17T09:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: New ABAP Syntax for modifying internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680780#M30324</link>
      <description>&lt;P&gt;This syntax is known and already worked on it. But I was actually looking for&lt;A href="http://sapabapcentral.blogspot.com/p/sap-abap-ctaw12750.html" target="_blank"&gt; &lt;STRONG&gt;ABAP 7.50&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;/STRONG&gt;. 
For Example ...Below is the way to populate the internal table (replacement of Loop).&lt;/P&gt;&lt;P&gt;DATA(gt_citys) = VALUE ty_citys( FOR ls_ship IN gt_ships
WHERE ( route = ‘R0001’ ) ( ls_ship–city ) ).&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 10:34:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680780#M30324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-07-17T10:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: New ABAP Syntax for modifying internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680781#M30325</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/11659/vijaysimha.html"&gt;Vijaya Simha Chintarlapalli Reddy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you may using function method after LET to modify which fields you need:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(itab1) = VALUE #( FOR ls1 in tab2 LET ls_tmp = conv_class-&amp;gt;conv( ls1 ) IN ( ls_tmp ) ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Jul 2019 01:43:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680781#M30325</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2019-07-18T01:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: New ABAP Syntax for modifying internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680782#M30326</link>
      <description>&lt;P&gt;I'm confused:&lt;/P&gt;&lt;P&gt;The question title let think people that you want to just update one component of one internal table.&lt;/P&gt;&lt;P&gt;But the question inside is about to transfer to another internal table, with one component set to a fixed value and all the other components of the structure should be transferred unchanged.&lt;/P&gt;&lt;P&gt;So I will answer to both questions (because other answers confused me).&lt;/P&gt;&lt;P&gt;1) To answer what's in the title: "new ABAP"? If you mean via a "construction expression" only, NO, because it's only to "create" data, not to "update". To update, you have to use the "old" ABAP statements... but you may still use a construction expression inside them (parentheses are needed because &amp;lt;tab&amp;gt; has a generic line type):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODIFY &amp;lt;tab&amp;gt; FROM VALUE ygt_cost( new_update = 'X' ) TRANSPORTING ('new_update') WHERE (`new_update &amp;lt;&amp;gt; 'X'`). &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;More information: &lt;A href="https://help.sap.com/doc/abapdocu_753_index_htm/7.53/en-US/index.htm?file=abapmodify_itab_multiple.htm"&gt;MODIFY itab_lines&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2) To answer the actual question, to transfer all other components, use &lt;STRONG&gt;BASE&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(lt_table) = VALUE tt_1( FOR &amp;lt;line&amp;gt; IN &amp;lt;tab&amp;gt; ( VALUE ygt_cost( BASE &amp;lt;line&amp;gt; new_update = 'X' ) ) ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;More information: &lt;A href="https://help.sap.com/doc/abapdocu_753_index_htm/7.53/en-US/index.htm?file=abenvalue_constructor_params_struc.htm"&gt;VALUE #|dtype( BASE ... ) for structures&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 05:12:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680782#M30326</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-07-18T05:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: New ABAP Syntax for modifying internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680783#M30327</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/11659/vijaysimha.html"&gt;Vijaya Simha Chintarlapalli Reddy&lt;/A&gt; cf my answer&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 05:13:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680783#M30327</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-07-18T05:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: New ABAP Syntax for modifying internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680784#M30328</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/294721/vedvishwa.html"&gt;vishwanath vedula&lt;/A&gt; Please use the CODE button to format your code.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 05:14:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/new-abap-syntax-for-modifying-internal-tables/m-p/680784#M30328</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-07-18T05:14:43Z</dc:date>
    </item>
  </channel>
</rss>

