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: 

HELP WITH AND CONDTION

Former Member
0 Kudos

HI,

i use And statment and its not working

what i doing wrong ?

Regards

IF l_ffact NE '1' AND l_tfact NE '1' .

l_rate = l_tfact DIV l_ffact.

ENDIF.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

do like this.

IF (l_ffact NE '1' AND l_tfact NE '1' ).

l_rate = l_tfact DIV l_ffact.

ENDIF.

rgds,

bharat.

11 REPLIES 11

Former Member
0 Kudos

Hi,

Check this

data : temp type i value '1',
       temp1 type i value '2'.

       if temp eq 1 and temp1 eq 2.
       write : temp.
       endif.

*

Thanks.

Former Member
0 Kudos

hi,

do like this.

IF (l_ffact NE '1' AND l_tfact NE '1' ).

l_rate = l_tfact DIV l_ffact.

ENDIF.

rgds,

bharat.

0 Kudos

hi bharat

i try like u write and its not working way?

<b>l_ffact = 10000

l_tfact = 1</b>

IF ( l_ffact ne '1' and l_tfact ne '1' ).

l_rate = l_tfact DIV l_ffact.

ENDIF.

thankes

0 Kudos

Hi,

Check this now its working fine.

data : l_ffact type i,
       l_tfact type i,
       l_rate type i.

       break-point.

l_ffact = 10000.
l_tfact = 1.
IF ( l_ffact ne '1' and l_tfact ne '2').

l_rate = l_tfact DIV l_ffact.

ENDIF.

Thanks.

0 Kudos

hi viji

thankes

now its work (with l_tfact NE '2') but i wont to now if l_tfact NE '1'

what is the problem?

like that

IF ( l_ffact NE <b>'1'</b> AND l_tfact NE <b>'1'</b> ).

regards

0 Kudos

Hi,

You gave the And condition in loop statement.

So the both cases <b> l_ffact NE '1'</b> and <b> I_tfact NE '1'</b> are satisfied only your condition will be true.

But in your case the first condition only true <b>[ l_ffact NE '1' --> Bcoz its original value is 1000]</b>

Your condition is false like [ l_tfact NE '1' ---> but l_tfact NE '1' value is 1].

Thanks.

0 Kudos

Hi,

u r assigning the value equal to 1.and in the if condition ur checking for condition NE(Not Equal).so that condition is always false so the statements in IF...ENDIF are not working.

rgds,

bharat.

0 Kudos

thankes

in tahyt case i have to use or

regards

Former Member
0 Kudos

Hi,

As per your given syntax, when the <b>IF</b> condition is satisfied, the stmt. within <b>IF..ENDIF</b> is executed.

Hope this resolves your query.

Regards

Nagaraj

Former Member
0 Kudos

this statement will work if u r condition will satisfy

Former Member
0 Kudos

Hi Tal,

As per my understanding if you use AND it will check for both conditions. If your requirement is either one of them has to be satisfied use OR condition.

If my understanding is not wrong try with OR condition.

Regards,

Ramakrishna kotha.