<?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: Program goes in Infinite loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119405#M1707591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I used AS key but its still not helping. And what other method can i use instead of join? Can you give an example .There are four tables from which i need to fetch data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Nov 2012 10:32:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-11-23T10:32:16Z</dc:date>
    <item>
      <title>Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119400#M1707586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; HI all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement in which i need to fetch data from various tables. The relation is for 3 fields from bkpf i need to fetch corresponding data from bsid and bsad tables and from these need to fetch data from kna1 and knvv tables.&lt;/P&gt;&lt;P&gt;i tried d select querry with bkpf inner joining bsid/bsad then bsid inner joining kna1 (on field kunnr) and kna1 inner joining knvv (for field kunnr). But on execution it goes in infinite loop. Can u guys pls help me out with this.&lt;/P&gt;&lt;P&gt;This is the table created and the select querry:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_open_items,&lt;/P&gt;&lt;P&gt;bukrs type BKPF-BUKRS,&lt;/P&gt;&lt;P&gt;gjahr type BKPF-GJAHR,&lt;/P&gt;&lt;P&gt;monat type BKPF-MONAT,&lt;/P&gt;&lt;P&gt;belnr type BKPF-BELNR,&lt;/P&gt;&lt;P&gt;blart TYPE BSID-BLART,&lt;/P&gt;&lt;P&gt;bldat TYPE BSID-BLDAT,&lt;/P&gt;&lt;P&gt;* netdt TYPE BSID-NETDT,&lt;/P&gt;&lt;P&gt;augdt TYPE BSID-AUGDT,&lt;/P&gt;&lt;P&gt;wrbtr TYPE BSID-WRBTR,&lt;/P&gt;&lt;P&gt;hwaer type BKPF-HWAER,&lt;/P&gt;&lt;P&gt;augbl type BSID-AUGBL,&lt;/P&gt;&lt;P&gt;ktokd type KNA1-KTOKD,&lt;/P&gt;&lt;P&gt;kdgrp type KNVV-KDGRP,&lt;/P&gt;&lt;P&gt;zfbdt type BSID-ZFBDT,&lt;/P&gt;&lt;P&gt;zterm type BSID-ZTERM,&lt;/P&gt;&lt;P&gt;end of ty_open_items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT bkpf~bukrs bkpf~gjahr bkpf~monat bkpf~belnr bsid~blart bsid~bldat bsid~augdt bsid~wrbtr bkpf~hwaer bsid~augbl kna1~ktokd knvv~kdgrp bsid~zfbdt bsid~zterm&lt;/P&gt;&lt;P&gt;from ( bkpf INNER JOIN bsid on bkpf~bukrs = bsid~bukrs&lt;/P&gt;&lt;P&gt;INNER JOIN kna1 on bsid~kunnr = kna1~kunnr&lt;/P&gt;&lt;P&gt;INNER JOIN knvv on kna1~kunnr = knvv~kunnr )&lt;/P&gt;&lt;P&gt;into TABLE int_open_items&lt;/P&gt;&lt;P&gt;where bkpf~bukrs IN s_bukrs&lt;/P&gt;&lt;P&gt;and bkpf~gjahr IN s_gjahr&lt;/P&gt;&lt;P&gt;and bkpf~monat IN s_monat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 08:52:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119400#M1707586</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-23T08:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119401#M1707587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are joining three tables. Only thing I doubt is how can we play joining a Accounting Tables.&lt;/P&gt;&lt;P&gt;Better you can write the Select For All Entries.&lt;/P&gt;&lt;P&gt;or Use Cursor in the Selects. So that you may skip time out errors. Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 09:03:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119401#M1707587</guid>
      <dc:creator>Venkat_Sesha</dc:creator>
      <dc:date>2012-11-23T09:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119402#M1707588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;bkpf INNER JOIN bsid on bkpf~bukrs = bsid~bukrs&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm sure you can give a better join criteria &lt;SPAN __jive_emoticon_name="devil" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/1079/images/emoticons/devil.gif"&gt;&lt;/SPAN&gt; (hint: look for primary keys of BSEG) as you are joining every records of document header of on society with every records of customer records, not an infinite loop at all, but with some millions records per company in both tables that would give a very very very big chunk of data (millions of millions of records...) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 09:07:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119402#M1707588</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2012-11-23T09:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119403#M1707589</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;You got to avoid working with inner joins to help performance. But if you are forced to make sure you join on primary key fields and reduce the number of joins using for all entries on few tables. &lt;/P&gt;&lt;P&gt;Here in particular you havent mentioned the AS keyword in your select to declare the reference variable for your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT bkpf~bukrs bkpf~gjahr bkpf~monat bkpf~belnr bkpf~hwaer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bsid~blart bsid~bldat bsid~augdt bsid~wrbtr bsid~augbl bsid~zfbdt bsid~zterm &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kna1~ktokd &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; knvv~kdgrp &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from bkpf AS bkpf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN bsid AS bsid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on bkpf~bukrs = bsid~bukrs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vidya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 09:28:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119403#M1707589</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-23T09:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119404#M1707590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dharmin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is helpfull solution for you ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whenever we want fetch the data from multiple table then we should always use to&amp;nbsp; FOR ALL ENTRIES &lt;/P&gt;&lt;P&gt;BECAZ&amp;nbsp; we can minimize the server load&amp;nbsp; otherwise server&amp;nbsp; load can be more if we wil use the inner join . innerjoin use only for two table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This helpfull code for you ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select&amp;nbsp; f1 f2&amp;nbsp; f3 from bkpf into table&amp;nbsp; it_bkpf&amp;nbsp;&amp;nbsp; where bukrs =&amp;nbsp; p_bukrs .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&amp;nbsp; it_bkpf [] is not&amp;nbsp; initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select fa1 fa2 fa3 from bsid&amp;nbsp; into table&amp;nbsp; it_bsid &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR ALL ENTRIES IN BKPF &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&amp;nbsp; bukrs = it_bsid-bukrs&amp;nbsp; and kunnr = it_bsid-kunnr .&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;if it_bsid[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select fb1 fb2 fb3 from bsad&amp;nbsp; into table it_bsad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR&amp;nbsp; ALL ENTRIES&amp;nbsp; IN&amp;nbsp;&amp;nbsp; IT_BSID &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&amp;nbsp; bukrs = it_bsad-bukrs and kunnr = it_bsad .&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;if it_bsad[] is not initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select fc1 fc2 fc3 from kna1 into table it_kna1 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR ALL ENTRIES&amp;nbsp; IN&amp;nbsp;&amp;nbsp; IT_BSAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where kunnr = it_kna1-kunnr .&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;Above I&amp;nbsp; written the code .. I&amp;nbsp; not given the field name you can make field name regarding ur&amp;nbsp; need &lt;/P&gt;&lt;P&gt;i defined it_bkpf , it_bsid , it_bsad , it_kna1&amp;nbsp; its internal table&amp;nbsp; type . when u&amp;nbsp; wil write the code plz firstly declaration itab and workarea . this code is take minimum time for executing compare to inner join . that's y&amp;nbsp; FOR ALL ENTRIE&amp;nbsp; ALWAYS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BETTER FOR FETCHING THE DATA FROM MULTIPLE TABLE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;lt;&amp;lt;&amp;lt; Do not ask for points ... Read the forum rules &amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suraj singh &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kesavadas Thekkillath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 10:08:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119404#M1707590</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-23T10:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119405#M1707591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I used AS key but its still not helping. And what other method can i use instead of join? Can you give an example .There are four tables from which i need to fetch data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 10:32:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119405#M1707591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-23T10:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119406#M1707592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI suraj,&lt;/P&gt;&lt;P&gt;But then how can i get all the data in one list. i.e i need to get all the data in the structure which i declared ty_open_items.?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 10:40:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119406#M1707592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-23T10:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119407#M1707593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp; Dharmin , firstly u declare type&amp;nbsp; groups&amp;nbsp;&amp;nbsp; for each table field according to ur need . &lt;/P&gt;&lt;P&gt;after that u make one final itab&amp;nbsp; with&amp;nbsp;&amp;nbsp; declare the types group ty_open_items&amp;nbsp; according to&amp;nbsp; the whatever field define all the types groupds for all table field . where we can store all data from diffrent tables .&lt;/P&gt;&lt;P&gt;then &lt;/P&gt;&lt;P&gt;after select query u have to use the loop for&amp;nbsp; store the all type groups field into ty_open_item by&amp;nbsp; final itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some code&amp;nbsp; for help full .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types group for first table field &lt;/P&gt;&lt;P&gt;types: begin of ty_bkpf,&lt;/P&gt;&lt;P&gt; f1 type bkpf-f1,&lt;/P&gt;&lt;P&gt; f2 type bkpf-f2,&lt;/P&gt;&lt;P&gt;end of ty_bkpf.&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;n&amp;nbsp; ...types&amp;nbsp; group&amp;nbsp; &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;as like&amp;nbsp; u have to declare types group&amp;nbsp; for all table field . after declaraion of all type groups then u have to declare one ty_open_items type groups and nd get the field&amp;nbsp; from above define types group ..&lt;/P&gt;&lt;P&gt;nd declare the final itab .&lt;/P&gt;&lt;P&gt;in which all data wil be stroe &lt;/P&gt;&lt;P&gt;as like &lt;/P&gt;&lt;P&gt;data: it_final type ty_open_items .&lt;/P&gt;&lt;P&gt;data: wa_final like line of it_final .&lt;/P&gt;&lt;P&gt;after fetching the data by using for all entries &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop it_bkpf into wa_bkpf &lt;/P&gt;&lt;P&gt;loop it_bsid into wa_bsid&amp;nbsp; where&amp;nbsp; bukrs = wa_bkpf-bukrs.&lt;/P&gt;&lt;P&gt;loop it_bsad into wa_bsad where bukrs&amp;nbsp; = wa_bsid-bukrs and kunnr = wa_bsid-kunnr .&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; wa_final-bukrs = wa_bkpf-bukrs.&lt;/P&gt;&lt;P&gt;&amp;nbsp; wa_final-kunnr = wa_bsid-kunnr .&lt;/P&gt;&lt;P&gt;&amp;nbsp; .........&lt;/P&gt;&lt;P&gt; .......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop it_final into wa_final&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here u can&amp;nbsp; use&amp;nbsp; write statement for&amp;nbsp;&amp;nbsp; display the data&amp;nbsp; on selection screen .&lt;/P&gt;&lt;P&gt;endloop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all the data will store in ty_open_items .and display the only single list display .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 11:13:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119407#M1707593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-23T11:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119408#M1707594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please ignore all "avoid joins, use FAE" type of misleading advice. It's an uphill struggle against huge windmills that we will never win.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Raymond indicated, make sure you construct your joins properly, most importantly with ON conditions that make full use of primary or secondary indexes, otherwise your result set and/or response time will explode.&lt;/P&gt;&lt;P&gt;Also the WHERE-conditions applied to the whole lot are important, same thing with using qualified indexes whenever possible.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;BKPF and BSID must be joined using BUKRS, BELNR and GJAHR. You might not need BKPF at all, at quick glance all information you require is also in BSID (edit: except HWAER...). For BSID and KNA1, KUNNR is sufficient. KNVV has VKORG, VTWEG and SPART as additional key fields, I don't see a way to join this properly, as BSID does not offer these. Do you really need KDGRP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 12:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119408#M1707594</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2012-11-23T12:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119409#M1707595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well yes KDRGP is needed..nd so is HWAER.which brings BKPF in picture. For joining BKPF nd BSID i tried using BELNR but it still is the same.Even using KUNNR in joining condition vl increase no. of records..so how would it b done other then joins..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Nov 2012 19:33:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119409#M1707595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-24T19:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119410#M1707596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't fin it yourself, you MUST join BKPF and BSEG, BSID, BSIS or any similar table with the full primary key of the document header BKPF : so BUKRS &lt;STRONG&gt;and&lt;/STRONG&gt; BELNR &lt;STRONG&gt;and&lt;/STRONG&gt; GJAHR are required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For KNVV it is more difficult and may depend on your customizing. You can find it via the actual invoice, VBRK information, where VBRK-VBELN = BKPF-AWKEY if BKPF-AWTYP = 'VBRK'. Else this link can not exist. e.g. a payment document may not have enough information to get this information, then ask functional to get more information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Nov 2012 19:44:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119410#M1707596</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2012-11-24T19:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119411#M1707597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi suraj,&lt;/P&gt;&lt;P&gt;I tried this but it still goes in dat infinite stage i.e keeps on loading..&lt;/P&gt;&lt;P&gt;is it due to the loop within loop within loop statements..? And i even need to map net due dates which i included in last loop statements..so there are four loop statements..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 11:09:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119411#M1707597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-26T11:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119412#M1707598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dharmin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may use this easiest and effective approach to fetch your required data.&lt;/P&gt;&lt;P&gt;as a part of your beginning work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it's a different thing that you have loads of alternate and advance way to achieve&lt;/P&gt;&lt;P&gt;the result .. at your enough time you can workout on the same to enhance your code for performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Create internal table from all required fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) join only tables bkpf,bsid,bsad in nternal table ( use into corresponding).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) loop at internal table.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; using where &amp;lt;kna1-field&amp;gt; = internal table field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; using where &amp;lt;knvv-field&amp;gt; = internal table field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; modify internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Avirat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 12:17:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119412#M1707598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-26T12:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119413#M1707599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dharmin&lt;/P&gt;&lt;P&gt; Can u explain , how many table&amp;nbsp;&amp;nbsp; and field you are using for fetch the data .&lt;/P&gt;&lt;P&gt; whats ur exactly requirments.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 06:39:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119413#M1707599</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-03T06:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119414#M1707600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi suraj,&lt;/P&gt;&lt;P&gt;i m using four tables bkpf,bsid,kna1 and knvv to fetch data. Now i need to join this four tables which i guess would slow down d code. so i needed help on how to join them using For all entries concept&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 13:46:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119414#M1707600</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-10T13:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Program goes in Infinite loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119415#M1707601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dharmin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this solution helpful for you ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select&amp;nbsp; KUNNR LAND1 NAME1 from kna1 where kna1 = p_kna1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it_kna1 is not initial [].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select KUNNR&amp;nbsp;&amp;nbsp; BUKRS BEGRU from knb1 for all entries&amp;nbsp; IN IT_Kna1&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&amp;nbsp;&amp;nbsp; KUNNR = IT_KNA1-KUNNR.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF IT_KNb1 IS NOT INITIAL [].&lt;/P&gt;&lt;P&gt;select&amp;nbsp; BUKRS KUNNR GJAHR WAERS from bsid&amp;nbsp; for all entries in it_knb1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where kunnr = it_knb1-kunnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if it_bsid is not initial [].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select BUKRS BELNR GJAHR from bkpf for all entries in it_bsid &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where bukrs = it_bsid-bukrs .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by using above query you can featch the data from among the table .&lt;/P&gt;&lt;P&gt;if this is helpful solution for you then I shall be happy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and Regards&lt;/P&gt;&lt;P&gt;Suraj singh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 04:48:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-goes-in-infinite-loop/m-p/9119415#M1707601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-18T04:48:17Z</dc:date>
    </item>
  </channel>
</rss>

