<?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 logical operator Question in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290981#M499826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Select * from bsik into table it_bsik
         WHERE LIFNR in p_client and
               bukrs eq  so_cia  and
               budat LE so_fec   and
               AUGDT LE so_fec   and
*               blart &amp;lt;&amp;gt; 'KZ'.
             ( BSCHL &amp;lt;&amp;gt; 50       or
               BSCHL &amp;lt;&amp;gt; 11       or
               BSCHL &amp;lt;&amp;gt; 01       or
               BSCHL &amp;lt;&amp;gt; 25 )     and
               umskz NE 'T'      and
               umskz NE 'F'      and
               umskz NE 'R'      and
               umskz NE 'P'      and
               umskz NE 'J'      and
               umskz NE 'L'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this Select Right ? , it get me the right info but i feel that is not right &lt;/P&gt;&lt;P&gt;because the and and and part , i want get all Open Item from bsik except the Special GL , so i am looking for the umskz field , so i feel that the multiple and things dont check all situation but i have a doc with value F in umskz so look like the select is doing it right can somebody show me and guide me i have only few months trying learning myself abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pd: i dont know much sql either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 May 2007 21:12:15 GMT</pubDate>
    <dc:creator>edgar_almonte</dc:creator>
    <dc:date>2007-05-30T21:12:15Z</dc:date>
    <item>
      <title>logical operator Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290981#M499826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Select * from bsik into table it_bsik
         WHERE LIFNR in p_client and
               bukrs eq  so_cia  and
               budat LE so_fec   and
               AUGDT LE so_fec   and
*               blart &amp;lt;&amp;gt; 'KZ'.
             ( BSCHL &amp;lt;&amp;gt; 50       or
               BSCHL &amp;lt;&amp;gt; 11       or
               BSCHL &amp;lt;&amp;gt; 01       or
               BSCHL &amp;lt;&amp;gt; 25 )     and
               umskz NE 'T'      and
               umskz NE 'F'      and
               umskz NE 'R'      and
               umskz NE 'P'      and
               umskz NE 'J'      and
               umskz NE 'L'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this Select Right ? , it get me the right info but i feel that is not right &lt;/P&gt;&lt;P&gt;because the and and and part , i want get all Open Item from bsik except the Special GL , so i am looking for the umskz field , so i feel that the multiple and things dont check all situation but i have a doc with value F in umskz so look like the select is doing it right can somebody show me and guide me i have only few months trying learning myself abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pd: i dont know much sql either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2007 21:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290981#M499826</guid>
      <dc:creator>edgar_almonte</dc:creator>
      <dc:date>2007-05-30T21:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: logical operator Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290982#M499827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Query looks alright to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from bsik into table it_bsik&lt;/P&gt;&lt;P&gt;         WHERE LIFNR in p_client and&lt;/P&gt;&lt;P&gt;               bukrs eq  so_cia  and&lt;/P&gt;&lt;P&gt;               budat LE so_fec   and&lt;/P&gt;&lt;P&gt;               AUGDT LE so_fec   and&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              blart &amp;lt;&amp;gt; 'KZ'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             ( BSCHL &amp;lt;&amp;gt; 50       or&lt;/P&gt;&lt;P&gt;               BSCHL &amp;lt;&amp;gt; 11       or&lt;/P&gt;&lt;P&gt;               BSCHL &amp;lt;&amp;gt; 01       or&lt;/P&gt;&lt;P&gt;               BSCHL &amp;lt;&amp;gt; 25 )     and&lt;/P&gt;&lt;P&gt;               umskz not in ('T' , 'F' , 'R' ,  'P' ,  'J'  , 'L' ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2007 21:27:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290982#M499827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-30T21:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: logical operator Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290983#M499828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you want to use AND to connect all the BSCHLs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2007 22:12:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290983#M499828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-30T22:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: logical operator Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290984#M499829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edgar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly i would like to tell you few things and also my understanding of what you want to achieve: &lt;/P&gt;&lt;P&gt;1.Its always better to mention the exact  fields you want to get in your select &lt;/P&gt;&lt;P&gt;   query rather than giving ' * '.By mentioning the exact fields , you improve the &lt;/P&gt;&lt;P&gt;   performance of your SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. From your query below i am assuming that p_client is a select option and &lt;/P&gt;&lt;P&gt;   so_cia is a parameter. In actual practice , we always use so_ for  a select &lt;/P&gt;&lt;P&gt;   option and p_ for a parameter. I am not sure if you have your reasons to name it &lt;/P&gt;&lt;P&gt;   that way but i will be going as per the standards . So i will rename p_client to &lt;/P&gt;&lt;P&gt;   so_lifnr ,  so_cia to p_werks , so_fec to p_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. You want to fetch all the records where document type (BLART) is not equal   &lt;/P&gt;&lt;P&gt;    to 'KZ'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. You want to fetch all the records for which the posting key(BSCHL) is not equal &lt;/P&gt;&lt;P&gt;    to  50 or 11 or  01 or 25.I am not sure if this is what you want or do you want all of them not to appear in the result table. If that is the case you will have to use 'AND' to connect all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. You want to fetch all the records for which Special G/L Indicator(UMSKZ) is not &lt;/P&gt;&lt;P&gt;    equal to T  , F , R , P , J , L. ( please note that I could not find the value 'L' for  &lt;/P&gt;&lt;P&gt;    the domain UMSKZ ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So based on the above understanding your SQL would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR :it_bsik[]. &lt;/P&gt;&lt;P&gt;Select *  FROM BSIK INTO TABLE it_bsik&lt;/P&gt;&lt;P&gt;              WHERE lifnr in so_lifnr&lt;/P&gt;&lt;P&gt;              AND      bukrs = p_bukrs&lt;/P&gt;&lt;P&gt;              AND      budat LE p_date&lt;/P&gt;&lt;P&gt;              AND      augdt  LE p_date&lt;/P&gt;&lt;P&gt;              AND     ( bschl &amp;lt;&amp;gt; 50&lt;/P&gt;&lt;P&gt;              OR         bschl &amp;lt;&amp;gt; 11&lt;/P&gt;&lt;P&gt;              OR         bschl &amp;lt;&amp;gt; 01&lt;/P&gt;&lt;P&gt;              OR         bschl &amp;lt;&amp;gt; 25 )&lt;/P&gt;&lt;P&gt;              AND       umskz NE 'T'&lt;/P&gt;&lt;P&gt;              AND       umskz NE 'F'&lt;/P&gt;&lt;P&gt;              AND       umskz NE 'R'&lt;/P&gt;&lt;P&gt;              AND       umskz NE 'P'&lt;/P&gt;&lt;P&gt;              AND       umskz NE 'J'&lt;/P&gt;&lt;P&gt;              AND       umskz NE 'L'.&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;*Check for sy-subrc&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Always check for sy-subrc after a select. I have changed p_client to so_lifnr , so_cia to p_bukrs and so_fec to p_date above. Correct me if my understanding is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would be of some help to you.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;shivika&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Shivika Bhorchi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2007 23:27:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290984#M499829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-30T23:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: logical operator Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290985#M499830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it should be like this,  you must be careful with your OR and AND as well as the ( )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select * from bsik into table it_bsik
         WHERE LIFNR in p_client and
               bukrs eq  so_cia  and
               budat LE so_fec   and
               AUGDT LE so_fec   and
*               blart &amp;lt;&amp;gt; 'KZ'.
             ( BSCHL &amp;lt;&amp;gt; 50       and
               BSCHL &amp;lt;&amp;gt; 11       and
               BSCHL &amp;lt;&amp;gt; 01       and
               BSCHL &amp;lt;&amp;gt; 25 )     and
             ( umskz NE 'T'      and
               umskz NE 'F'      and
               umskz NE 'R'      and
               umskz NE 'P'      and
               umskz NE 'J'      and
               umskz NE 'L' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2007 23:50:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290985#M499830</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-05-30T23:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: logical operator Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290986#M499831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thx all&lt;/P&gt;&lt;P&gt;i will check,test and look all your suggestions &lt;/P&gt;&lt;P&gt;pd: Shivika Bhorchi    you was right that is was i am looking for , btw blart was comment, i don't want it in the query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 11:33:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290986#M499831</guid>
      <dc:creator>edgar_almonte</dc:creator>
      <dc:date>2007-05-31T11:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: logical operator Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290987#M499832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok thats great! Thanx edgar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 22:49:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-operator-question/m-p/2290987#M499832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T22:49:29Z</dc:date>
    </item>
  </channel>
</rss>

