cancel
Showing results for 
Search instead for 
Did you mean: 

Shortcut or writing multiple and statements

Former Member
0 Kudos

What shortcut can I use to write the following code shorter?  There must be a way.

if @formula1 = A and @formula2 = A and @formula3 = A and @formula4 = A and @formula5 = A

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

The only way to "shorten" this statement would be to create a separate formula for each condition.  For example:

{@Check1}

@fomula1 = A

{@Check2}

@formula2 = A

etc.

This would change the "if" statement to something like:

If {@Check1} and {@Check2} and {@Check3}...

Other than that, there is no "shorthand" coding for this type of statement.

-Dell

Answers (2)

Answers (2)

Former Member
0 Kudos

stringvar check_value:=@formula1 & @formula2 & @formula3 & @formula4 & @formula5;

if check_value="AAAAA" then true else false

abhilash_kumar
Active Contributor
0 Kudos

Hi Aaron,

I think you asked a similar question sometime ago and Dell and I had replied back then. See if the same suggestion works:

http://scn.sap.com/message/13862523

-Abhilash