cancel
Showing results for 
Search instead for 
Did you mean: 

Absolute value in a macro

Former Member
0 Kudos

Hi Experts,

Good day!

I am creating a macro that needs an absolute value to be taken into account. I am wondering if it is possible to get the absolute value of a row: Key Figure?

And the output will be compared to a variable set.

My logic should be like this:

If

ABS (row: Key FigureA)

>

LAYOUTVAR_VALUE('XXXX')

     Then

Key Figure B = -XXXX

Thanks a lot in advance for the help!

Kris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Krish,

In that case please refer to the following sdn link with similar issue .

http://scn.sap.com/thread/1520533

This will surely help you.

Thanks,

Anurag

Former Member
0 Kudos

Hi Anurag,

Thanks for your helpful link. I have another question, is it possibe to compare the output of ABS (Key Figure) to a LAYOUTVAR_VALUE('XXXX') in one condition step?

Thanks a lot!

Regards,
Kris

Former Member
0 Kudos

Hello,

Yes of course , but make sure you use the operator/function while giving the IF condition.

e.g.

IF    ---- operator/Fuction

ABS( ---- operator/Fuction

Key figure from table

) ---- operator/Fuction

> --- operator/Fuction

LAYOUTVAR_VALUE('XXXX')  ---- operator/Fuction

<your then condition>

Just to clear I have not used such macro but this syntax might work in your case.

Thanks,

Anurag

Answers (0)