Application Development and Automation 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: 
Read only

Logical Expression

Former Member
0 Likes
633

hi,

what is the difference between following two conditions

DATA : a(10) value 'kumar'.

IF a IS NOT INITIAL.

IF NOT a IS INITIAL.

regards,

Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
602

Hi,

Basically the two statements mean that checking the variable 'a' whether it contains any value or not.

thanks,

sksingh

4 REPLIES 4
Read only

Former Member
0 Likes
602

Hi,

IF a IS NOT INITIAL. - This is wrong statement. there is syntax error in this statement.

IF NOT a IS INITIAL - This is correct statement. There is no syntax error in this statement. this statement is checking whether the variable 'a' is empty or not.

rewards if useful.

thanks,

sksingh

Read only

0 Likes
602

hi sksingh,

there is no syndax error for both ..

regards,

kumar.

Read only

Former Member
0 Likes
603

Hi,

Basically the two statements mean that checking the variable 'a' whether it contains any value or not.

thanks,

sksingh

Read only

Former Member
0 Likes
602

Hi,

In previous versions of R/3 , IF a IS NOT INITIAL was a syntax error.

But now both versions are correct.

The second version was introduced because the first one was not very readable.

Between the two,

IF NOT a IS INITIAL is said to be faster since the comparison is positive logic.

IF a IS NOT INITIAL is said to be negative comparison logic. And checking equality is always faster than checking inequality.

But for readability, IF a IS NOT INITIAL is preferred. The performance advantage is not too high.

Hope this helps.