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

IF Stmt - Syntax Error

Former Member
0 Likes
915

Hi,

Can you please tell me how to write the follwing stmt. It is giving syntax error.

IF VBAK-ERNAM = 'BATCHUSER'

OR VBAK-ERNAM = 'REDDYV'

NO_ORDER1 = NO_ORDER1 + 1.

ELSE.

NO_ORDER2 = NO_ORDER2 + 1.

ENDIF.

Thanks

Veni.

1 ACCEPTED SOLUTION
Read only

LucianoBentiveg
Active Contributor
0 Likes
871

IF VBAK-ERNAM = 'BATCHUSER'

OR VBAK-ERNAM = 'REDDYV'<b>.</b>

NO_ORDER1 = NO_ORDER1 + 1.

ELSE.

NO_ORDER2 = NO_ORDER2 + 1.

ENDIF.

And VBAK defined in TABLES statment.

5 REPLIES 5
Read only

LucianoBentiveg
Active Contributor
0 Likes
872

IF VBAK-ERNAM = 'BATCHUSER'

OR VBAK-ERNAM = 'REDDYV'<b>.</b>

NO_ORDER1 = NO_ORDER1 + 1.

ELSE.

NO_ORDER2 = NO_ORDER2 + 1.

ENDIF.

And VBAK defined in TABLES statment.

Read only

0 Likes
871

hi,

u'r if statement

IF VBAK-ERNAM = 'BATCHUSER'

OR VBAK-ERNAM = 'REDDYV'.

NO_ORDER1 = NO_ORDER1 + 1.

ELSE.

NO_ORDER2 = NO_ORDER2 + 1.

ENDIF.

is working fine when i executed here check whether u have declared VBAK in the beginning...

i.,e <b>TABLES: VBAK.</b>

Read only

Former Member
0 Likes
871

What syntax error are you getting?

Read only

0 Likes
871

Sam I got it. Thank you.

Read only

Former Member
0 Likes
871

Veni,

You are missing period '.' after

"OR VBAK-ERNAM = 'REDDYV' "

So right statment is..

IF VBAK-ERNAM = 'BATCHUSER'

OR VBAK-ERNAM = 'REDDYV'. " Period in the end

NO_ORDER1 = NO_ORDER1 + 1.

ELSE.

NO_ORDER2 = NO_ORDER2 + 1.

ENDIF.

Cheers,

Nilesh