Related to conditional operator
hai SDNs,
in select stmt or delete stmt in where clause i have condition like this:
need the somes values based on condition "A" is in the range 10 - 1000.
how to write it in where clause...
what is the operator or any alternative???
thanking you,
You should use BETWEEN operator OR you can use RANGES / SELECT-OPTIONS if you are writing this in ABAP.
SELECT * FROM MARA WHERE MATNR BETWEEN '1' AND '10000'.
T_RANGES-SIGN = 'BT'.
T_RANGES-OPTION = 'EQ'.
T_RNAGES-LOW = '1'.
T_RANGES-HIGH = '1000'.
APPEND T_RANGES.
SELECT * FROM MARA WHERE MATNR IN T_RANGES.
Regards,
Ravi
Note : Please mark all the helpful answers
Similar Messages
-
What is the conditional operator for AND, OR .....?
what is the conditional operator for AND, OR .....? in ABAP language...
AND, OR .. & is not accepting or recognising.
Is these feature available in abap ??? if yes, how to use?
thanks...
shivaHi,
Conditional operator for AND and OR are same AND and OR.
A logical expression consists of comparisons (see expressions 1 to 4 below) and/or selection criteria checks (expression 5) using the operators AND, OR and NOT , as well as the parentheses " (" and ")".
The individual operators, parentheses, values and fields must be separated by blanks:
Incorrect:
f1 = f2 AND (f3 = f4).
Correct:
f1 = f2 AND ( f3 = f4 ).
NOT takes priority over AND, while AND in turn takes priority over OR:
NOT f1 = f2 OR f3 = f4 AND f5 = f6
thus corresponds to
( NOT ( f1 = f2 ) ) OR ( f3 = f4 AND f5 = f6 )
The selection criteria comparisons or checks are processed from left to right. If evaluation of a comparison or check proves part of an expression to be true or false, the remaining comparisons or checks in the expression are not performed.
All data objects that can be converted among each other can be used as operands for logical expressions.
Check if u are using the AND or OR operator this way.
IF f1 AND f2.
ENDIF.
In this case it will throw error. Here it act as relational operator.
Regards,
Prakash -
Powershell equivalent of a conditional operator?
Hi,
I've got a small snippet of Powershell code that works perfectly well, but I'd like to make it better. here it is:
if ($discoveredIssues.Length -gt 0){
$returnHash += @{"IsBatchValid"=$false}
else{
$returnHash += @{"IsBatchValid"=$true}
I don't like the fact that the string literal "IsBatchValid" exists in two places as there's always the chance that someone could change it one place and not the other (very minor quibble, I know).
I was wondering if there was a way to write this such that I don't have the if...then...else. I tried to do this:
$returnHash += @{"IsBatchValid"={if ($discoveredIssues.Length -gt 0){$false}else{$true}}}
but that doesn't work. It just returns "if ($discoveredIssues.Length -gt 0){$false}else{$true}}" rather than the actual result of that expression. I was hoping there might be something like C#'s conditional operator so that I could do something
like this:
$discoveredIssues.Length -gt 0 ? $false : $true
but sadly not.
Any ideas how I can achieve this? I suspect there isn't a way, but it'd be nice if there were.
thanks
Jamie$returnHash.IsBatchValid = $discoveredIssues.Length -gt 0
Oh nice. Didn't quite work. Powershell ISE complained:
But it prompted me to go away and change it to this:
$returnHash += @{"IsBatchValid"=$discoveredIssues.Length -eq 0}
which I suppose would have been obvious had I bothered to pay any attention to what I was doing. Always pays to have someone else put eyes on something. thanks mjolinor.
Glad to help.
It wasn't obvious from the code whether $returnHash already exists or not. I was assuming it did:
$returnHash = @{}
$returnHash.IsBatchValid = $discoveredIssues.Length -gt 0
$returnHash
Name Value
IsBatchValid False
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " " -
Conditional operator question?
Hello,
Quick question, are we not allowed to use the conditional operator this way... see code below:
char volatile ProgString_[] = "\
{Fan code} \
12 <Limit11> [C1_ACM2]_[B1] _AND_ \
bla bla \
unsigned char UPC_SYSZ_EndOfTable(unsigned long i){ // Find the double '*' in string
char volatile *u;
u = &ProgString_[i];
if(!(strncmp("*", u, 1))){
i++;
u = &ProgString_[i];
if(!(strncmp("*", u, 1))){
return TRUE;
else {
return FALSE;
else
return FALSE;
void UPC_SYSZ_Parse(){
unsigned char volatile iOCntr = 0;
unsigned long volatile i;
for(i=0; i<200; i++){
(UPC_SYSZ_EndOfTable(i))?(break):(continue); //<<<<< Invalid expression ??
I would of used the following compact line:
(UPC_SYSZ_EndOfTable(i))?(break):(continue); //<<<<< Invalid expression ??
to periodically test the end of the string by fetching the "EndOfTable() function and evaluating if the double star is detected.
If detected, I would break out of the for loop, if not then I would continue.
Is it possible to do it this way?
thanks for all help!
rThink of it along the lines of each of the operands of the ternary operator must produce a value (which of course break and continue being statements cannot do).
Based on your brief example here is what I would do
for(i=0; i<200; i++){
if (UPC_SYSZ_EndOfTable(i)) break;
// doesn't make any sense to put more code down here anyway, so no real point to continue} -
Conditional Operator for Popup Pages!!
Hi All,
In my application there are 2 two different pages say 85 and 45. In page 85 i am calling the Iframe in which it will redirect to page 45. Now in that page i.e 45 i have used template as popup. In that i have an IR and HTML regions and a button in IR region. when i click on button then only should show the HTMl Region for that i ahave used conditional operator. But that is not working!!
So i would like to know wheather conditional will work popup pages. If not let me know the procedure for that!!!!
Thanks,
Anoo.... Apart from that, there is no need for your original long list of "if .. else". For a list of possible inputs, you should consider something like this:
switch(myYear.selection.text)
case "10": yearSelect=0; break;
case "11": yearSelect=1; break;
case "12": yearSelect=2; break;
case "13": yearSelect=3; break;
case "14": yearSelect=4; break;
default: yearSelect=5;
or, with your input and output, something as simple as
yearSelect = Number(myYear.selection.text)-10;
-- but I don't know what your possible range of inputs is. If it's "anything goes", you have to check for a not-in-range and then set it to your default of 5. -
Conditional operator and nulltype
hi,
i have a little problem, it's actually not really a problem, im just curious. i have the following testclass
public class Test{
public static void main(String[] args) {
Double a = false? 1.00: (Double)null; // nullpointer (A)
Double b = false? 1.00: null; // works (B)
}when line (A) is uncommented a NullPointerException is thrown and i have no idea why.
when i comment out line (A), line (B) works. because the type of the conditional operator is of the other if one of them is NullType.
so not really a problem because it's better to use (B) but i still want to know why (A) doesn't work.
Edited by: creichlin on Oct 27, 2008 12:15 PMouch, i am just to stupid. i forgot autoboxing, the NullType is cast to a null Double, then it's autoboxed to a double and then to a Double again.
-
Conditional Operator for else if?
I used the google compiler on one of my scripts. It worked fine except I am getting hung up on some of the conditional statements it made. Originally I had a series of if else if statements. When changed to Conditional Operator it changes the fuctionality of it. Here we go if anyone can help I will take any tips.
My version:
if(myYear.selection.text=="10"){yearSelect=0;}
else if(myYear.selection.text=="11"){yearSelect=1;}
else if(myYear.selection.text=="12"){yearSelect=2;}
else if(myYear.selection.text=="13"){yearSelect=3;}
else if(myYear.selection.text=="14"){yearSelect=4;}
else{yearSelect=5;}
Google version:
yearSelect="10"==b.selection.text?0:"11"==b.selection.text?1:"12"==b.selection.text?2:"13"==b.selection.text?3:"14"==b.selection.text?4:5,
Thanks in advance for any advice.
Brett... Apart from that, there is no need for your original long list of "if .. else". For a list of possible inputs, you should consider something like this:
switch(myYear.selection.text)
case "10": yearSelect=0; break;
case "11": yearSelect=1; break;
case "12": yearSelect=2; break;
case "13": yearSelect=3; break;
case "14": yearSelect=4; break;
default: yearSelect=5;
or, with your input and output, something as simple as
yearSelect = Number(myYear.selection.text)-10;
-- but I don't know what your possible range of inputs is. If it's "anything goes", you have to check for a not-in-range and then set it to your default of 5. -
NEED HELP:To Parse Conditional Operator Within An Expression.
Hi there:
I'm having some difficulties to parse some conditoional operator. My requirements is:
Constants value: int a=1,b=2,c=3
Input/Given value: 2
conditional operator expression: d=a|b|c
Expected result: d=true
Summary: I like to receive a boolean from anys expressions defined, which check against Input/Given value.Note: The expression are various from time to time, based on user's setup, the method is smart enough to return boolean based on any expression.
Let me know if you have any concerns.
Thanks a million,
selenahere is a simple example.
BNF changes
EXPR ::= OPERATOR
EXPR ::= OPERATION OPERANT EXPR
This is as far as I can go, please use it as a template only
because you need to take into account the precedence using ()
the logic of the eval was simply right to left so I think it is not what you want
Cheers
public interface Expression
String OR = "|";
String AND = "&";
public boolean eval(int value) throws Exception;
public class ExpressionImpl implements Expression
public String oper1;
public String operant;
public Expression tail;
/* (non-Javadoc)
* @see parser.Expression#eval()
public boolean eval(int value) throws Exception
int val1 = getValue(oper1);
if (null == tail)
System.out.println(val1 + ":" + value);
return (val1 == value);
else
if (OR.equals(operant))
return (val1 == value || tail.eval(value));
else if (AND.equals(operant))
return (val1 == value && tail.eval(value));
else
throw new Exception("unsupported operant " + operant);
private int getValue(String operator) throws Exception
Integer temp = ((Integer)Parser.symbol_table.get(operator));
if (null == temp)
throw new Exception("symbol not found " + operator);
return temp.intValue();
public String toString()
if (null == operant) return oper1;
return oper1 + operant + tail.toString();
public class Parser
public static HashMap symbol_table = new HashMap();
* recursive parsing
public Expression parse(String s)
ExpressionImpl e = new ExpressionImpl();
e.oper1 = String.valueOf(s.charAt(0));
if (s.length() == 1)
return e;
else if (s.length() > 2)
e.operant = String.valueOf(s.charAt(1));
e.tail = parse(s.substring(2));
else
throw new IllegalArgumentException("invalid input " + s);
return e;
public static void main(String[] args) throws Exception
Parser p = new Parser();
Parser.symbol_table.put("a", new Integer(1));
Parser.symbol_table.put("b", new Integer(2));
Parser.symbol_table.put("c", new Integer(3));
Parser.symbol_table.put("d", new Integer(4));
Expression e = p.parse("a|b|c&d");
System.out.println("input " + e.toString());
System.out.println(e.eval(2));
} -
SSRS Using Sum and = in a conditional operator
Hi,
Still getting to grips with SSRS so any help would be appreciated.
My aim is to calculate a conditional field using the SSRS expression feature, the datasource is a shared dataset which i can't alter so i can't just go an alter the SQL query or anything.
In SQL my query would be like this: SELECT COUNT(TotalHours) FROM TableName WHERE TotalHours <= 24
Is there anyway to combined the Iff and Sum operator's to get a result like the above?
At present all i managed to come up with is the below but obviously it's not returning the correct amount.
=IIf(Fields!TotalHours.Value <= "24", Sum(Fields!TotalHours.Value), 0 )
Please help!
Edit: Please note that i'm not trying to sum a field based on a condition that relates to another column, i just need a sum of 'TotalHours' that are less than or equal to 24, please also note there is another field called category, each category needs a
sum of the above.
Regards,
Marcus
Plain_CluelessHi Marcus,
According to your description, you want to count [TotalHours] when the value of this field is less than 24, right?
In your scenario, you could use the expression like below:
=Sum(IIF(Fields!TotalHours.Value<=24,1,0))
Please note don’t put this expression in the detail rows, you could refer to our test results:
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
'AND' Conditional operator in smartform
Hi experts,
I have to use AND condition in smartform (text).
For OR condition there is a standard icon sothat can use.
But how can we get AND contion in smartform.
if I am giving AND condition it is showing error
I have tries in SDN before posting my problem but i couldn't get solution for that
Please help me out of this problem.Hi Saravanan,
You dont need to give AND condtion. Just give two conditions in the conditions tab. it will work
Regards
Shanly -
List of PO's related to Condition record_tax amount
Hi MM gurus
Scenario ; Import scenario - there is a list of PO's created with Tax condition.But the tax will be applied during the invoice. Before creating the invoice need to the list of PO's and its tax amount.
Is there any standard SAP transaction to list PO's according to the Tax condition type and its tax amount.
Kindly revert back
Thanks
PPHi
By using table you can get tax percentages against tax condtion types. For values you have to use fuction module calculate_tax_item
1. SE11 - EKPO - contents - PO number - execute Note down tax against field MWSKZ
2. SE11 - A053 - contents - tax code - execute, Note down tax condtion record number and validity
3. SE11 - KONP - contents - conditioin record number - execurte, Note dow tax percentages against each condtion type
Raju -
Related to condition types and access sequence
Dear all,
i want to know abt one scenario, m using a pricing procedure with my service PO: ZVSTOT, in this Procedure, 12 condition types are there, during searching i found tat 3- 4 condition are are using different different access sequence, so i want to know tat in what procedure, we do it, what is use of it.?
plz reply me.Hi Nisha,
Prcing procedure configured in your service PO PO: ZVSTOT, Based on this pricing procedure system adopted the condition type in PO.
Please go through this below link to better understanding the MM-Pricing procedure
http://it.toolbox.com/wiki/index.php/Pricing_Determination_Process_-_MM
http://www.sap-img.com/materials/steps-for-mm-pricing-procedures.htm
CONDITIONS OR PRICING PROCEDURE or PRICE DETERMINATION PROCESS
We deal with the Pricing Procedure for vendors.
PB00 Gross Price (info record, contract, scheduled Agreement)
PBXX Gross Price (PO)
FRA1 Freight
RA00 Discount on net
RA01 Discount on Gross
ZA00 Surcharge on net
SKT0 Surcharge / discount
ZPB0 Rebates
MWVS Input Tax
MWAS Output Tax
BASB Base Amount
RM0000 Calculation Schema or Pricing Procedure
(PB00 & PBXX)
RM0002 Calculation Schema or Pricing Procedure
(PB00)
PB00 --> AB00
Copy the Standard one and create new one (ours)
RM0000 contains all the condition types
Pricing Procedure (PP)
We define the pricing procedure to define condition supplement for the material price. The condition supplement specifies the discount, surcharge, freight etc that we want a system every time to access material price condition records.
The total value of the material is calculated or based on all addition and subtraction i.e. discounts, surcharge, tax freight etc
Condition Table
It is a table, which defines the structure of condition record key.
Condition Record
It is a data record used to store conditions or condition supplements, i.e. condition like, discount, freight, and surcharge, Tax etc.
Condition Type
It is used for different functions. In Pricing the condition types leads you to differentiate different types of discounts, in output determination, batch determination, difference between two output types, such as delivery note or order confirmation, between different strategy types
Access Sequence
It specifies the order in which system searches or access the condition records from condition table
Difference between PB00 & PBXX
1. Condition maintained in PB00 is time dependent whereas PBXX is time independent.
2. Condition type PB00 u2013 used for IR, RFQ, Contract, Schedule Agreement
Condition type PBXX u2013 used for PO.
Calculation Schema
The main function of calculation schema is to provide framework of steps for the price determination process to specify the discounts, surcharge, freight rebate etc.
It also determines the sequence of conditions that are to be followed and in which sequence.
Schema Group Vendor
The main function of it is to identify or to pick the right process and conditions for a particular vendor.
Schema Group Purchasing Organization
Key that determines which calculation schema (pricing procedure) is to be used in purchasing documents assigned to the relevant purchasing organization.
Schema Group
It allows to group together the purchasing organizations, which uses the same calculation schema.
Steps: -
1. Create Access sequence
2. Create condition types
3. Create pricing procedure or calculation schema
4. Link pricing procedure & access sequence to condition type
5. Create schema group for vendor
6. Create schema group for purchase organization
7. Assign schema group vendor-to-vendor master record in purchasing data view
8. Assign schema group purchase organization to our purchase organization
9. In inforecord purchase organization data enter condition types and pricing or calculation procedure
CUSTOMIZE SETTINGS: -
SPRO > IMG>MM>PUR>Conditions -->Define price determination Process
1. Define access sequence
2. Define Condition type
3. Define cal. Schema
4. Define schema group
o Schema group vendor
o Schema group purchasing group
5. Assignment of schema group to PUR org
6. Define schema determination à determine cal schema for standard PO.
With Thanks,
Thiru -
Urgent issue related to condition type block
Dear expert I need your help on issue
Example Sales Deal # 123456:
If Sales Deal is opened with transaction VB22 (e.g. to add a condition record or to amend one), then all condition records appear first as released (blank in column u201CSu201D status and u201CPu201D processing status):
But just after a slight scroll within the screen, both columns get a value (u201CAu201D in column u201CSu201D and u201CDu201D in column u201CPu201D) and therefore appear as u201CBlockedu201D and u201CDouble Check Neededu201D:
But if the SAVE button is pressed, then the system reports, that no changes have been done:
Actually when we enter with transaction VB22, condition records are not blocked, but released:
But when we scroll then changes happened even we scroll in Vk12 or VB22
Condition validity u2013is 10.04.2008 to 01.06.2008
Regds
Alicia KYou can use lsmw and do a recording to insert those new customer fields. LSMW can call bdc recording and you can enter the values there...
-
When will C# get a REAL null-conditional operator?
I program in SWIFT and C# and I'm bummed to come back to C# for one reason. The freaking NULL REFERENCE error is a language design problem that I realized SWIFT avoided. Every type in SWIFT is either optional or not-optional, so there
is not a possibility of evaluating a null because non-optional types must be unwrapped with a null coalescing operator before you can evaluate it.
It seems like a problem easily fixed, why is there no operator like this in C#? (or maybe there is I don't know)
private CommandLineOptions GetOptions(string[] args) {
if (args?[0] == "i") {
// yay for not having to test ArgumentNullException and writing
// if(args != null && args[0] == "-i") ...
Scott WeedenHello ScrottWeeden,
I dont know how this works in SWIFT, but what I know is the importance of NULL in c#.
For example, you can use NULL to show that a value is not set.
E.g:
object _o
//... Work with _o;
if(_o != null) { //_o is not null, we can work with it!
_o.ToString();
} else {
//_o is NULL, handle this error
// -- OR --
try {
_o.ToString();
} catch(Exception ex) { //Error, if o is NULL. So can use ReferenceNullException insted of general Exception.
So, you can use to show tha an process failed, that data is invalid or something more.
PS: Struct is not allowed to konvert to null. (But you can use the followng code to avoid this:)
struct MyStruct {
//See: https://msdn.microsoft.com/de-de/library/b3h38hb0.aspx
MyStruct? _mstr;
if(_mstr.HasValue) //Is not NULL
//Real value
_mstr.Value;
//Set Null
_mstr = null;
© 2015 Thomas Roskop
Germany // Deutschland -
Conditional operator in where clause?
I have 4 assignable parameters for filtering records. If a parameter is not assigned the filter is ignored. This is working fine with the SQL-statement below except for one scenario: if none of the parameters are assigned I get no records at all but then I need all of the records.
with t as
select 1 as val, 'a' as var from dual union all
select 2 as val, 'a' as var from dual union all
select 3 as val, 'b' as var from dual union all
select 4 as val, 'b' as var from dual union all
select 5 as val, 'b' as var from dual union all
select 6 as val, 'c' as var from dual union all
select 7 as val, 'd' as var from dual union all
select 8 as val, 'e' as var from dual union all
select 9 as val, 'e' as var from dual union all
select 0 as val, 'f' as var from dual
select *
from t
where t.var = decode(:pvar1,'',null,:pvar1)
or t.var = decode(:pvar2,'',null,:pvar2)
or t.var = decode(:pvar3,'',null,:pvar3)
or t.var = decode(:pvar4,'',null,:pvar4)You need no "OR"s
<br>
SQL> var pvar1 char
SQL> var pvar2 char
SQL> var pvar3 char
SQL> var pvar4 char
SQL> with t as( select 1 as val, 'a' as var from dual union all
2 select 2 as val, 'a' as var from dual union all
3 select 3 as val, 'b' as var from dual union all
4 select 4 as val, 'b' as var from dual union all
5 select 5 as val, 'b' as var from dual union all
6 select 6 as val, 'c' as var from dual union all
7 select 7 as val, 'd' as var from dual union all
8 select 8 as val, 'e' as var from dual union all
9 select 9 as val, 'e' as var from dual union all
10 select 0 as val, 'f' as var from dual)
11 select *from t
12 where t.var = coalesce(:pvar1,:pvar2,:pvar3,:pvar4,t.var);
VAL V
1 a
2 a
3 b
4 b
5 b
6 c
7 d
8 e
9 e
0 f
10 rows selected.
SQL> exec :pvar4 := 'b';
PL/SQL procedure successfully completed.
SQL> with t as( select 1 as val, 'a' as var from dual union all
2 select 2 as val, 'a' as var from dual union all
3 select 3 as val, 'b' as var from dual union all
4 select 4 as val, 'b' as var from dual union all
5 select 5 as val, 'b' as var from dual union all
6 select 6 as val, 'c' as var from dual union all
7 select 7 as val, 'd' as var from dual union all
8 select 8 as val, 'e' as var from dual union all
9 select 9 as val, 'e' as var from dual union all
10 select 0 as val, 'f' as var from dual)
11 select *from t
12 where t.var = coalesce(:pvar1,:pvar2,:pvar3,:pvar4,t.var);
VAL V
3 b
4 b
5 b
Message was edited by:
jeneesh
I did mistake. Follow Dave's post
Maybe you are looking for
-
How to delete a number from imessage
I have deleted a number from my contacts and its still showing up on my imessage.How can i delete this number?
-
Auto email after execution of scheduled business rule
Hi All, We have certain business rules which will be scheduled on daily, weekly and monthly basis. Our requirement is that every time when a scheduled business rule is executed a email is sent to the administrator (specifying the name of BR and time
-
Hi everybody my problem is: I'm using Jdeveloper 10g, JSF, ADF Faces. I'm trying to do a test case using JUnit with JDeveloper but the method corresponding to test case requiere an objects javax.faces.context.ExternalContext; javax.faces.context.Face
-
HI Experts, Here i have the requirement that i have to send the details to printer depending on the IP, which i will get from Thirdparty(JAVA) So iam using the field PALPDHOST(IP Address) of Table TSP03D and iam taking the value of PADEST(from the s
-
Stoping Sales Order types from specific plant
Dear Friends, My client want to stop creation of specific sales order types from a specific plant. Means if that specific plant entered in sales order then system should not process that sales order further. Note : Material transference must not be a