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: 

IF Stmt - Syntax Error

Former Member
0 Kudos

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

LucianoBentiveg
Active Contributor
0 Kudos

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

LucianoBentiveg
Active Contributor
0 Kudos

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.

0 Kudos

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>

Former Member
0 Kudos

What syntax error are you getting?

0 Kudos

Sam I got it. Thank you.

Former Member
0 Kudos

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