Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

what is the conditional operator for AND, OR .....?

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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...

12 REPLIES 12

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos
if c1 = 'X' and c2 = 'X',.
write:/ 'Both Check boxes are checked'.
endif.

0 Kudos

Hi

IF c1 = 'X' AND c2 = 'X'.

ENDIF.

Rgds,

Prakash

0 Kudos

Removing post

Message was edited by:

Nishant Rustagi

Former Member
0 Kudos

Hi Shiva,

In the ABAP editor write AND and press F1.You will get the help related to conditional operator.

Mukesh Kumar

Former Member
0 Kudos

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

Former Member
0 Kudos

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...

0 Kudos

thank u murali, it was helpful,

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

parameters : c1 as checkbox,

c2 as checkbox.

if c1 = 'X' and c2 = 'X'.

write : 'Checked'.

endif.

Former Member
0 Kudos

thank u all for the response...