<?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: Multiple Where condition problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077556#M1179362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know this effects functionality but gives you solution what you are looking for. Check the enddate is '31.12.9999' as OR condition for enddate condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select pernr begda endda rtamt from pa0581
into corresponding fields of table it_pa0581
where pernr in so_pernr and
begda &amp;gt;= pr_begda and
( endda &amp;lt;= pr_endda or endda = '99991231' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Jan 2009 07:23:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-24T07:23:36Z</dc:date>
    <item>
      <title>Multiple Where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077554#M1179360</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;I face a small criticality in finishing the report since&lt;/P&gt;&lt;P&gt;the requirement has been changed .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below select stmt works perfectly for fetching&lt;/P&gt;&lt;P&gt;Employee no betwen the start date and End Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select  pernr begda endda rtamt from pa0581&lt;/P&gt;&lt;P&gt;        into corresponding fields of table it_pa0581&lt;/P&gt;&lt;P&gt;         where pernr in so_pernr and&lt;/P&gt;&lt;P&gt;               begda &amp;gt;= pr_begda  and&lt;/P&gt;&lt;P&gt;               endda &amp;lt;= pr_endda .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, ...Now, the requirement is that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For E.g&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;START DATE      ENDATE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;12.03.2007      31.12.9999&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;17.03.2006      11.03.2007&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i give the &lt;STRONG&gt;input as 17.03.2006 and 12.03.2007&lt;/STRONG&gt; means&lt;/P&gt;&lt;P&gt;it will fetch &lt;STRONG&gt;only the second row&lt;/STRONG&gt; of the e.g data i have &lt;/P&gt;&lt;P&gt;specified above, but they say &lt;STRONG&gt;since 31.12.9999 is considered&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;as active it(i.e the first row )&lt;/STRONG&gt;   it  also shud come in the output....&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Therefore 2 rows has to be selected in the output for given input.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam bit confused how to change the select according,&lt;/P&gt;&lt;P&gt;Please do help me out....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rachel Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2009 07:03:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077554#M1179360</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-24T07:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077555#M1179361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Rachel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use " Provide Endprovide " like bellow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the following Code will help you here in this case I want the get the qualification of the pernr where I Bound the Begda and Endda with the given dates condition, in the result it provide me the record where begda and endda not greater then the give dates for example..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Begda endda slart&lt;/P&gt;&lt;P&gt;01.01.2008 02.02.2008 U1&lt;/P&gt;&lt;P&gt;01.02.2008 03.03.2008 U2&lt;/P&gt;&lt;P&gt;02.03.2008 31.12.9999 U3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the following example if cdate is 12.02.2008 than it will return you the 2nd record&lt;/P&gt;&lt;P&gt;where slart is U2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;provide fields pernr slart from it_pa0022 into wa_it_pa0022
      valid flag1 bounds begda and endda
      where pernr = wa_it1_all_emp-pernr
      between cdate and cdate.
    endprovide.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Reply if any problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Faisal Altaf on Jan 24, 2009 12:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2009 07:10:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077555#M1179361</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-01-24T07:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077556#M1179362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know this effects functionality but gives you solution what you are looking for. Check the enddate is '31.12.9999' as OR condition for enddate condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select pernr begda endda rtamt from pa0581
into corresponding fields of table it_pa0581
where pernr in so_pernr and
begda &amp;gt;= pr_begda and
( endda &amp;lt;= pr_endda or endda = '99991231' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2009 07:23:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077556#M1179362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-24T07:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077557#M1179363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi faisal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply but my requirement is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;17.03.2006                 .18.12.2007            U1&lt;/P&gt;&lt;P&gt;12.03.2008.                 12.11. 2009           U2&lt;/P&gt;&lt;P&gt;13.11.2009                   31.12.9999           U3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i give the input as       17.03.2006 to 13.11.2009 means &lt;/P&gt;&lt;P&gt;it should return all the 3 rows that is ( U1 U2 U3) &lt;/P&gt;&lt;P&gt;but as of now its returning only U1 and U2 . since its not considering 31.12.9999&lt;/P&gt;&lt;P&gt;but my consultant say that 31.12.9999 mean the person is ACTIVE so that has also to be &lt;/P&gt;&lt;P&gt;shown in the output....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i have cleared my requirement/.................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help me out..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2009 07:24:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077557#M1179363</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-24T07:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077558#M1179364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rachel,&lt;/P&gt;&lt;P&gt;try using structure &lt;STRONG&gt;selopt&lt;/STRONG&gt;  to fill ur requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : t_selopt type table of selopt,&lt;/P&gt;&lt;P&gt;        wa_selopt type selopt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_selopt-sign = I (can be I or E)&lt;/P&gt;&lt;P&gt;wa_selopt-option = (xx , one of the values EQ,NE,CP,NP,GE,LT,LE,GT)&lt;/P&gt;&lt;P&gt;wa_selopt-low = XYZ&lt;/P&gt;&lt;P&gt;wa_selopt-high = XYZ1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_selopt to t_selopt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use this in where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be this can solve ur problem for multiple conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nibha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2009 07:45:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077558#M1179364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-24T07:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Where condition problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077559#M1179365</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;Test the following code it is working fine i have tested,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: pa0008.

SELECT-OPTIONS: sopernr FOR pa0008-pernr NO-EXTENSION NO INTERVALS,
                sodate FOR sy-datum.

DATA: it_pa0008 LIKE STANDARD TABLE OF pa0008 WITH HEADER LINE,
      wa_it_pa0008 LIKE pa0008.

SELECT * FROM pa0008
  INTO CORRESPONDING FIELDS OF TABLE it_pa0008
  WHERE pernr IN sopernr
    AND begda IN sodate. " also use like this here (and begda BETWEEN sodate-low and sodate-high.)
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your Code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select pernr begda endda rtamt from pa0581
into corresponding fields of table it_pa0581
where pernr in so_pernr and
begda &amp;gt;= pr_begda and
endda &amp;lt;= pr_endda . "Just Replace this endda with begda&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Reply if any Issue, i am waiting for your Reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Faisal Altaf on Jan 24, 2009 12:53 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2009 07:46:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-where-condition-problem/m-p/5077559#M1179365</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-01-24T07:46:36Z</dc:date>
    </item>
  </channel>
</rss>

