<?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: merging data without primary key in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828754#M1589757</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;Please try the following,&lt;/P&gt;&lt;P&gt;*Looping at final_new which has all fields except gjahr&lt;/P&gt;&lt;P&gt;LOOP AT IT_FINAL_NEW .&lt;/P&gt;&lt;P&gt;*move wa to destination wa&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING IT_FINAL_NEW to IT_FINAL_DIS.&lt;/P&gt;&lt;P&gt;*read internal table having balance value using common field&lt;/P&gt;&lt;P&gt;READ TABLE IT_FINAL1 WITH KEY BUKRS =  IT_FINAL_NEW-BUKRS INTO WA.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*assign balance value to final destination balance field&lt;/P&gt;&lt;P&gt;IT_FINAL_DIS-balance = wa-balance.&lt;/P&gt;&lt;P&gt;*append the it &lt;/P&gt;&lt;P&gt;APPEND IT_FINAL_DIS.&lt;/P&gt;&lt;P&gt;*now u got the values from 2 internal tables&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;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Meera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Apr 2011 16:43:38 GMT</pubDate>
    <dc:creator>former_member463524</dc:creator>
    <dc:date>2011-04-20T16:43:38Z</dc:date>
    <item>
      <title>merging data without primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828747#M1589750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hiii,&lt;/P&gt;&lt;P&gt;I have 2 internal tables "it_final1" and "It_final_new" and i want to join both tables.&lt;/P&gt;&lt;P&gt;both have same fields like BUKRS,GJAHR,SAKNR.&lt;/P&gt;&lt;P&gt;for IT_FINAL1 i am using "BAPI_GL_GETGLACCPERIODBALANCES" FM to get data.&lt;/P&gt;&lt;P&gt;now i need to merge this.&lt;/P&gt;&lt;P&gt;Please explain ...&lt;/P&gt;&lt;P&gt;i am using below logic for that.&lt;/P&gt;&lt;P&gt;LOOP AT IT_FINAL_NEW .&lt;/P&gt;&lt;P&gt;  IF sy-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING IT_FINAL_NEW to IT_FINAL_DIS.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;read table it_final1 with key bukrs = it_final_new-bukrs&lt;/P&gt;&lt;P&gt;                                             gjahr = it_final_new-gjahr.&lt;/P&gt;&lt;P&gt;move-corresponding it_final1 to it_final_dis.&lt;/P&gt;&lt;P&gt;APPEND IT_FINAL_DIS.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 07:43:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828747#M1589750</guid>
      <dc:creator>former_member476503</dc:creator>
      <dc:date>2011-04-19T07:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: merging data without primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828748#M1589751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Sanket&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_FINAL_NEW  into wa_it_final.&lt;/P&gt;&lt;P&gt;read table it_final1 into wa_it_final with key bukrs = it_final_new-bukrs&lt;/P&gt;&lt;P&gt;                                                                       gjahr = it_final_new-gjahr.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move: wa_final-bukrs to wa_final_dis-bukrs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       and so on all the fields.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND wa_it_final_dis to IT_FINAL_DIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 09:01:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828748#M1589751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-19T09:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: merging data without primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828749#M1589752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi anjali ,&lt;/P&gt;&lt;P&gt;thanks for replying.&lt;/P&gt;&lt;P&gt;I have already tried that.&lt;/P&gt;&lt;P&gt;but the problem is i can fetch only any 1 internal table data in FINAL_DIS.&lt;/P&gt;&lt;P&gt;My output has to display like this&lt;/P&gt;&lt;P&gt;A/C-AA1-AA2-AA3-AA4-TOTAL-BALANCE&lt;/P&gt;&lt;P&gt;101-1000-200-0000-0000-01200-001200&lt;/P&gt;&lt;P&gt;201-0000-200-3000-0000-03200-03200&lt;/P&gt;&lt;P&gt;301-0000-200-0000-1000-01200-01200&lt;/P&gt;&lt;P&gt;401-0000-200-0000-0000-00200-00200&lt;/P&gt;&lt;P&gt;501-2000-200-0000-0000-02200-02200&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In IT_FINAL_new i am fetching A/C to total.&lt;/P&gt;&lt;P&gt;In it_final1 i am fetching balance with using FM described above.&lt;/P&gt;&lt;P&gt;Both have same A/C no,comp. code,fisc. year.and total and balance are same.&lt;/P&gt;&lt;P&gt;now i need to fetch in one table.but i can only fetch any 1 internal table data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 09:19:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828749#M1589752</guid>
      <dc:creator>former_member476503</dc:creator>
      <dc:date>2011-04-19T09:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: merging data without primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828750#M1589753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi anjali ,&lt;/P&gt;&lt;P&gt;thanks for replying.&lt;/P&gt;&lt;P&gt;I have already tried that.&lt;/P&gt;&lt;P&gt;but the problem is i can fetch only any 1 internal table data in FINAL_DIS.&lt;/P&gt;&lt;P&gt;My output has to display like this&lt;/P&gt;&lt;P&gt;A/C-AA1-AA2-AA3-AA4-TOTAL-BALANCE&lt;/P&gt;&lt;P&gt;101-1000-200-0000-0000-01200-001200&lt;/P&gt;&lt;P&gt;201-0000-200-3000-0000-03200-03200&lt;/P&gt;&lt;P&gt;301-0000-200-0000-1000-01200-01200&lt;/P&gt;&lt;P&gt;401-0000-200-0000-0000-00200-00200&lt;/P&gt;&lt;P&gt;501-2000-200-0000-0000-02200-02200&lt;/P&gt;&lt;P&gt;In IT_FINAL_new i am fetching A/C to total.&lt;/P&gt;&lt;P&gt;In it_final1 i am fetching balance with using FM described above.&lt;/P&gt;&lt;P&gt;Both have same A/C no,comp. code,fisc. year.and total and balance are same.&lt;/P&gt;&lt;P&gt;now i need to fetch in one table.but i can only fetch any 1 internal table data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 09:21:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828750#M1589753</guid>
      <dc:creator>former_member476503</dc:creator>
      <dc:date>2011-04-19T09:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: merging data without primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828751#M1589754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naranjat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if i really got your requirement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but generally merging data can be achieved by using COLLECT statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT table_new
   INTO workarea_new.

  READ TABLE table_balances
    INTO workarea_balances
    WITH KEY xxx = workarea_new-xxx.

* merge data
  COLLECT workarea_balances INTO table_new.

* append data
  APPEND workarea_balances TO table_new.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reagards&lt;/P&gt;&lt;P&gt;REA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 10:24:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828751#M1589754</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-19T10:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: merging data without primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828752#M1589755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi REA,&lt;/P&gt;&lt;P&gt;I have described my logic above.&lt;/P&gt;&lt;P&gt;I have tried that but its not working.&lt;/P&gt;&lt;P&gt;both table have same fields like BUKRS,GJAHR,SAKNR.&lt;/P&gt;&lt;P&gt;still i cant connect both tables.&lt;/P&gt;&lt;P&gt;Actually I need 1 field(BALANCE) which is based FM"BAPI"which i described above.&lt;/P&gt;&lt;P&gt;which i have fetched in internal table IT_FINAL1 and others in IT_FINAL_NEW1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 04:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828752#M1589755</guid>
      <dc:creator>former_member476503</dc:creator>
      <dc:date>2011-04-20T04:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: merging data without primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828753#M1589756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanket,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you please give an example of the contents that have to be merged as well as the merged content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;REA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ramy El-Arnaouty on Apr 20, 2011 2:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 12:20:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828753#M1589756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-20T12:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: merging data without primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828754#M1589757</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;Please try the following,&lt;/P&gt;&lt;P&gt;*Looping at final_new which has all fields except gjahr&lt;/P&gt;&lt;P&gt;LOOP AT IT_FINAL_NEW .&lt;/P&gt;&lt;P&gt;*move wa to destination wa&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING IT_FINAL_NEW to IT_FINAL_DIS.&lt;/P&gt;&lt;P&gt;*read internal table having balance value using common field&lt;/P&gt;&lt;P&gt;READ TABLE IT_FINAL1 WITH KEY BUKRS =  IT_FINAL_NEW-BUKRS INTO WA.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*assign balance value to final destination balance field&lt;/P&gt;&lt;P&gt;IT_FINAL_DIS-balance = wa-balance.&lt;/P&gt;&lt;P&gt;*append the it &lt;/P&gt;&lt;P&gt;APPEND IT_FINAL_DIS.&lt;/P&gt;&lt;P&gt;*now u got the values from 2 internal tables&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;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Meera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 16:43:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828754#M1589757</guid>
      <dc:creator>former_member463524</dc:creator>
      <dc:date>2011-04-20T16:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: merging data without primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828755#M1589758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SOLVED&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 05:55:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-data-without-primary-key/m-p/7828755#M1589758</guid>
      <dc:creator>former_member476503</dc:creator>
      <dc:date>2011-04-21T05:55:02Z</dc:date>
    </item>
  </channel>
</rss>

