cancel
Showing results for 
Search instead for 
Did you mean: 

script IF condition problem

Former Member
0 Kudos

Hi experts

data var type i value 10. defined in print program,

i wrote a text element in scrpt form

/E ELE

/: IF &VAR& EQ 10

  • welcome

/: ELSE

  • bye

/:ENDIF

called in write_form

Output : bye

why it executes else part, please help me

thanks

sitaram

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Change your code to the following.

/E ELE

/: IF &VAR& = '10'

welcome

/: ELSE

bye

/:ENDIF

Former Member
0 Kudos

Replace 'bye' with &VAR& to see what the sapscript if receiving. Your IF logic looks good to me, so I'm thinking there's an issue with the print program. Is var a global data element?

Former Member
0 Kudos

change /: IF &VAR& EQ 10 to

/: IF &VAR& EQ '10'

Former Member
0 Kudos

hi

No change in output

thanks