<?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: problem in select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764796#M330836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sort internal table and use for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort ws_it_vbrk by knumv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT KNUMV KBETR KWERT&lt;/P&gt;&lt;P&gt;FROM KONV&lt;/P&gt;&lt;P&gt;INTO TABLE WS_IT_KONV&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN WS_IT_VBRK&lt;/P&gt;&lt;P&gt;WHERE KNUMV = WS_IT_VBRK-KNUMV AND KSCHL = 'ZST1'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2006 10:24:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-06T10:24:21Z</dc:date>
    <item>
      <title>problem in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764792#M330832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a select statement wherein I donot mention DISTINCT but still the result is Distinct where as I need non-distinct values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The statement is &lt;/P&gt;&lt;P&gt;  SELECT KNUMV KBETR KWERT&lt;/P&gt;&lt;P&gt;             FROM KONV&lt;/P&gt;&lt;P&gt;             INTO TABLE WS_IT_KONV&lt;/P&gt;&lt;P&gt;             FOR ALL ENTRIES IN WS_IT_VBRK&lt;/P&gt;&lt;P&gt;             WHERE KNUMV = WS_IT_VBRK-KNUMV AND KSCHL = 'ZST1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only distinct values of KWERT are picked up where if all the values are taken then that gives the desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I collected data from KONV using SE16 by giving in KUMNV all values mentioned in WS_IT_VBRK , say 461 to 462 and KSCHL ='ZST1'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls correct me if I have understood the query wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shweta Soni.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:15:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764792#M330832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: problem in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764793#M330833</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;1 . using FOR ALL ENTRIES   might have restricted the data &lt;/P&gt;&lt;P&gt;2 . The data itself might be like that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:19:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764793#M330833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: problem in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764794#M330834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shewta , &lt;/P&gt;&lt;P&gt;  The problem is that when you use &amp;lt;b&amp;gt;for all entries&amp;lt;/b&amp;gt; , &amp;lt;u&amp;gt;duplicate entries are deleted.&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;So what i would suggest is select all the primary keys of the table KONV(KNUMV,KPOSN,STUNR,ZAEHK) into your internal table along with the already mentioned fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should serve the purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:19:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764794#M330834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: problem in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764795#M330835</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;Whenever You use "for all entries" option in your select statement, then it is mandatory to have all the key fields in the select list. then the result of the select statement will be correct. use below select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT KNUMV KPOSN STUNR ZAEHK KBETR KWERT&lt;/P&gt;&lt;P&gt;FROM KONV&lt;/P&gt;&lt;P&gt;INTO TABLE WS_IT_KONV&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN WS_IT_VBRK&lt;/P&gt;&lt;P&gt;WHERE KNUMV = WS_IT_VBRK-KNUMV AND KSCHL = 'ZST1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you will get desired output .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;sksingh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:21:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764795#M330835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764796#M330836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sort internal table and use for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort ws_it_vbrk by knumv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT KNUMV KBETR KWERT&lt;/P&gt;&lt;P&gt;FROM KONV&lt;/P&gt;&lt;P&gt;INTO TABLE WS_IT_KONV&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN WS_IT_VBRK&lt;/P&gt;&lt;P&gt;WHERE KNUMV = WS_IT_VBRK-KNUMV AND KSCHL = 'ZST1'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:24:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764796#M330836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: problem in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764797#M330837</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;For me the coding seems to be correct.&lt;/P&gt;&lt;P&gt;Just check anywhere in the program,'delete adjacent duplicates from ws_it_konv comparing kwert' is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise,try giving the values hard coded and observe whether the result is achieved.Then you can easily trace the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg..&lt;/P&gt;&lt;P&gt;ws_it_vbrk-knumv = 'ABCD'.(here use from se16 table contents)&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;append ws_it_vbrk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT KNUMV KBETR KWERT&lt;/P&gt;&lt;P&gt;FROM KONV&lt;/P&gt;&lt;P&gt;INTO TABLE WS_IT_KONV&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN WS_IT_VBRK&lt;/P&gt;&lt;P&gt;WHERE KNUMV = WS_IT_VBRK-KNUMV AND KSCHL = 'ZST1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then check in SE16 table contents,whether you will be getting the same value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:27:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764797#M330837</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-12-06T10:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: problem in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764798#M330838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;      While using all entries you have to use all the keys of konv table&lt;/P&gt;&lt;P&gt;      to get all records else select query returns distinct &lt;/P&gt;&lt;P&gt;      values by l deleting duplicate entries .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         change your logic as below&lt;/P&gt;&lt;P&gt; SELECT KNUMV KPOSN    &lt;/P&gt;&lt;P&gt;                           STUNR    &lt;/P&gt;&lt;P&gt;                            ZAEHK    &lt;/P&gt;&lt;P&gt;                            KBETR KWERT&lt;/P&gt;&lt;P&gt;FROM KONV&lt;/P&gt;&lt;P&gt;INTO TABLE WS_IT_KONV&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN WS_IT_VBRK&lt;/P&gt;&lt;P&gt;WHERE KNUMV = WS_IT_VBRK-KNUMV AND KSCHL = 'ZST1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards&lt;/P&gt;&lt;P&gt;amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:34:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764798#M330838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: problem in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764799#M330839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see no error in your code .&lt;/P&gt;&lt;P&gt;Just see se16 and find out if there are any redundant entries in the table .&lt;/P&gt;&lt;P&gt;if there are any then try giving hard coded values in select statement of ws_it_vbrk and see if the select is selecting any redundant values if it is selecting then your for all entries should work fine .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 11:57:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/1764799#M330839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T11:57:12Z</dc:date>
    </item>
  </channel>
</rss>

