<?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: Populating one Internal table from two internal tables. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337795#M800092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you have told the structure is same for the three tables, you can proceed in this manner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table itab2 into wa_itab3 where itab2-&amp;lt;f1&amp;gt; = itab1-&amp;lt;f1&amp;gt; and so on&amp;#133;. ( for all the common fields which you want to select )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_itab3 to itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2008 06:46:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-07T06:46:30Z</dc:date>
    <item>
      <title>Populating one Internal table from two internal tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337791#M800088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus,&lt;/P&gt;&lt;P&gt;iam having 3 internal table with same structure ,&lt;/P&gt;&lt;P&gt;1st internal table having some records&lt;/P&gt;&lt;P&gt;2nd internal table is also having some records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i need to do is to populate the records to the 3rd internal table which the common records in the 1st and 2nd internal table. (common means intersection).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please explain how and using which concept and if possible code also...&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 06:18:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337791#M800088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T06:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Populating one Internal table from two internal tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337792#M800089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you send the structure of the internal tables and their primary keys and some model table contents. So that we can usderstand how the data should be populated from the first two to third.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 06:22:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337792#M800089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T06:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Populating one Internal table from two internal tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337793#M800090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ravi,&lt;/P&gt;&lt;P&gt;look at the folowing code for reference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--mard structure&lt;/P&gt;&lt;P&gt;types: begin of struc_mard,&lt;/P&gt;&lt;P&gt;       matnr	type matnr,	      "Material Number&lt;/P&gt;&lt;P&gt;       werks	type werks_d,	      "Plant&lt;/P&gt;&lt;P&gt;       lgort	type lgort_d,	      "Storage Location&lt;/P&gt;&lt;P&gt;       labst type labst,         "Valuated stock with unrestricted use&lt;/P&gt;&lt;P&gt;       end of struc_mard.&lt;/P&gt;&lt;P&gt;*&amp;amp;--mara structure&lt;/P&gt;&lt;P&gt;types: begin of struc_mara,&lt;/P&gt;&lt;P&gt;       matnr type matnr,         "material number&lt;/P&gt;&lt;P&gt;       meins type meins,         "unit of measurement&lt;/P&gt;&lt;P&gt;       mtart type mtart,         "material type&lt;/P&gt;&lt;P&gt;       ersda	type ersda,	      "Creation date&lt;/P&gt;&lt;P&gt;       end of struc_mara.&lt;/P&gt;&lt;P&gt;*&amp;amp;--maktx structure&lt;/P&gt;&lt;P&gt;types: begin of struc_maktx,&lt;/P&gt;&lt;P&gt;       matnr type matnr,        "material number&lt;/P&gt;&lt;P&gt;       maktx type maktx,        "material description&lt;/P&gt;&lt;P&gt;       end of struc_maktx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--Final structure&lt;/P&gt;&lt;P&gt;types: begin of struc_final,&lt;/P&gt;&lt;P&gt;       matnr	type matnr,	      "Material Number&lt;/P&gt;&lt;P&gt;       werks	type werks_d,	      "Plant&lt;/P&gt;&lt;P&gt;       lgort	type lgort_d,	      "Storage Location&lt;/P&gt;&lt;P&gt;       labst type labst,         "Valuated stock with unrestricted use&lt;/P&gt;&lt;P&gt;       meins type meins,         "unit of measurement&lt;/P&gt;&lt;P&gt;       mtart type mtart,         "material type&lt;/P&gt;&lt;P&gt;       ersda	type ersda,	      "Creation date&lt;/P&gt;&lt;P&gt;       maktx type maktx,         "material description&lt;/P&gt;&lt;P&gt;       v_box(1) type c,          "for checkbox field&lt;/P&gt;&lt;P&gt;       end of struc_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;---work  area for Internal Tables[population 1]&lt;/P&gt;&lt;P&gt;data: wa_mard type struc_mard,&lt;/P&gt;&lt;P&gt;      wa_mara type struc_mara,&lt;/P&gt;&lt;P&gt;      wa_maktx type struc_maktx,&lt;/P&gt;&lt;P&gt;      wa_final type struc_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                 INTERNAL TABLES  DECLARATION                        *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;---Internal tables for storing data.[populaiton 1]&lt;/P&gt;&lt;P&gt;data: i_mard  type standard table of struc_mard,&lt;/P&gt;&lt;P&gt;      i_mara  type standard table of struc_mara,&lt;/P&gt;&lt;P&gt;      i_maktx type standard table of struc_maktx,&lt;/P&gt;&lt;P&gt;      i_final type standard table of struc_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--fetching the data from table for storage&lt;/P&gt;&lt;P&gt;  select  matnr&lt;/P&gt;&lt;P&gt;          werks&lt;/P&gt;&lt;P&gt;          lgort&lt;/P&gt;&lt;P&gt;          labst&lt;/P&gt;&lt;P&gt;          into table i_mard&lt;/P&gt;&lt;P&gt;          from mard&lt;/P&gt;&lt;P&gt;          where matnr in r_matnr and werks in r_werks and lgort in&lt;/P&gt;&lt;P&gt;          r_lgort&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.  "if unsuccesful&lt;/P&gt;&lt;P&gt;    message e004.    "Error- Record does not exist&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;selection of material description&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if i_mard[] is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*SELECT DISTINCT FOR UNIQUE ENTRIES ONLY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select  distinct matnr&lt;/P&gt;&lt;P&gt;                     maktx&lt;/P&gt;&lt;P&gt;                     into table i_maktx&lt;/P&gt;&lt;P&gt;                     from makt&lt;/P&gt;&lt;P&gt;                     for all entries in i_mard&lt;/P&gt;&lt;P&gt;                     where matnr = i_mard-matnr and&lt;/P&gt;&lt;P&gt;                     spras = sy-langu.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0.                    " if unsucessful&lt;/P&gt;&lt;P&gt;      wa_maktx-maktx = text-028.         "NO DESCRIPTION&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*fetching information from material master&lt;/P&gt;&lt;P&gt;    select  distinct matnr&lt;/P&gt;&lt;P&gt;                     meins&lt;/P&gt;&lt;P&gt;                     mtart&lt;/P&gt;&lt;P&gt;                     ersda&lt;/P&gt;&lt;P&gt;                     into table i_mara&lt;/P&gt;&lt;P&gt;                     from mara for all entries in i_mard&lt;/P&gt;&lt;P&gt;                     where matnr = i_mard-matnr.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      message e003.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--sorting the tables&lt;/P&gt;&lt;P&gt;    sort: i_mard by matnr werks lgort,&lt;/P&gt;&lt;P&gt;          i_mara by matnr,&lt;/P&gt;&lt;P&gt;          i_maktx by matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--Clearing workareas.&lt;/P&gt;&lt;P&gt;    clear: wa_mard,&lt;/P&gt;&lt;P&gt;           wa_mara,&lt;/P&gt;&lt;P&gt;           wa_maktx,&lt;/P&gt;&lt;P&gt;           wa_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*PROCESSING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at i_mard into wa_mard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*moving values to final workarea&lt;/P&gt;&lt;P&gt;      wa_final = wa_mard.&lt;/P&gt;&lt;P&gt;      at new matnr.&lt;/P&gt;&lt;P&gt;        read table i_maktx into wa_maktx&lt;/P&gt;&lt;P&gt;        with key matnr = wa_mard-matnr binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        read table i_mara into wa_mara&lt;/P&gt;&lt;P&gt;        with key matnr = wa_mard-matnr binary search.&lt;/P&gt;&lt;P&gt;      endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        "if succesful then move to final workarea&lt;/P&gt;&lt;P&gt;        wa_final-maktx  = wa_maktx-maktx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*for mara values&lt;/P&gt;&lt;P&gt;        wa_final-meins  = wa_mara-meins.&lt;/P&gt;&lt;P&gt;        wa_final-mtart = wa_mara-mtart.&lt;/P&gt;&lt;P&gt;        wa_final-ersda  = wa_mara-ersda.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;*append final workarea&lt;/P&gt;&lt;P&gt;      append wa_final to i_final.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;clearing and refreshing the table I_MARD&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    refresh: i_mard.&lt;/P&gt;&lt;P&gt;    clear: wa_mard.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    "zf_populate_info&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will move all the data into final table you have got, with the performnce tuned way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward point if useful&lt;/P&gt;&lt;P&gt;Rohan malik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 06:27:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337793#M800090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T06:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Populating one Internal table from two internal tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337794#M800091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab2 with key a  = wa1-a  b = wa1-b.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appand wa1 to itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;reward points if helpful&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 06:33:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337794#M800091</guid>
      <dc:creator>Vijay</dc:creator>
      <dc:date>2008-02-07T06:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Populating one Internal table from two internal tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337795#M800092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you have told the structure is same for the three tables, you can proceed in this manner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table itab2 into wa_itab3 where itab2-&amp;lt;f1&amp;gt; = itab1-&amp;lt;f1&amp;gt; and so on&amp;#133;. ( for all the common fields which you want to select )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_itab3 to itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 06:46:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337795#M800092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T06:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Populating one Internal table from two internal tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337796#M800093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ANSWER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1&lt;/P&gt;&lt;P&gt; READ TABLE ITAB2 WITH KEY FIELD1 = ITAB1-FIELD1.&lt;/P&gt;&lt;P&gt; IF SY-SUBRC = 0&lt;/P&gt;&lt;P&gt;  APPEND ITAB1 TO ITAB3.&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;Assume that ITAB1, ITAB2, ITAB3 ARE ITABS WITH HEADER LINES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 06:51:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337796#M800093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T06:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Populating one Internal table from two internal tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337797#M800094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;we can take a simple example student details&lt;/P&gt;&lt;P&gt;structure fields&lt;/P&gt;&lt;P&gt;Registration Number&lt;/P&gt;&lt;P&gt;Name &lt;/P&gt;&lt;P&gt;Address&lt;/P&gt;&lt;P&gt;group&lt;/P&gt;&lt;P&gt;end of structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all the three internal table having same structure.&lt;/P&gt;&lt;P&gt;1, How to do it in ordinary way?&lt;/P&gt;&lt;P&gt;2, How to do using the Field Symbols?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 06:52:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337797#M800094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T06:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Populating one Internal table from two internal tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337798#M800095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort both the tables.&lt;/P&gt;&lt;P&gt;write loop at first internal table and &lt;/P&gt;&lt;P&gt;if second internal table is having single record then use read statement with where condition field of first internal table .&lt;/P&gt;&lt;P&gt;use binary search i fyou use read statemetn.&lt;/P&gt;&lt;P&gt;if second internal table is having multiple records for the single value of the first internal table then use loop for second internal table with where condition.&lt;/P&gt;&lt;P&gt;append to third internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort: itab1,itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in case of single record in second table then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt; read itab2 with key &amp;lt;fld&amp;gt; = itab1-fld binary search.&lt;/P&gt;&lt;P&gt; if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;  move fields of itab1 and itab2 to itab3&lt;/P&gt;&lt;P&gt;  append itab3.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tab2 is having multiple records then&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt; loop at itab2 where fld = itab1-fld&lt;/P&gt;&lt;P&gt;  move fields of itab1 and itab2 to itab3&lt;/P&gt;&lt;P&gt;  append itab3.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 06:55:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337798#M800095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T06:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Populating one Internal table from two internal tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337799#M800096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if iam looping the first itab1 then it is having 4000 records,&lt;/P&gt;&lt;P&gt;then reading the second itab2 is having 10 records,&lt;/P&gt;&lt;P&gt;unnecessarly loop wl run 4000 times , &lt;/P&gt;&lt;P&gt;what wl be the optimistic way, is that filed symbols can play anything ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 07:38:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-one-internal-table-from-two-internal-tables/m-p/3337799#M800096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T07:38:36Z</dc:date>
    </item>
  </channel>
</rss>

