Skip to Content
avatar image
Former Member

script IF condition problem

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 26, 2008 at 03:56 PM

    change /: IF &VAR& EQ 10 to

    /: IF &VAR& EQ '10'

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 26, 2008 at 05:13 PM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 27, 2008 at 04:34 AM

    Hi Change your code to the following.

    /E ELE

    /: IF &VAR& = '10'

    welcome

    /: ELSE

    bye

    /:ENDIF

    Add comment
    10|10000 characters needed characters exceeded