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

Comparing fields

Former Member
0 Likes
746

Hi,

I am getting problem with comparing blank fields in table gt_in. Syntax is this...

IF GT_IN-BSTART = ' ' AND GT_IN-BEND = ' ' AND GT_IN-FSTART = ' '

GT_IN-FEND = ' ' AND GT_IN-ASTART = ' ' AND GT_IN-AEND = ' '.

Error:

Incorrect logical expression: Comparison / SELECT-OPTION can only be followed by "AND", "OR" or ")".

Regards

Reddy

6 REPLIES 6
Read only

suresh_datti
Active Contributor
0 Likes
713

You missed one AND.. use the following..

IF GT_IN-BSTART = ' ' AND GT_IN-BEND = ' ' AND GT_IN-FSTART = ' ' AND
GT_IN-FEND = ' ' AND GT_IN-ASTART = ' ' AND GT_IN-AEND = ' '.

~Suresh

Read only

Former Member
0 Likes
713

IF ( GT_IN-BSTART = ' ' AND

GT_IN-BEND = ' ' AND

GT_IN-FSTART = ' ' <b>and</b>

GT_IN-FEND = ' ' AND

GT_IN-ASTART = ' ' AND

GT_IN-AEND = ' ' ).

YOu missed one AND(the one in bold).

Regards,

Ravi

Read only

Former Member
0 Likes
713

between these 2 fields in the if condition, there is no AND operator given

GT_IN-FSTART = ' '

GT_IN-FEND = ' '

Read only

Former Member
0 Likes
713

Hi Chandu,

You are missing one 'AND' inbetween the expression. Use the code below:

IF GT_IN-BSTART = ' ' AND GT_IN-BEND = ' ' AND GT_IN-FSTART = ' ' <b>AND</b> GT_IN-FEND = ' ' AND GT_IN-ASTART = ' ' AND GT_IN-AEND = ' '.

Hope this helps,

Pragya

Read only

Former Member
0 Likes
713

Hi Chandu,

You are missing and AND statement inbetween. Just check below which added in bold letters.

IF GT_IN-BSTART = ' ' AND GT_IN-BEND = ' ' AND GT_IN-FSTART = ' ' <b>AND</b>

GT_IN-FEND = ' ' AND GT_IN-ASTART = ' ' AND GT_IN-AEND = ' '.

Regards,

Suresh P

Read only

Former Member
0 Likes
713

IF GT_IN-BSTART = ' ' AND GT_IN-BEND = ' ' AND GT_IN-FSTART = ' ' <b>AND</b>

GT_IN-FEND = ' ' AND GT_IN-ASTART = ' ' AND GT_IN-AEND = ' '.

Surely you were missing the 'AND'in your above statement the other way to check blank is to use IS INITIAL check.

IF GT_IN-BSTART IS INITIAL AND

GT_IN-BEND IS INITIAL AND

GT_IN-FSTART IS INITIAL AND

GT_IN-FEND IS INITIAL AND

GT_IN-ASTART IS INITIAL AND

GT_IN-AEND IS INTIAL.

....

ENDIF.