cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple statements in an IF THEN

Former Member
0 Kudos

Hi,

I have a report where, very occasionally, I might have multiple values in a collapsed line (@ two group levels actually, Pos, and Bez)

If I encounter this, I need to set a hi value and a lo value for each (displayed @ PosFooterA and B, and BezFooterA and B).

If I don't, I need the lo value to remain at 0, so I can check it, and collapse PozFooterB and BezFooterB.

As I recall, I've always been able to avoid multiple statements within an IF THEN, but here I am...

The error I'm getting is that the PolishPricePosHi just before the "and" needs to be a Boolean.

What is the syntax I need for this?

WhilePrintingRecords;

Global NumberVar PolishPricePosHi;

Global NumberVar PolishPricePosLo;

Global NumberVar PolishPriceBezHi;

Global NumberVar PolishPriceBezLo;

if {BW_ANGEB_STKL.BOM_PRODUKT} in [9101]

then

if PolishPricePosHi = 0

then PolishPricePosHi := {BW_ANGEB_STKL.PR_PREIS_ME}

else

if {BW_ANGEB_STKL.PR_PREIS_ME} > PolishPricePosHi

then PolishPricePosLo := PolishPricePosHi

and PolishPricePosHi := {BW_ANGEB_STKL.PR_PREIS_ME};

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

HI Matt,

Try:

WhilePrintingRecords;

Global NumberVar PolishPricePosHi;

Global NumberVar PolishPricePosLo;

Global NumberVar PolishPriceBezHi;

Global NumberVar PolishPriceBezLo;

if {BW_ANGEB_STKL.BOM_PRODUKT} in [9101]

then

(

  if PolishPricePosHi = 0 then

  PolishPricePosHi := {BW_ANGEB_STKL.PR_PREIS_ME}

  else if {BW_ANGEB_STKL.PR_PREIS_ME} > PolishPricePosHi then

  (

  PolishPricePosLo := PolishPricePosHi;

  PolishPricePosHi := {BW_ANGEB_STKL.PR_PREIS_ME};

  )

)

-Abhilash

Former Member
0 Kudos

Thank you Abhilash,

My logic is pretty sharp good, but my memory for syntax in abominable.

I was attempting a semi-colon to separate but was too sparse with my parenthesis.

Answers (0)