<?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: how to display data from two db table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696277#M1294150</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi alok srivastava,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   As per the requirements and from what tables we are fetching data will make us to decide whether can be done with out Nesting Loops or Not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  So, try to breif your issue for better solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suneel G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Jun 2009 08:45:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-09T08:45:48Z</dc:date>
    <item>
      <title>how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696274#M1294147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to display multiple records  from two internal table without using nesting of loop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:36:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696274#M1294147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T08:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696275#M1294148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;use joins,to get data from different tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vbak~vbeln&lt;/P&gt;&lt;P&gt;       vbak~vkorg&lt;/P&gt;&lt;P&gt;      vbap~posnr&lt;/P&gt;&lt;P&gt;       vbap~matnr&lt;/P&gt;&lt;P&gt;INTO TABLE t_vbak&lt;/P&gt;&lt;P&gt;FROM vbak AS vbak&lt;/P&gt;&lt;P&gt;INNER JOIN vbap AS vbap&lt;/P&gt;&lt;P&gt;ON vbak&lt;SUB&gt;vbeln = vbap&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;WHERE vbak~auart = p_auart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jaya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jayapradha Neeli on Jun 9, 2009 2:13 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:42:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696275#M1294148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T08:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696276#M1294149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to take data(split 2 into 3)  in another internal table  in such a way that one LOOP statement followed by subsequent READ statements work .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:45:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696276#M1294149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T08:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696277#M1294150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi alok srivastava,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   As per the requirements and from what tables we are fetching data will make us to decide whether can be done with out Nesting Loops or Not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  So, try to breif your issue for better solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suneel G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:45:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696277#M1294150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T08:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696278#M1294151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By using LOOP and READ statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An ex; here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at tb_STAB.
      read table tb_SOSTAB  WITH KEY ebeln = tb_STAB-ebeln.
      if sy-subrc eq 0.
        write :/2 tB_STAB-ebeln color 4,
                20 lv_msg2 color 5,
                70 tb_SOSTAB-vbeln color 4,
                100 lv_msg3  color 5.
      endif.
    endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl. search, you'll find more results here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:47:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696278#M1294151</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-06-09T08:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696279#M1294152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi jaya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; you are not getting my point actually i want to show rrecord from two internal tables without using nesting of loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible but how?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:47:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696279#M1294152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T08:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696280#M1294153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If u dont want to use nested loop, u can do it via READ statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foe example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;write the content of 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;write the content of itab2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sheelesh on Jun 9, 2009 2:19 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:49:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696280#M1294153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T08:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696281#M1294154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok i agree from u. but when u would show multiple records from two internal tables then how will u display without using nested loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696281#M1294154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T08:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696282#M1294155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but we use read statement  for only one record if we want to show multiple records from second table &lt;/P&gt;&lt;P&gt;then what should i do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:54:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696282#M1294155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T08:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696283#M1294156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;better to use for all entries instead of inner joins to add two more tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt;field names&amp;gt; into table &amp;lt;itab1&amp;gt; from &amp;lt;databasetable 1&amp;gt;&lt;/P&gt;&lt;P&gt;where&amp;lt;condition&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab[] is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt;field names&amp;gt; into table &amp;lt;itab2&amp;gt; from &amp;lt;databasetable 2&amp;gt;&lt;/P&gt;&lt;P&gt;for all entries in &amp;lt;itab1&amp;gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;condition&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally need to display in one table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loo at itab1.&lt;/P&gt;&lt;P&gt;read table &amp;lt;itab2&amp;gt; wiht key &amp;lt;condition&amp;gt;&lt;/P&gt;&lt;P&gt;itab1-fieldnames = itab2-fieldnames&lt;/P&gt;&lt;P&gt;modify itab1 transporting &amp;lt;new fields&amp;gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:55:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696283#M1294156</guid>
      <dc:creator>venkatasriram_mygapula</dc:creator>
      <dc:date>2009-06-09T08:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696284#M1294157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Suppose you want to select records from the SPFLI  and  SBOOK .To do that  - -&lt;/P&gt;&lt;P&gt;1 )  In Join condition select the records from the booth table  like - -&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS : p_carrid TYPE spfli-carrid.  " parameter that will be used in WHERE condition
DATA : BEGIN OF fs_itab,
         mandt TYPE spfli-mandt,
         carrid TYPE spfli-carrid,
         connid TYPE spfli-connid,
         countryfr TYPE spfli-countryfr,
         customid  TYPE sbook-customid,
      END OF fs_itab,
      t_itab LIKE TABLE OF fs_itab .  " Table to hold the data

SELECT
           spfli~mandt  " Fields from SPFLI
           spfli~carrid
           spfli~connid
           spfli~countryfr
           sbook~customid   " Fields from SBOOK

           FROM spfli INNER JOIN sbook  " Inner join of the tables
           ON spfli~carrid = sbook~carrid AND  " Join condition according to ur requirement
              spfli~connid = sbook~connid         " Join condition
              INTO TABLE t_itab
              WHERE spfli~carrid = p_carrid .  " Where condition
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; According to your requirement you can use the &lt;STRONG&gt;OUTER JOIN&lt;/STRONG&gt; also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR ELSE FOLLOW the 2nd -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;2)  Create a view with the required fields of both the table .&lt;/P&gt;&lt;P&gt;     Then use the view in the select .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 08:59:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696284#M1294157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T08:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696285#M1294158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If ur second internal table has multiple records then you have to process these records in loop because in a single process you can write multiple records of second table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use do enddo statement here to write the multiple records or process them via using nested loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1&lt;/P&gt;&lt;P&gt;write records from itab1.&lt;/P&gt;&lt;P&gt;do&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;write ur records.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 09:04:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696285#M1294158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-09T09:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696286#M1294159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz do as following-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data tabix like sy-tabix.&lt;/P&gt;&lt;P&gt;Sort itab1 by field1.&lt;/P&gt;&lt;P&gt;Sort itab2 by field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transfer the contents of table itab1 to corresponding field of table itab2 according to their key fields. &lt;/P&gt;&lt;P&gt;then use the write statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab2.&lt;/P&gt;&lt;P&gt;tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;  read table itab1 with key field1 = itab2-field1 binary search. &lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*move the fields from itab1 to itab2.&lt;/P&gt;&lt;P&gt;  move-corresponding fields of table itab1 to itab2.   " (field1 to field10 belongs to itab1)&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify itab2 index tabix. &lt;/P&gt;&lt;P&gt;  write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; itab2-field1,  itab2-field2,  ........ itab2-field10,  itab2-field11,  ................ itab20-field. &lt;/P&gt;&lt;P&gt;clear: itab1, itab2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or u can also use third table itab3 which has the fields from both the tables ie. itab1, itab2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: madan namdeo on Jun 9, 2009 11:26 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 09:23:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696286#M1294159</guid>
      <dc:creator>former_member188686</dc:creator>
      <dc:date>2009-06-09T09:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to display data from two db table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696287#M1294160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;good&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2009 07:29:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-display-data-from-two-db-table/m-p/5696287#M1294160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-02T07:29:09Z</dc:date>
    </item>
  </channel>
</rss>

