cancel
Showing results for 
Search instead for 
Did you mean: 

if condition in Script

Former Member
0 Kudos

Hi All,

i am using if statement in script but it is not checking

/: if condition or condition1 or condition 2

  • &variable1& &variable2&

/:else.

  • &variable3& &variable4&

/:endif.

here it is not checking the conditions it is printing continuouasly all the variables variable1 variable2 variable3 variable4.

Please let me know the solution as i am new to scripts

regards,

kumar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Answered

Former Member
0 Kudos

Hi,

You need to give condition in script as follows:

/: If v_plant eq '7080'.

  • &variable1&

/: endif.

Give fullstop after your If condition.

Thanks,

Archana

Former Member
0 Kudos

Hi..

The syntax of the command could be incorrect.

http://help.sap.com/saphelp_40b/helpdata/en/d1/80325f454211d189710000e8322d00/content.htm

Please check the above link's last paragraph which says :

"If a syntax error occurs in the interpretation of this command, then the command is not executed. This may have an unexpected effect on the subsequent text output. For example, if the IF statement is incorrect, then all following ELSEIF and ELSE commands will be ignored, since the opening IF command is u2018missingu2019. This will cause all the text lines attached to the ELSEIF and ELSE commands to be printed."

Regards,

Karthik