04-09-2007 8:59 AM
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...
shiva
04-09-2007 9:21 AM
Shiva,
Say we have 2 check boxes p_chk1 and p_chk2.
This is For "AND"
IF p_chk1 eq 'X' and
p_chek2 eq 'X'.
Write : 'Both Check boxes are selected.'
Endif.
Don't forget to reward if useful...
04-09-2007 9:03 AM
Hi,
Please check the code below for conditional operators:
IF NOT gs_itab2-augru IS INITIAL
OR NOT gs_itab2-cdate IS INITIAL.
DELETE gt_final WHERE schannel NE pa_schan.
AND splitting_criteria ne pa_posc.
Regards
Kannaiah
04-09-2007 9:05 AM
AND \ OR is available in ABAP,
you can use it like this ,
for example,
<b>IF ( sy-subrc NE 0 ) AND ( itab[] IS INITIAL ).
..........
..........
..........
ENDIF.</b>
For full documention type AND in ABAP editor and press F1.
Hope this helps.
Regards,
Senthil N S
04-09-2007 9:15 AM
For example,
I have 2 check boxes c1 and c2,
I want to put condition that, if c1 and c2 are checked, it should display both are selected with write statement.
04-09-2007 9:19 AM
if c1 = 'X' and c2 = 'X',.
write:/ 'Both Check boxes are checked'.
endif.
04-09-2007 9:21 AM
04-09-2007 9:29 AM
04-09-2007 9:09 AM
Hi Shiva,
In the ABAP editor write AND and press F1.You will get the help related to conditional operator.
Mukesh Kumar
04-09-2007 9:10 AM
Hi,
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
04-09-2007 9:21 AM
Shiva,
Say we have 2 check boxes p_chk1 and p_chk2.
This is For "AND"
IF p_chk1 eq 'X' and
p_chek2 eq 'X'.
Write : 'Both Check boxes are selected.'
Endif.
Don't forget to reward if useful...
04-17-2007 12:50 PM
04-09-2007 9:24 AM
Hi,
parameters : c1 as checkbox,
c2 as checkbox.
if c1 = 'X' and c2 = 'X'.
write : 'Checked'.
endif.
04-09-2007 9:28 AM