<?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 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/3023869#M714934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         here i want to select data based on the following steps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic is &lt;/P&gt;&lt;P&gt;1. Take a minimum date for every currency from TCURR.&lt;/P&gt;&lt;P&gt;2. Loop through all records (for the number range) in /msg/rabr table.&lt;/P&gt;&lt;P&gt;3. Select the record and match with the TCURR.FCURR Equals RABR.OW_WHGNR.&lt;/P&gt;&lt;P&gt;4. And check if the bil_dat is less the the minimum date. &lt;/P&gt;&lt;P&gt;5. If it is, write the output. else ignore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    i ve done code for this its working, according to my rewuirement it should give output records in hundrends but its giving thousands.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   but logic is not giving any error.&lt;/P&gt;&lt;P&gt;pls any one check the below logic for above steps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT kurst&lt;/P&gt;&lt;P&gt;          fcurr&lt;/P&gt;&lt;P&gt;          gdatu&lt;/P&gt;&lt;P&gt;          from &amp;lt;b&amp;gt;tcurr&amp;lt;/b&amp;gt; into table it_tcurr&lt;/P&gt;&lt;P&gt;          where kurst EQ 'M'.&lt;/P&gt;&lt;P&gt;          SORT it_tcurr by  fcurr GDATU DESCENDING.&lt;/P&gt;&lt;P&gt;          delete adjacent duplicates from it_tcurr comparing fcurr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT * FROM &amp;lt;b&amp;gt;/msg/rabr&amp;lt;/b&amp;gt; into CORRESPONDING FIELDS OF TABLE it_rabr&lt;/P&gt;&lt;P&gt;    WHERE abrnr BETWEEN '00000000000000800251' AND '00000000000000800500'.&lt;/P&gt;&lt;P&gt;SORT it_rabr BY OW_WHGNR bil_dat abrnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_rabr.&lt;/P&gt;&lt;P&gt;READ TABLE it_tcurr with key fcurr = it_rabr-OW_WHGNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_tcurr-kurst EQ 'M' AND it_tcurr-gdatu GT it_rabr-bil_dat AND it_rabr-abrnr BETWEEN '00000000000000800251' AND '00000000000000800500'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           MOVE it_tcurr-kurst TO it_output-kurst.&lt;/P&gt;&lt;P&gt;           MOVE it_tcurr-gdatu TO it_output-gdatu.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-bil_dat TO it_output-bil_dat.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-VTGNR TO it_output-VTGNR.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-BESTNR TO it_output-BESTNR.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-OW_WHGNR TO it_output-OW_WHGNR.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-abrnr TO it_output-abrnr.&lt;/P&gt;&lt;P&gt;    APPEND it_output.&lt;/P&gt;&lt;P&gt;     ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Thanks and Regards,&lt;/P&gt;&lt;P&gt;sudha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Nov 2007 07:11:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-15T07:11:14Z</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/3023869#M714934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         here i want to select data based on the following steps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic is &lt;/P&gt;&lt;P&gt;1. Take a minimum date for every currency from TCURR.&lt;/P&gt;&lt;P&gt;2. Loop through all records (for the number range) in /msg/rabr table.&lt;/P&gt;&lt;P&gt;3. Select the record and match with the TCURR.FCURR Equals RABR.OW_WHGNR.&lt;/P&gt;&lt;P&gt;4. And check if the bil_dat is less the the minimum date. &lt;/P&gt;&lt;P&gt;5. If it is, write the output. else ignore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    i ve done code for this its working, according to my rewuirement it should give output records in hundrends but its giving thousands.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   but logic is not giving any error.&lt;/P&gt;&lt;P&gt;pls any one check the below logic for above steps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT kurst&lt;/P&gt;&lt;P&gt;          fcurr&lt;/P&gt;&lt;P&gt;          gdatu&lt;/P&gt;&lt;P&gt;          from &amp;lt;b&amp;gt;tcurr&amp;lt;/b&amp;gt; into table it_tcurr&lt;/P&gt;&lt;P&gt;          where kurst EQ 'M'.&lt;/P&gt;&lt;P&gt;          SORT it_tcurr by  fcurr GDATU DESCENDING.&lt;/P&gt;&lt;P&gt;          delete adjacent duplicates from it_tcurr comparing fcurr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT * FROM &amp;lt;b&amp;gt;/msg/rabr&amp;lt;/b&amp;gt; into CORRESPONDING FIELDS OF TABLE it_rabr&lt;/P&gt;&lt;P&gt;    WHERE abrnr BETWEEN '00000000000000800251' AND '00000000000000800500'.&lt;/P&gt;&lt;P&gt;SORT it_rabr BY OW_WHGNR bil_dat abrnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_rabr.&lt;/P&gt;&lt;P&gt;READ TABLE it_tcurr with key fcurr = it_rabr-OW_WHGNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_tcurr-kurst EQ 'M' AND it_tcurr-gdatu GT it_rabr-bil_dat AND it_rabr-abrnr BETWEEN '00000000000000800251' AND '00000000000000800500'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           MOVE it_tcurr-kurst TO it_output-kurst.&lt;/P&gt;&lt;P&gt;           MOVE it_tcurr-gdatu TO it_output-gdatu.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-bil_dat TO it_output-bil_dat.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-VTGNR TO it_output-VTGNR.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-BESTNR TO it_output-BESTNR.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-OW_WHGNR TO it_output-OW_WHGNR.&lt;/P&gt;&lt;P&gt;           MOVE it_rabr-abrnr TO it_output-abrnr.&lt;/P&gt;&lt;P&gt;    APPEND it_output.&lt;/P&gt;&lt;P&gt;     ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Thanks and Regards,&lt;/P&gt;&lt;P&gt;sudha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 07:11:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/3023869#M714934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T07:11: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/3023870#M714935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT kurst&lt;/P&gt;&lt;P&gt;fcurr&lt;/P&gt;&lt;P&gt;gdatu&lt;/P&gt;&lt;P&gt;from tcurr into table it_tcurr&lt;/P&gt;&lt;P&gt;where kurst EQ 'M'.&lt;/P&gt;&lt;P&gt;SORT it_tcurr by fcurr GDATU DESCENDING.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from it_tcurr comparing fcurr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM /msg/rabr into CORRESPONDING FIELDS OF TABLE it_rabr&lt;/P&gt;&lt;P&gt;WHERE abrnr BETWEEN '00000000000000800251' AND '00000000000000800500'.&lt;/P&gt;&lt;P&gt;SORT it_rabr BY OW_WHGNR bil_dat abrnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_rabr.&lt;/P&gt;&lt;P&gt;clear it_tcurr.&lt;/P&gt;&lt;P&gt;READ TABLE it_tcurr with key fcurr = it_rabr-OW_WHGNR.&lt;/P&gt;&lt;P&gt;IF sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;IF it_tcurr-gdatu GT it_rabr-bil_dat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE it_tcurr-kurst TO it_output-kurst.&lt;/P&gt;&lt;P&gt;MOVE it_tcurr-gdatu TO it_output-gdatu.&lt;/P&gt;&lt;P&gt;MOVE it_rabr-bil_dat TO it_output-bil_dat.&lt;/P&gt;&lt;P&gt;MOVE it_rabr-VTGNR TO it_output-VTGNR.&lt;/P&gt;&lt;P&gt;MOVE it_rabr-BESTNR TO it_output-BESTNR.&lt;/P&gt;&lt;P&gt;MOVE it_rabr-OW_WHGNR TO it_output-OW_WHGNR.&lt;/P&gt;&lt;P&gt;MOVE it_rabr-abrnr TO it_output-abrnr.&lt;/P&gt;&lt;P&gt;APPEND it_output.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My doubt is if it_tcurr record is there or not the code is executing. because of no subrc check. It must work now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 08:12:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/3023870#M714935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T08:12:59Z</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/3023871#M714936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jyothi Thank u verymuch for ur replay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Previously i ve checked what u told and i ve checked sy-subrc also,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and here the problem is , from 1st table( it_tcurr ) am getting and only 77 records are there, but in 2nd tale( it_rabr ) getting 287 records. from their respective tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;but in output its giving 287 records.  but here we r checking on 1st table, so it should display 77 records, but its displayong 287 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   pls just check once again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Regards,&lt;/P&gt;&lt;P&gt;sudha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 08:39:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/3023871#M714936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T08:39: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/3023872#M714937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at 1st itab and read the table contents of the second table...&lt;/P&gt;&lt;P&gt;this should solve the problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 08:43:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/3023872#M714937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T08:43:22Z</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/3023873#M714938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sharayu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Thanks for u r help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i ve given rewards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Regards,&lt;/P&gt;&lt;P&gt;sudha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 09:17:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-statement/m-p/3023873#M714938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T09:17:01Z</dc:date>
    </item>
  </channel>
</rss>

