<?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: logic while selcting db tables. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-while-selcting-db-tables/m-p/4231871#M1010615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt; u can use the inner join.&lt;/P&gt;&lt;P&gt; use the sub queries in where cindition like WHERE field IN ( sub query)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pradeep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Aug 2008 10:24:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-06T10:24:35Z</dc:date>
    <item>
      <title>logic while selcting db tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-while-selcting-db-tables/m-p/4231869#M1010613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a itab of input file and I have seperated header records intogt_header internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : begin of gt_header&lt;/P&gt;&lt;P&gt;             Rec_type(2) TYPE c,&lt;/P&gt;&lt;P&gt;	Contol_no(50) TYPE c,&lt;/P&gt;&lt;P&gt;	Report_flag(1),&lt;/P&gt;&lt;P&gt;	Edi_tp(16) TYPE c,&lt;/P&gt;&lt;P&gt;	Cust_no(10)  TYPE c,&lt;/P&gt;&lt;P&gt;	Brand_id(4)  TYPE c,&lt;/P&gt;&lt;P&gt; 	Po_no(18)  TYPE c,&lt;/P&gt;&lt;P&gt;             Store_no(17)  Type c,&lt;/P&gt;&lt;P&gt;          END of gt_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOOP AT gt_header&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one zcustable is thereu2026&lt;/P&gt;&lt;P&gt;          SELECT cust_no from zcustable&lt;/P&gt;&lt;P&gt;		Where edi_tp = &lt;STRONG&gt;gt_header-edi_tp&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will get muitple cust_nos  here. How to put them in gt_header ?&lt;/P&gt;&lt;P&gt;Because I have to select for these multiple entries below KNVP table.&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Again I have to fetch&lt;/STRONG&gt; &lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;1                  FETCH ( kunnr ) into  itab_shipto  by Reading KNA1 table &lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;		using ( &lt;STRONG&gt;kna1-name2+7(5) =  Store Number&lt;/STRONG&gt;		     OR   J_3ASTCU = Store Number ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Again I have to fetch&lt;/STRONG&gt; &lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;2	     FETCH ship to ( kunn2 ) into  internal_tablef &lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;			from KNVP table &lt;/P&gt;&lt;P&gt;	using knvp-kunnr = &lt;STRONG&gt;multiple cust_no (header(10) record sold tos )&lt;/STRONG&gt;	and knvp u2013vkorg equal to 869_INPUT_REC_final -brand identifier &lt;/P&gt;&lt;P&gt;      and knvp-spart equal to u201802u2019&lt;/P&gt;&lt;P&gt;      and knvp-parvw  equal to u2018DEu2019 &lt;/P&gt;&lt;P&gt;      and knvp-knn2    &lt;STRONG&gt;IN itab_shipto&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;how to write the logic? Is it better to go for inner join - if so kindly help me in writing join.&lt;/P&gt;&lt;P&gt;I am not that comfortable in writing joins ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS IN ADVANCE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 19:33:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-while-selcting-db-tables/m-p/4231869#M1010613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T19:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: logic while selcting db tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-while-selcting-db-tables/m-p/4231870#M1010614</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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using loop at &amp;amp; endloop.&lt;/P&gt;&lt;P&gt;Try using for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If gt_header[] is not initial.&lt;/P&gt;&lt;P&gt;SELECT cust_no &lt;/P&gt;&lt;P&gt;             from zcustable&lt;/P&gt;&lt;P&gt;            into ita1&lt;/P&gt;&lt;P&gt;            for all entries in gt_header&lt;/P&gt;&lt;P&gt;Where edi_tp = gt_header-edi_tp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;select from other tables also as per your requirement.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am giving the inner join example, use as per your requirement bcoz am not able to get a clear view of your tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;f1 a&lt;/SUB&gt;f2&lt;/P&gt;&lt;P&gt;          b&lt;SUB&gt;f3 b&lt;/SUB&gt;f4&lt;/P&gt;&lt;P&gt;          c&lt;SUB&gt;f5 c&lt;/SUB&gt;f6&lt;/P&gt;&lt;P&gt;          into table itab&lt;/P&gt;&lt;P&gt;          from &amp;lt;table1&amp;gt; as a inner join &amp;lt;table2&amp;gt; as b&lt;/P&gt;&lt;P&gt;          on a&lt;SUB&gt;field eq b&lt;/SUB&gt;field&lt;/P&gt;&lt;P&gt;          inner join &amp;lt;table3&amp;gt; as c&lt;/P&gt;&lt;P&gt;          on  b&lt;SUB&gt;field eq c&lt;/SUB&gt;field&lt;/P&gt;&lt;P&gt;          where a~field eq &amp;lt;some value to be checked&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sharin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2008 10:04:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-while-selcting-db-tables/m-p/4231870#M1010614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-06T10:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: logic while selcting db tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-while-selcting-db-tables/m-p/4231871#M1010615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt; u can use the inner join.&lt;/P&gt;&lt;P&gt; use the sub queries in where cindition like WHERE field IN ( sub query)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pradeep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2008 10:24:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-while-selcting-db-tables/m-p/4231871#M1010615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-06T10:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: logic while selcting db tables.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-while-selcting-db-tables/m-p/4231872#M1010616</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 below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IFgt_header[] is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT cust_no &lt;/P&gt;&lt;P&gt;from zcustable&lt;/P&gt;&lt;P&gt;into i_zcustable&lt;/P&gt;&lt;P&gt;for all entries in gt_header&lt;/P&gt;&lt;P&gt;Where edi_tp = gt_header-edi_tp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT kunnr&lt;/P&gt;&lt;P&gt;                 land1&lt;/P&gt;&lt;P&gt;                 name2&lt;/P&gt;&lt;P&gt;                 INTO TABLE itab_shipto&lt;/P&gt;&lt;P&gt;                 for all entries in gt_header&lt;/P&gt;&lt;P&gt;                 WHERE kna1-name2 = gt_header-Store_no.&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;  IF not  itab_shipto[] is initial. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT kunnr&lt;/P&gt;&lt;P&gt;                   vkorg&lt;/P&gt;&lt;P&gt;                   vtweg&lt;/P&gt;&lt;P&gt;                   spart&lt;/P&gt;&lt;P&gt;                   parvw&lt;/P&gt;&lt;P&gt;                   knn2&lt;/P&gt;&lt;P&gt;                   INTO TABLE i_knvp&lt;/P&gt;&lt;P&gt;                   for all entries in  itab_shipto&lt;/P&gt;&lt;P&gt;                   WHERE knvp-kunnr =  itab_shipto-kunnr&lt;/P&gt;&lt;P&gt;                   AND       spart = u201802u2019&lt;/P&gt;&lt;P&gt;                   AND       PARVW = 'DE'.&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;if helpful rewards points.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;bhupal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2008 10:59:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-while-selcting-db-tables/m-p/4231872#M1010616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-06T10:59:48Z</dc:date>
    </item>
  </channel>
</rss>

