<?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: Append-corresponding records to internal table. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600243#M2010936</link>
    <description>&lt;P&gt;Select within loop is not recommended. you can try below&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select equnr matnr serge from equi into table @DATA(lt_logic) for all entries in t_logic where matnr eq @t_logic-var1 AND serge eq @t_logic-var2

loop at t_logic assiging field-symbol(&amp;lt;fs_logic&amp;gt;). 
read table lt_logic into data(wa_logic) with key matnr = &amp;lt;fs_logic&amp;gt;-var1 serge = &amp;lt;fs_logic&amp;gt;-var2.  

if sy-subrc = 0.  

&amp;lt;fs_logic&amp;gt;-equnr = wa_logic-equnr.  

endif.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shraddha&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2022 11:24:50 GMT</pubDate>
    <dc:creator>shraddha_mundwadkar</dc:creator>
    <dc:date>2022-08-22T11:24:50Z</dc:date>
    <item>
      <title>Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600238#M2010931</link>
      <description>&lt;P&gt;Hello dears, &lt;/P&gt;
  &lt;P&gt;I need your help to correctly append/insert the records to my internal table. I have the code below(the last part of it has to be adjusted):&lt;/P&gt;
  &lt;P&gt;The problem is that I need to insert the values into the correspondent column (equnr). &lt;/P&gt;
  &lt;P&gt;By using appending-corresponding fields of table, it just adds the values after my initial lines (image attached)&lt;A href="https://answers.sap.com/storage/temp/2085837-capture.jpg" data-attachment="2085837"&gt;capture.jpg&lt;/A&gt;. &lt;/P&gt;
  &lt;P&gt;Thank you!&lt;/P&gt;
  &lt;P&gt;--------------------------------------------------------------------&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;FORM logic .&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt; types:BEGIN OF ty_logic,&lt;BR /&gt; var1(15) TYPE c,&lt;BR /&gt; var2(15) TYPE c,&lt;BR /&gt; var3(15) TYPE c,&lt;BR /&gt; equnr TYPE equi-equnr,&lt;BR /&gt; END OF ty_logic.&lt;BR /&gt; DATA: t_logic TYPE STANDARD TABLE OF ty_logic,&lt;BR /&gt; wa_logic TYPE ty_logic.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;BR /&gt;
  &lt;BR /&gt;
  &lt;PRE&gt;&lt;CODE&gt; loop at it_afru2 into wa_afru.&lt;BR /&gt; if wa_afru-ltxa1 in lt_rng_check.&lt;BR /&gt; split wa_afru-ltxa1 at '|' into wa_logic-var1 wa_logic-var2 wa_logic-var3.&lt;BR /&gt; append wa_logic to t_logic.&lt;BR /&gt; else.&lt;BR /&gt; continue.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;BR /&gt;
  &lt;PRE&gt;&lt;CODE&gt; clear wa_afru.&lt;BR /&gt; endif.&lt;BR /&gt; endloop.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;BR /&gt;
  &lt;PRE&gt;&lt;CODE&gt; If t_logic is not INITIAL.&lt;BR /&gt; clear wa_logic.&lt;BR /&gt; loop at t_logic into wa_logic.&lt;BR /&gt; select equnr from equi&lt;BR /&gt; where matnr eq @wa_logic-var1 AND&lt;BR /&gt; serge eq @wa_logic-var2&lt;BR /&gt; APPENDING CORRESPONDING FIELDS OF TABLE @t_logic.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;ENDLOOP.&lt;BR /&gt;endif.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Aug 2022 10:16:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600238#M2010931</guid>
      <dc:creator>former_member823860</dc:creator>
      <dc:date>2022-08-22T10:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600239#M2010932</link>
      <description>&lt;P&gt;Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you! &lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 10:50:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600239#M2010932</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-08-22T10:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600240#M2010933</link>
      <description>&lt;P&gt;Have a look at &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abentable_processing_statements.htm"&gt;ABAP documentation&lt;/A&gt; how to work with internal tables.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 10:52:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600240#M2010933</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-08-22T10:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600241#M2010934</link>
      <description>&lt;P&gt;Dear Sandra,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for that CODE hint. I updated my question.&lt;/P&gt;&lt;P&gt;As for the "ABAP documentation" advice, this can be universal applied and you can reply almost to any question here on the forum with "Read the ABAP documentation". It doesn't always clarifying things for you, especially when you are a beginner.  &lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Lucian&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:10:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600241#M2010934</guid>
      <dc:creator>former_member823860</dc:creator>
      <dc:date>2022-08-22T11:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600242#M2010935</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;rapadungadunga2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You have to modify your code as below:&lt;/P&gt;&lt;P&gt;The code you wrote at place loop at t_logic into wa_logic. &lt;/P&gt;&lt;P&gt;Instead of append corresponding you should write modify. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data lv_tabix type sy-tabix.
If t_logic is not INITIAL.
 clear wa_logic.
 loop at t_logic into wa_logic.
     lv_tabix = sy-tabix.
     select equnr from equi INTO @WA_LOGIC-EQUNR where matnr eq @wa_logic-var1 AND
                                                      serge eq @wa_logic-var2
      
      MODIFY T_LOGIC FROM @WA_LOGIC INDEX LV_TABIX.
 ENDLOOP.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600242#M2010935</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-08-22T11:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600243#M2010936</link>
      <description>&lt;P&gt;Select within loop is not recommended. you can try below&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select equnr matnr serge from equi into table @DATA(lt_logic) for all entries in t_logic where matnr eq @t_logic-var1 AND serge eq @t_logic-var2

loop at t_logic assiging field-symbol(&amp;lt;fs_logic&amp;gt;). 
read table lt_logic into data(wa_logic) with key matnr = &amp;lt;fs_logic&amp;gt;-var1 serge = &amp;lt;fs_logic&amp;gt;-var2.  

if sy-subrc = 0.  

&amp;lt;fs_logic&amp;gt;-equnr = wa_logic-equnr.  

endif.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shraddha&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:24:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600243#M2010936</guid>
      <dc:creator>shraddha_mundwadkar</dc:creator>
      <dc:date>2022-08-22T11:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600244#M2010937</link>
      <description>&lt;P&gt;In your code, you use APPEND, which appends lines, hence the result you obtain. So, I guess you are asking how to update lines of the internal table.&lt;/P&gt;&lt;P&gt;Usually, ABAP developers don't look at the documentation, so at least you are saying that you tried to find information, but I don't understand what kind of problem you had with the explanations from the chapter "Changing internal tables".&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:52:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600244#M2010937</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-08-22T11:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600245#M2010938</link>
      <description>&lt;P&gt;Thank you  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:56:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600245#M2010938</guid>
      <dc:creator>shraddha_mundwadkar</dc:creator>
      <dc:date>2022-08-22T11:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600246#M2010939</link>
      <description>&lt;P&gt;Hi Venkateswaran,&lt;/P&gt;&lt;P&gt;Thank you for your input. I appreciate it. &lt;/P&gt;&lt;P&gt;Problem solved.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:05:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600246#M2010939</guid>
      <dc:creator>former_member823860</dc:creator>
      <dc:date>2022-08-22T12:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600247#M2010940</link>
      <description>&lt;P&gt;Hello Shraddha,&lt;/P&gt;&lt;P&gt;Thanks a lot for your detailed explanation. I'll use the logic you provided when appending the records to the final alv list. &lt;/P&gt;&lt;P&gt;Have a great day!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:06:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600247#M2010940</guid>
      <dc:creator>former_member823860</dc:creator>
      <dc:date>2022-08-22T12:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Append-corresponding records to internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600248#M2010941</link>
      <description>&lt;P&gt;Hello Sandra,&lt;/P&gt;&lt;P&gt;Indeed, I usually check first the documentation, then I'm looking on the forum for already answered questions in regards to my topic, in the end I'm asking for opinions. Sometimes it's easy to find an answer, sometimes you get easily confused (being a beginner as myself). From my experience so far, there is no such valuable input, than the one of an experienced abaper which comes also with some tricks, that you cannot find in the classical documentation. &lt;/P&gt;&lt;P&gt;Nevertheless, thank you for taking your time to review my request.&lt;/P&gt;&lt;P&gt;Have a very nice day!&lt;/P&gt;&lt;P&gt;Lucian&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:51:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-corresponding-records-to-internal-table/m-p/12600248#M2010941</guid>
      <dc:creator>former_member823860</dc:creator>
      <dc:date>2022-08-22T12:51:50Z</dc:date>
    </item>
  </channel>
</rss>

