<?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: Fill Table Witout Loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379933#M1994129</link>
    <description>&lt;P&gt;SAP Community is not a "code it for me" service.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Feb 2021 09:25:14 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2021-02-15T09:25:14Z</dc:date>
    <item>
      <title>Fill Table Witout Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379930#M1994126</link>
      <description>&lt;P&gt;Hi Every One&lt;/P&gt;
  &lt;P&gt;i have one column internal table Like&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1893482-2021-02-15-12-12-28.png" /&gt;&lt;/P&gt;
  &lt;P&gt;i want add 2 column with Fixed value Like :&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1893483-2021-02-15-12-15-17.png" /&gt;&lt;/P&gt;
  &lt;P&gt;How to do it in the best way ?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 08:48:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379930#M1994126</guid>
      <dc:creator>srahemi</dc:creator>
      <dc:date>2021-02-15T08:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Table Witout Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379931#M1994127</link>
      <description>&lt;P&gt;Here's one way to do it when 'x' and 'y' are fixed...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES:
  BEGIN OF ty_one_column,
    column TYPE i,
  END OF ty_one_column.

TYPES:
  BEGIN OF ty_three_columns,
    column   TYPE i,
    column_2 TYPE string,
    column_3 TYPE string,
  END OF ty_three_columns.

DATA one_column_table TYPE STANDARD TABLE OF ty_one_column WITH EMPTY KEY.
DATA three_column_table TYPE STANDARD TABLE OF ty_three_columns WITH EMPTY KEY.

DO 5 TIMES.
  INSERT VALUE #( column = sy-index ) INTO TABLE one_column_table.
ENDDO.

three_column_table = CORRESPONDING #( one_column_table ).
MODIFY three_column_table
  FROM VALUE #( column_2 = 'x'
                column_3 = 'y' )
  TRANSPORTING column_2
               column_3
  WHERE column IS NOT INITIAL.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Feb 2021 09:04:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379931#M1994127</guid>
      <dc:creator>joltdx</dc:creator>
      <dc:date>2021-02-15T09:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Table Witout Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379932#M1994128</link>
      <description>&lt;P&gt;I'd say there are different possibilities, though you'll end up with a loop somewhere.&lt;/P&gt;&lt;P&gt;Option 1 - in the SQL statement&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT column,
       'x' as column2,
       'Y' as column3
       FROM [..]
       INTO TABLE @DATA([..])
       ..&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Option 2 - the FOR statement&lt;/P&gt;&lt;P&gt;see this &lt;A href="https://blogs.sap.com/2017/11/08/for-expression-in-abap-7.40-best-case-scenarios/"&gt;blog&lt;/A&gt; for different possibilities (though technically, this remains a loop of course)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    [table_2] = VALUE #(  FOR data
                          IN [table_1]
                          ( column_1 = data-column_1
                            column_2 = 'x'
                            column_3 = 'Y'
                          )
                       ).
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Feb 2021 09:08:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379932#M1994128</guid>
      <dc:creator>Patrick_vN</dc:creator>
      <dc:date>2021-02-15T09:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Table Witout Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379933#M1994129</link>
      <description>&lt;P&gt;SAP Community is not a "code it for me" service.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 09:25:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379933#M1994129</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-02-15T09:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Table Witout Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379934#M1994130</link>
      <description>&lt;P&gt;Unfortunately the CORRESPONDING operator will only map field names and not constants like that. That would have been a good one if it hade worked. I know I would have used it many times if it had been supported... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 09:37:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379934#M1994130</guid>
      <dc:creator>joltdx</dc:creator>
      <dc:date>2021-02-15T09:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Table Witout Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379935#M1994131</link>
      <description>&lt;P&gt;Yeah, like I wrote in the answer, I wasn't sure the current syntax supports it. I ended up removing the option to prevent minsunderstandings &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 10:25:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379935#M1994131</guid>
      <dc:creator>Patrick_vN</dc:creator>
      <dc:date>2021-02-15T10:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Table Witout Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379936#M1994132</link>
      <description>&lt;P&gt;Here another solution with CL_ABAP_CORRESPONDING class. It works on ABAP 7.50  .  I didn't write any loop. Inside kernel module ab_kmMvcdExecute_752 maybe some loop exist . I am not sure : )&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cl_abap_corresponding=&amp;gt;create_with_value(
  source            = first_table
  destination       = second_table
  mapping           = VALUE  cl_abap_corresponding=&amp;gt;mapping_table_value(
      ( level = 0 kind = cl_abap_corresponding=&amp;gt;mapping_component   srcname = 'column1' dstname = 'column1'  )
      ( level = 0 kind = cl_abap_corresponding=&amp;gt;mapping_value dstname = 'column2' value = REF #( `X` ) )
      ( level = 0 kind = cl_abap_corresponding=&amp;gt;mapping_value dstname = 'column3' value = REF #( `Y` ) ) )
   )-&amp;gt;execute( EXPORTING source      = first_table
                CHANGING  destination = second_table ).&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Feb 2021 17:22:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379936#M1994132</guid>
      <dc:creator>yunustuzun</dc:creator>
      <dc:date>2021-02-15T17:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Table Witout Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379937#M1994133</link>
      <description>&lt;P&gt;Thank you, Sir!&lt;BR /&gt;Genial in its simplicity.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 11:26:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-table-witout-loop/m-p/12379937#M1994133</guid>
      <dc:creator>Sebastian_Gesiarz</dc:creator>
      <dc:date>2022-07-20T11:26:40Z</dc:date>
    </item>
  </channel>
</rss>

