<?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: select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577221#M260589</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; try to change "into table it_knvp" to&lt;/P&gt;&lt;P&gt;"appending corresponding field of table it_knvp".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Achim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Achim Fork&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Sep 2006 13:07:22 GMT</pubDate>
    <dc:creator>AFork</dc:creator>
    <dc:date>2006-09-13T13:07:22Z</dc:date>
    <item>
      <title>select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577220#M260588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to extrace data from a Data Base table depending on somw where sonditions.&lt;/P&gt;&lt;P&gt;I have an internal table it_bsid and it_knvp. it_bsid already has data and it has a fiels vbeln and it_bsid-vbeln is some times empty.&lt;/P&gt;&lt;P&gt;If it_bsid-vbeln is empty i have to get data into it_knvp.&lt;/P&gt;&lt;P&gt;below is the code but i am getting syntax errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT kunnr&lt;/P&gt;&lt;P&gt;           parvw&lt;/P&gt;&lt;P&gt;           kunn2&lt;/P&gt;&lt;P&gt;      INTO TABLE it_knvp&lt;/P&gt;&lt;P&gt;      FROM knvp&lt;/P&gt;&lt;P&gt;       FOR ALL ENTRIES IN it_bsid&lt;/P&gt;&lt;P&gt;     WHERE it_bsid-vbeln is null and &lt;/P&gt;&lt;P&gt;           kunnr EQ it_bsid-kunnr and &lt;/P&gt;&lt;P&gt;           ( parvw EQ 'AG' OR parvw EQ 'RE').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Advice.&lt;/P&gt;&lt;P&gt;Shejal Shetty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:02:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577220#M260588</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T13:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577221#M260589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; try to change "into table it_knvp" to&lt;/P&gt;&lt;P&gt;"appending corresponding field of table it_knvp".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Achim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Achim Fork&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:07:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577221#M260589</guid>
      <dc:creator>AFork</dc:creator>
      <dc:date>2006-09-13T13:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577222#M260590</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;the table that is used in 'FOR ALL ENTRIES' in your case &amp;lt;b&amp;gt;it_bsid&amp;lt;/b&amp;gt; cannot not have any where condition on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This means that in where condition you cannot place any selection criteria on the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;it_bsid-vbeln is null&amp;lt;/b&amp;gt; &amp;lt;-- this is wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess it would be better if you filter out the internal table and store some data in where vbeln is blank in another internal table and have nonblank entries in this table and then fire seperate select queries for both.&lt;/P&gt;&lt;P&gt;Message was edited by: Nishant Rustagi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:07:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577222#M260590</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T13:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577223#M260591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT kunnr&lt;/P&gt;&lt;P&gt;parvw&lt;/P&gt;&lt;P&gt;kunn2&lt;/P&gt;&lt;P&gt;INTO TABLE it_knvp&lt;/P&gt;&lt;P&gt;FROM knvp&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN it_bsid&lt;/P&gt;&lt;P&gt;WHERE &amp;lt;u&amp;gt;it_bsid-vbeln is null&amp;lt;/u&amp;gt; and &lt;/P&gt;&lt;P&gt;kunnr EQ it_bsid-kunnr and &lt;/P&gt;&lt;P&gt;( parvw EQ 'AG' OR parvw EQ 'RE').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U cannot have the above condition in the select. If you take that out it would work fine...sure you would have more data than required in it_knvp table. Other wise you can do the below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab[] = it_bsid[].&lt;/P&gt;&lt;P&gt;delete itab where itab-vbeln is not null.&lt;/P&gt;&lt;P&gt;sort itab by kunnr.&lt;/P&gt;&lt;P&gt;delete adjacent duplicate comparing kunnr.&lt;/P&gt;&lt;P&gt;SELECT kunnr&lt;/P&gt;&lt;P&gt;parvw&lt;/P&gt;&lt;P&gt;kunn2&lt;/P&gt;&lt;P&gt;INTO TABLE it_knvp&lt;/P&gt;&lt;P&gt;FROM knvp&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN itab&lt;/P&gt;&lt;P&gt;WHERE kunnr EQ itab-kunnr and &lt;/P&gt;&lt;P&gt;( parvw EQ 'AG' OR parvw EQ 'RE').&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:08:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577223#M260591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T13:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577224#M260592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tnamks Guys, &lt;/P&gt;&lt;P&gt;I will try and let see what the results are.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shejal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:14:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577224#M260592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T13:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577225#M260593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shejal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is another way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: knvp. "(include knvp in the tables statement)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort it_bsid by vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bsid where vbeln is initial.&lt;/P&gt;&lt;P&gt;select single kunnr parvw kunn2  &lt;/P&gt;&lt;P&gt;       from knvp where kunnr eq it_bsid-kunnr &lt;/P&gt;&lt;P&gt;       and ( parvw EQ 'AG' OR parvw EQ 'RE' ).&lt;/P&gt;&lt;P&gt;move knvp-kunnr to it_knvp-kunnr.&lt;/P&gt;&lt;P&gt;move knvp-parvw to it_knvp-parvw.&lt;/P&gt;&lt;P&gt;move knvp-kunn2 to it_knvp-kunn2.&lt;/P&gt;&lt;P&gt;append it_knvp.&lt;/P&gt;&lt;P&gt;clear it_knvp.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performance wise, this might take more time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:50:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1577225#M260593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T13:50:48Z</dc:date>
    </item>
  </channel>
</rss>

