<?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 QUERY in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/2192314#M467491</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 following select statements. i had to get the out put as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pspid posid banfn ebeln lblni.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my select queries are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select pspid werks from proj into table p_proj.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select posid werks from prps into table p_prps for all entries in p_proj where werks = p_proj-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select banfn werks lblni from eban into table p_eban for all entries in p_prps where werks = p_prps-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lblni ebeln banfn from essr into table p_essr for all entries in p_eban where lblni = p_eban-lblni.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ebeln from ekko into table p_ekko for all entries in p_essr where ebeln = p_essr-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thing is i need to loop them to get output as mentioned above,can any body provide me code for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Apr 2007 05:11:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-21T05:11:49Z</dc:date>
    <item>
      <title>QUERY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/2192314#M467491</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 following select statements. i had to get the out put as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pspid posid banfn ebeln lblni.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my select queries are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select pspid werks from proj into table p_proj.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select posid werks from prps into table p_prps for all entries in p_proj where werks = p_proj-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select banfn werks lblni from eban into table p_eban for all entries in p_prps where werks = p_prps-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lblni ebeln banfn from essr into table p_essr for all entries in p_eban where lblni = p_eban-lblni.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ebeln from ekko into table p_ekko for all entries in p_essr where ebeln = p_essr-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thing is i need to loop them to get output as mentioned above,can any body provide me code for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2007 05:11:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/2192314#M467491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-21T05:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: QUERY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/2192315#M467492</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;&amp;lt;b&amp;gt;loop at p_proj.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  write: p_proj-pspid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  read table p_prps with key werks = p_proj-werks.&lt;/P&gt;&lt;P&gt;  if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;    write: p_prps-posid.&lt;/P&gt;&lt;P&gt;    delete table p_prps index sy-tabix.&lt;/P&gt;&lt;P&gt;    read table p_eban with key werks = p_prps-werks.&lt;/P&gt;&lt;P&gt;      if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;      write: p_eban-banfn.&lt;/P&gt;&lt;P&gt;        delete table p_eban index sy-tabix.&lt;/P&gt;&lt;P&gt;      read table  p_essr with key lblni = p_eban-lblni.&lt;/P&gt;&lt;P&gt;         if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;         write: p_essr-lblni.     &lt;/P&gt;&lt;P&gt;        delete table p_essr index sy-tabix.&lt;/P&gt;&lt;P&gt;        read table  p_ekko with key ebeln = p_essr-ebeln.&lt;/P&gt;&lt;P&gt;        if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;        write: p_ekko-ebeln.&lt;/P&gt;&lt;P&gt;        delete table p_ekko index sy-tabix.&lt;/P&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;write: /.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endloop. &amp;lt;/b&amp;gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of multile selects write a &amp;lt;b&amp;gt;two Inner Join statements&amp;lt;/b&amp;gt; which will make ur problem much easy....&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;/P&gt;&lt;P&gt;select lblni ebeln banfn from essr into table p_essr for all entries in p_eban where lblni = p_eban-lblni.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ebeln from ekko into table p_ekko for all entries in p_essr where ebeln = p_essr-ebeln.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2007 09:25:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/2192315#M467492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-21T09:25:45Z</dc:date>
    </item>
  </channel>
</rss>

