<?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 Fetching data from one internal table and populating their corresponding fieldname into other table. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742936#M2021226</link>
    <description>&lt;P&gt;Hi &lt;/P&gt;
  &lt;P&gt;I have my data in an internal table having 20 fields (user input). this input might change (position of fieldnames) depending on the contents of invoice.&lt;/P&gt;
  &lt;P&gt;now i want to get specific fieldname and populate this data into other internal internal table that has 10 fields.&lt;/P&gt;
  &lt;P&gt;so could anyone let me know how can i work on this.&lt;/P&gt;
  &lt;P&gt;I'm trying to check every field(field 01 - field 20) from input and input logic if it matches but it might affect runtime.&lt;/P&gt;
  &lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2023 11:22:17 GMT</pubDate>
    <dc:creator>calvinkarlo</dc:creator>
    <dc:date>2023-11-10T11:22:17Z</dc:date>
    <item>
      <title>Fetching data from one internal table and populating their corresponding fieldname into other table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742936#M2021226</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;
  &lt;P&gt;I have my data in an internal table having 20 fields (user input). this input might change (position of fieldnames) depending on the contents of invoice.&lt;/P&gt;
  &lt;P&gt;now i want to get specific fieldname and populate this data into other internal internal table that has 10 fields.&lt;/P&gt;
  &lt;P&gt;so could anyone let me know how can i work on this.&lt;/P&gt;
  &lt;P&gt;I'm trying to check every field(field 01 - field 20) from input and input logic if it matches but it might affect runtime.&lt;/P&gt;
  &lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 11:22:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742936#M2021226</guid>
      <dc:creator>calvinkarlo</dc:creator>
      <dc:date>2023-11-10T11:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from one internal table and populating their corresponding fieldname into other table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742937#M2021227</link>
      <description>&lt;P&gt;Probably it's simple but I don't understand the question very well, so difficult to answer precisely.&lt;/P&gt;&lt;P&gt;Could you describe your exact case?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 15:30:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742937#M2021227</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-10T15:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from one internal table and populating their corresponding fieldname into other table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742938#M2021228</link>
      <description>&lt;P&gt;It's like the user will input dynamic field names from excel file.. For example for week 1 the field names are A ,B, C ,D and E for week 2 field names are A, C, E and F for week 3 A, B, E and D. But in my program I declare an internal table that can accept A, B, C, D, E, and F&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 06:09:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742938#M2021228</guid>
      <dc:creator>calvinkarlo</dc:creator>
      <dc:date>2023-11-11T06:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from one internal table and populating their corresponding fieldname into other table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742939#M2021229</link>
      <description>&lt;P&gt;Still need clarification. Please provide a minimal reproducible example.&lt;/P&gt;&lt;P&gt;Based on the next code (I guess it's what you explained), what result do you want to obtain?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_itab_line,
         week_number TYPE i,
         a           TYPE flag,
         b           TYPE flag,
         c           TYPE flag,
         d           TYPE flag,
         e           TYPE flag,
         f           TYPE flag,
       END OF ty_itab_line.
TYPES ty_itab TYPE STANDARD TABLE OF ty_itab_line WITH EMPTY KEY.
DATA(itab) = VALUE ty_itab(
    ( week_number = 1 a = 'X' b = 'X' c = 'X' d = 'X' e = 'X' f = ' ' )    " 1: A B C D E
    ( week_number = 2 a = 'X' b = ' ' c = 'X' d = ' ' e = 'X' f = 'X' )    " 2: A   C   E F
    ( week_number = 3 a = 'X' b = 'X' c = ' ' d = 'X' e = 'X' f = ' ' ) ). " 3: A B   D E
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Nov 2023 09:14:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742939#M2021229</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-11T09:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from one internal table and populating their corresponding fieldname into other table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742940#M2021230</link>
      <description>&lt;P&gt;Hi according to your comment I need to specify possible scenarios? Is there a way to automate this one? like the system will automatically create ty_itab from the user input? for example, for incoming weeks there is another combination of fieldnames.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 09:58:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742940#M2021230</guid>
      <dc:creator>calvinkarlo</dc:creator>
      <dc:date>2023-11-11T09:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from one internal table and populating their corresponding fieldname into other table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742941#M2021231</link>
      <description>&lt;P&gt;For example here's the full list of the invoice&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2228612-image.png" /&gt;&lt;/P&gt;&lt;P&gt;sometimes not all fields are filled in, so they delete that column.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2228613-image.png" /&gt;&lt;/P&gt;&lt;P&gt;now i want to get specific fieldnames(Charge) and populate this data into other internal internal table&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 10:15:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742941#M2021231</guid>
      <dc:creator>calvinkarlo</dc:creator>
      <dc:date>2023-11-11T10:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from one internal table and populating their corresponding fieldname into other table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742942#M2021232</link>
      <description>&lt;P&gt;Did you try move corresponding itab_source[] to itab_target[] ?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 12:11:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742942#M2021232</guid>
      <dc:creator>thilakan_t</dc:creator>
      <dc:date>2023-11-11T12:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from one internal table and populating their corresponding fieldname into other table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742943#M2021233</link>
      <description>&lt;P&gt;You can simplify this by creating a mapping between the fields in your input table and the fields in your output table. That way, you don't need to check each field individually, which can save runtime. Just map them and transfer the data accordingly.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 13:02:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742943#M2021233</guid>
      <dc:creator>worker1</dc:creator>
      <dc:date>2023-11-11T13:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from one internal table and populating their corresponding fieldname into other table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742944#M2021234</link>
      <description>&lt;P&gt;Could you make your question a little bit more ABAP-oriented please?&lt;/P&gt;&lt;P&gt;Below, I call "normalized" the internal table which contains all possible columns. I use the obsolete concept of subroutines and MOVE-CORRESPONDING, to simplify the code, and because I don't know your ABAP version.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_any_itab_line_1,
         batch_no      TYPE decfloat16,
         pallet_weight TYPE decfloat16,
       END OF ty_any_itab_line_1.
TYPES ty_any_itab_1 TYPE STANDARD TABLE OF ty_any_itab_line_1 WITH EMPTY KEY.

TYPES: BEGIN OF ty_normalized_itab_line,
         batch_no      TYPE decfloat16,
         fuel_charge   TYPE decfloat16,
         pallet_weight TYPE decfloat16,
       END OF ty_normalized_itab_line.
TYPES ty_normalized_itab TYPE STANDARD TABLE OF ty_normalized_itab_line WITH EMPTY KEY.

DATA(any_itab_1) = VALUE ty_any_itab_1(
       ( batch_no      = 1
         pallet_weight = 10 ) ).

DATA(normalized_itab) = VALUE ty_normalized_itab( ).
PERFORM normalize_input_table USING any_itab_1 CHANGING normalized_itab.

ASSERT normalized_itab = VALUE ty_normalized_itab(
       ( batch_no      = 1
         fuel_charge   = 0
         pallet_weight = 10 ) ).

FORM normalize_input_table
    USING
      input_table      TYPE ANY TABLE 
    CHANGING
      normalized_table TYPE ty_itab.
  MOVE-CORRESPONDING input_table TO normalized_table.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Nov 2023 13:19:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-one-internal-table-and-populating-their-corresponding/m-p/12742944#M2021234</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-11T13:19:40Z</dc:date>
    </item>
  </channel>
</rss>

