Logical operator

Hi Experts,
Can we use logical operator in where clause of select statement?????
My requirement is i want to CA logical operator in select statement.Is there any possibility????????
If there please tell me???????????\
Nice answers reward with maxi points.................

Hi Subash,
Prakash is right with his idea to go by range,
but it won't work like this.
Instead build your range like this:
ranges r_matnr for Tnnnn-MATNR.
r_matnr-sign = 'I'.
r_matnr-option = 'BT'.
r_matnr-low = '0'.
r_matnr-high = '9999999999'.
"max length of matnr filled with 9
APPEND r_matnr.
then
SELECT * FROM Tnnnn WHERE MATNR IN r_matnr
AND ......
this will get you only those entries with plain numerical MATNR.
For the opposit selection, just replace 'I' wit 'E' in r_matnr-option.
hope that helps.
Regards
JW
Edited by: Joerg Wulf on Jan 8, 2008 10:43 PM

Similar Messages

  • Logical Operations in SQL decode function ?

    Hi,
    Is it possible to do Logical Operations in SQL decode function
    like
    '>'
    '<'
    '>='
    '<='
    '<>'
    not in
    in
    not null
    is null
    eg...
    select col1 ,order_by,decode ( col1 , > 10 , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 , <> 10 , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 , not in (10,11,12) , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 ,is null , 0 , 1)
    from tab;
    Regards,
    infan
    Edited by: user780731 on Apr 30, 2009 12:07 AM
    Edited by: user780731 on Apr 30, 2009 12:07 AM
    Edited by: user780731 on Apr 30, 2009 12:08 AM
    Edited by: user780731 on Apr 30, 2009 12:08 AM
    Edited by: user780731 on Apr 30, 2009 12:09 AM

    example:
    select col1 ,order_by,case when col1 > 10 then 0 else 1 end
    from tab;
    select col1 ,order_by,case when col1 &lt;&gt; 10 then 0 else 1 end
    from tab;
    select col1 ,order_by,case when col1 not in (10,11,12) then 0 else 1 end
    from tab;As for testing for null, decode handles that by default anyway so you can have decode or case easily..
    select col1 ,order_by,decode (col1, null , 0 , 1)
    from tab;
    select col1 ,order_by,case when col1 is null then 0 else 1 end
    from tab;

  • Nqs error 59001: Binary logical operation error in OBIEE 11g

    Hi,
    Requirement: Need to calculate YTD for invoiced amount and Prior YTD for invoiced amount and last year total invoiced amount.
    Logic we used: For YTD Invoiced amount we used “Year To Date” time series function in rpd.
    For Prior YTD we used “Ago function on Calculated YTD column”.
    For Last Year Invoiced amount we used “ CASE function and dynamic variables” as:
    CASE WHEN year=valueOf(previous_year) THEN invoiced_amount END;
    Now, when I’m creating a report, I’m getting the following error as:
    *[nQSError: 43119] Query Failed: [nQSError: 59001] Binary Logical operation is not permitted on VARBINARY, INTEGER operand(s). (HY000)*
    Please help me to solve this, i need to release the instance by EOD

    Hi,
    As per my understanding the ValueOf(previous_year) is double precesion so it wont allow to use binary logical operator.Change to integer becos we can manage year with interger data type.
    [nQSError: 59001] Binary Logical operation is not permitted on DOUBLE PRECISION, VARBINARY operand(s).
    mark if helpful/correct
    thanks,
    prassu

  • How to apply different Logical operations to N.of Signals

    Hello all,
    Please help me if anyone have idea about this.
    I have “N” number of signals. I want to apply different Logical operations for this.
    For Example:
          (((SigA >= 30 && SigB <=55) || (SigC = 42)) && (SigD > 45))
    ((((SigD >= 89.25 && SigF <=55.568) ||(SigG = 156.89)) && (SigA >= 45)) || ((SigF – Sig A) >25))
    Here Conditions will change every time. User can input different conditions (like Excel calculations). I need to check signals as per these type of conditions. Is there is any tool kits available in LabVIEW / we need to develop?
    Currently I’m thinking about string manipulations to extract the each condition . Once first condition is finished then check this results with next conditions (so on..)
    Munna

    Hi GerdW,
    After long time again I stated doing this task. Could you please help me in this.
    As per my snippet, at 1st making array based on given String. From that string I need to check where open & closed brackets are coming to do logical operations.
    For Example: (2 OR ((1 AND 2) OR 3))
    Index
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    String
    2
    O
    R
    1
    A
    N
    D
    2
    O
    R
    3
    Please give me any idea/sample VI for the same.
    Here, 1,2 & 3 are Indices of Boolean 2D Array.
    Munna

  • Logic operations on a string of bits

    Hi, I have a very simple question that I cannot seem to figure out.  I would just like to perform logic operations (AND, OR, etc.) on 2 strings of bits that are 24 bits long each, however I cannot find in the functions palette a function that acts as a binary constant.  I only see numeric constant and hex functions.  Can somone please let me know where I can find this.  For example, I would like to AND '111111111111111111111111' & '000000000000000000000000'.    
    Solved!
    Go to Solution.

    I think that these bitwise operations should work directly on strings too. Thus I wrote up this idea.  
    LabVIEW Champion . Do more with less code and in less time .

  • Logical operations on different systemgroups

    Hi,
    I want to define several systemgroups in the transaction RZ21 on a central monitoring system. Afterwards I want to make logical operations on these groups (like: group1 and group2) in the monitor definition. Is this possible and in what way? I hadn't found hints on sap-notes.
    Greetings
    Christian Wosgien

    > I think you mixed up bit and binary datatype.
    > Binary datatype is normally used for images, text, storing a pdf in your db, etc
    I'm aware that's what they're usually used for (although I have thought varbinary would have been better)
    but I need to store lots of bit fields and  was hoping I could use a binary datatype, rather than have status1, status2, status3, etc
    > If you want 1 column to store multiple values using bitmasks, than you can use an integer to do that.
    > e.g. see examples in system tables like sysdatabases..status (small int) and sysdatabases..status4 (int)
    That's what we're using at the moment - if fact we're now using unisgned bigint - that gives 64 bits.
    The fact that sys* tables have multiple status fields shows it would be useful here.
    > Sybooks: The bitwise operators are a Transact-SQL extension for use with integer type data.
    > So it looks like you've got to use multiple columns to achieve wat you want.
    Yep - that's exactly what we've found.
    It seems unfortunate to not allow bitwise operations on binary datatypes. Its not a common use of them I know
    but I've worked at couple of places which would have benefited from this.
    We've spent some time writing our own functions that implement bitwise operations on binary fields, but would have been better if these were build in.
    > Why would you want to store 200 bitfields in 1 column?
    For a similar reason as the sys* tables have multiple status columns - If binary columns allowed bitwise operations - they'd only need 1 status field.

  • Logical Operator list to end users

    Hi,
    Is there any way that we can provide Logical operator also in the filter/prompt, for the end user in WebI on top of a SAP BW universe?
    Ex: User has to select a logical operator(like <,<=,>,>=,= etc) and value for a 'Net Due Date' filter
    Tried searching the forum, but did not get the proper work around.
    Thank you in advance.
    ---Veera

    are you talking about adding filters in webi reports?
    i think its easy,
    just in the query itself you can add filter and make it as prompt.
    but you have to select the operator, case this is something you have to do into the query itself.
    users can not do this when they are running the report.
    but there is another option which is "Quick Filter" in there users can add quick filters and select operators as they like.
    good luck

  • Logical Operator list t oend users

    Hi,
    Is there any way that we can provide Logical operator also in the filter/prompt, for the end user in WebI on top of a SAP BW universe?
    Ex: User has to select a logical operator(like <,<=,>,>=,= etc) and value for a 'Net Due Date' filter
    Tried searching the forum, but did not get the proper work around.
    Thank you in advance.
    ---Veera

    Hi,
    Yes it is possible.
    Here is a sample based on @CALYEAR characteristic
    <FILTER KEY="@Select(Calendar Year\L01 Calendar Year).[TECH_NAME]">
    <CONDITION OPERATORCONDITION="@Prompt('Select operator','A:A',{'Equal':'Equal','Not Equal':'NotEqual','Greater':'Greater','Less':'Less','Greater or Equal':'GreaterOrEqual','Less or Equal':'LessOrEqual'},mono,primary_key,persistent,{'Equal':'Equal'})">
    <CONSTANT TECH_NAME="@Prompt('Select year','A','Calendar Year\L01 Calendar Year',Mono,Primary_Key,Persistent)"></CONSTANT>
    </CONDITION></FILTER>
    Here is the prompt definition you have to create instead of a static value for the OPERATORCONDITION:
    @Prompt('Select operator','A:A',{'Equal':'Equal','Not Equal':'NotEqual','Greater':'Greater','Less':'Less','Greater or Equal':'GreaterOrEqual','Less or Equal':'LessOrEqual'},mono,primary_key,persistent,{'Equal':'Equal'})
    Regards
    Didier

  • Logical operator 'like'

    I have a small query where I have to retrieve vendor details not including the vendors starting with '9'.
    I have written the below query for that.
    select b~lifnr  " Vendor number
         into corresponding fields of table gi_output_vendors
    from  lfa1
    where  lifnr   not like  '9%'.
    But the output I am getting contains vendor numbers '0000950000' where I wanted to eliminate these type of numbers also. i.e, I don't want to consider leading zeroes.
    So, the below code I have written for that.
    The problem is with if condition or delete statement  'like' logical operator is not being allowed.
    loop at gi_output_vendors into wa_output_vendors.
    shift wa_output_vendors-lifnr left deleting leading '0'.
    if wa_output_vendors-lifnr like '9%'   " didn't work delete gi_output_vendors from wa_output_vendors   where
                  lifnr like '9%'. "didn't work
    endif.
    endloop.
    When I use 'like' with 'if' condition or 'delete' statement, I am getting error saying that 'Like operator is not allowed'.
    How could I deal with this situation.
    Thanks in advance.
    Vishnu Priya

    If you can guarantee the 9 will always be in the same place then it would be better to use offset logic or something like 'lifnr NOT LIKE '00009'' - incidentally, I believe the % wildcard only replaces one character so '9%' will be looking for a 2 char string containing a 9 followed by ONE other character.  Using '9' will look for a 9 followed by any number of other characters. Since lifnr is a 10 char field (according to your example) '9%' will always fail. I would suggest using the Data Browser (SE11) selection screens to try out some of the possibilities and see what works.
    Hope that's of some help!
    Andy
    By the way, I wouldn't recommend using '9' becasue this will look for a 9 <b>anywhere</b> in the lifnr field i.e. it could exclude a perfectly valid number just because it ends in a 9!
    Message was edited by: Andrew Wright
    Sorry, ignore me, in SQL you should use % and not * for multiple characters.  However, the same applies if you can guarantee the position of the 9.
    Message was edited by: Andrew Wright

  • How to store logical operator in an array in java

    how to store logical operator in an array in java.
    Array should not be String type if i pass an element of that array it should be considered as logical operator

    my exact requirment is like this, i need some logic
    to convert string like this "2 Equals 3 AND 4 greater
    than 7" to condition like this
    2 == 3 && 4 >7 which i can pass to if
    condition.So you want to create an expression parser?
    No need for something as ugly as what you think you need, a simple nested conditional will do it for just the few logical operations.

  • Ignore logical operator in string

    I assign a string string to a variable var, then show the variable using $$var$$
    This works if the string is something like "Black White", and $$var$$ returns "Black White"
    However, if the string contains a logical operator like "and" or "or", then captivate sees it as a logical operator, and returns "false".  Therefore the string "Black or White" makes the variable return "false"
    I believe I need to put something in front of or around the logical operator so that it's ignored, like "Black */or/* White", or something like that, but I can't remember what.

    Still no concatenation in CP8 One of my old, old feature requests.
    Captivate doesn't know the difference between a string and a number.

  • How to use varaible in place of logical operator in query

    Hi Experts,
    How can we use a variable in place of logical operator (OR, AND) ?
    For ex:
    select * from sflight where carrid = 'LH' AND connid = 100.
    data x type string.
    x = 'AND'.
    Now, I want to replace AND with the variable x.
    Query will be:
    select * from sflight where carrid = 'LH'  x connid = 100.
    I am doing this because user can select any logical operator while creating the search criteria at run time .
    I already tried this but i am getting following compilation error:
    Error: Incorrect expression used in place of logical expression.

    hi,
    Check out this sample code
    Display of flight connections after input of airline and flight number:
    PARAMETERS: carr_id TYPE spfli-carrid,
                conn_id TYPE spfli-connid.
    DATA:       where_clause TYPE  STRING,
                and(4),
                wa_spfli TYPE spfli.
    IF carr_id IS NOT INITIAL.
      CONCATENATE 'CARRID = ''' carr_id '''' INTO where_clause.
      and = ' AND'.
    ENDIF.
    IF conn_id IS NOT INITIAL.
      CONCATENATE where_clause and ' CONNID = ''' conn_id ''''
        INTO where_clause.
    ENDIF.
    SELECT * FROM spfli INTO wa_spfli WHERE (where_clause).
      WRITE: / wa_spfli-carrid, wa_spfli-connid, wa_spfli-cityfrom,
               wa_spfli-cityto, wa_spfli-deptime.
    ENDSELECT.
    Regards,
    Santosh

  • Unable to drill down with binary logical operation issues

    QSError: 10058] A general error has occurred. [nQSError: 59001] Binary logical operation is not permitted on Double operand(s) (S1000)
    Basically this comes from my drill down report. I have 2 hierarchies on one report, 3 columns --- months, state, measures..
    If I drill down from STate ----> lowest, then drill month--->lowest, things works fine; but if I start with month---> lowest, then drill state down, I will get this above error..
    I checked the column data types from DB, month is char, week is date, state is char, measure is double
    SO let me know what you think?
    Thanks

    is it helpful?
    On Paass Navigation for another report

  • [nQSError: 59001] Binary Logical operation is not permitted

    Hi All,
    I am querying 3 columns in a report.
    E.g.
    Sales -> Directly pulled from the database column
    Prior Month Sales -> AGO("Sales subject area"."Key Measures"."sales", "Sales subject area".Time_Dimension."Month", 1)
    Current YTD ->
    (CASE WHEN "Sales subject area".Time_Dimension."Year" = VALUEOF("CURRENT_YEAR") AND "Sales subject area".Time_Dimension."Month Number" <= VALUEOF("CURRENT_MONTH") THEN "Sales subject area"."Key Measures"."Sales" ELSE 0 END )
    I get the following error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59001] Binary Logical operation is not permitted on VARBINARY, INTEGER operand(s). (HY000)
    Please let me know how to go about this.

    The Data types are as follows:
    1. Sales = Double
    2. Month = Varchar
    3. Month Num is calculated column from -> MOD("Sales Subject Area".Calendar.TimeID, 100) and time id is "Int"
    The Rpd variables are:
    1. Current Year = CAST(SUBSTRING(CAST(MAX(YEARMONTH) AS VARCHAR),1,4) AS INTEGER)
    2. Current Month = CAST(SUBSTRING(CAST(MAX(YEARMONTH) AS VARCHAR),,6) AS INTEGER)
    3. Prior Year = CAST(SUBSTRING(CAST(MAX(YEARMONTH) AS VARCHAR),1,4)-1 AS INTEGER)
    Basically we dont want to use TODATE function as it is not working properly for Prior YTD.

  • How to change logical operator

    Hi
    I am trying to determine Employee Responsible(ER) based on territory attributes. Determination should work on 4 attributes as Country,Region,Postal Code and Prod cat. But i could find that first 3 attributes(Country,Region,Postal Code) are grouped together by "And" operator but Prod cat is by"OR" operator.
    So in a way for correctly determined ER based in this order Prod Cat.,Cty,REGN,PCDE. How we can chnage the logical operator or grp togther these attribute so they are connected by "and" operator and as a set is evaluated in transaction to determine the correct Employee Responsible when prod. is entered.
    thanks
    chap

    Hello ,
    We too are facing the same problem of using the logical operator.
    We want to use ' "Country" AND "Product Hier/Cat" '  but can only use OR instead.
    Please advice.
    Rgds,
    Ak-

Maybe you are looking for

  • Application started using Java Web Start doesn't launch the first time

    I have a Facebook photo uploader application that I plan to distribute using Java Web Start. I'm using Java 6u4 on Windows XP SP2 with 2GB of RAM. I have Java 6u3, Java 6u4 and Java 5 u14 installed and I'm sure the one used is Java 6u4. I signed my a

  • If i uninstall itunes and install it again, will all my stuff be on it still

    if i uninstall itunes and install it again, will all my stuff be on it still

  • Apple TV locks when 'Add folder to library' on iTunes being streamed from

    This problem seems consistently repeatable on my set-up. Was just wondering whether anyone else has experienced this problem. Apple TV is playing music streamed, screen saver may or may not be active. I then copy new music folders into my iTunes musi

  • Connecting ipod video to mac and windows???

    I have recently purchased an ipod video, i have two computers, one mac and one windows, the mac has my music on and the windows has ripped dvd's on which can be converted to ipod video compatible files. can i connect my ipod to both computers and add

  • LG Versa

    Hey so I have a basic prepaid plan which includes a $20 monthly unlimited text plan to any carrier, and a $.99 daily unlimited calling plan to other cellular devices. I currently have a Pantech Caper, which is almost broken. I was hoping I could move