cancel
Showing results for 
Search instead for 
Did you mean: 

Function FIX_CALC does not work

Former Member
0 Kudos

Hello Experts,

I am trying to write a macro to adjust other CHAR Vlaues keeping the AGGREGATE value fixed. I am using the Function FIX_CALC. Here is the scenario:

KF Aggregate = 100

CHAR VALUE1 = 40

CHAR VALUE2 = 20

CHAR VALUE3 = 20

CHAR VALUE4 = 20

I expect that if I change the Values, the KF aggregate should remain 100, but it is not happening. Here is the sysntax I tried:

Step: Fix Calc : ( 12 Iterations : M 07/2011; M 06/2012 )

Calculate {activity bar}

FIX_CALC(

Row: Order qty : ( Frm M 07/2011 )

Row: Order qty : ( Frm M 07/2011 )

)

Thanks and Regards,

Rohit

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member187488
Active Contributor
0 Kudos

Dear Rohit,

I've tested this macro in our internal system. And I finally made it work.

During my test, I found the following points for you to share:

1)The syntax of the macro:

Syntax:

FIX_CALC( KEYFIGURE ; FIXED_KEYFIGURE [; INPUT_CHECK [; ZERO_FIXED_KEYFIGURE]]

PARAMETERS :

KEYFIGURE = Key Figure (Line number)

FIXED_KEYFIGURE = Fixed value

INPUT_CHECK = (optional) Flag: Peform Input Check

ZERO_FIXED_KEYFIGURE = Key Figure containing zero fixed value (Line number)

FIX_CALC( X1; X2: <input check> ) performs fixing calculation with X1 as the row containing the key figure with the value to be fixed and X2 the key figure for the fixed values. If the input check indicator is set(for instance X), the system tries to correct any inconsistencies that may occur due to changes being made on the detail level.

Please remember that this function DOES NOT FIX any keyfigure values. FIX_CALC really only "redistributes" the details below one aggregated value with the value that is populated as X2. Nothing else.

To work with zero values you have to assign the zero fixed keyfigure in macro FIX_CALC().

The fourth parameter is again a key figure and this key figure has to be used for zero fixing calculation. If you enter in this fourth key figure a value which is not equal to zero (so any value is OK), and the fixing value is zero, then the recalculation to zero is executed.

2)For the first 2 parameters, we should not use the same key figure.

There's a basic rule that in the macro's one step, we cannot read and write to the same key figure.

There must be a value provided for the second parameter, which is not read from the first parameter's key figure.

So if there's no second key figure in your case, I think that you can add a step, to copy the value on aggregated level to a layout variable. Then in the second step that uses 'FIX_CALC()', provide the layout variable as the second parameter.

3)The execution level.

As stated in the documentation, the macro cannot be executed at detailed level, so please set the macro to be executed at the aggregated level (Level 0).

4)The first parameter.

Please notice that we should provide line number instead of key figure value here, so please set this row's datasource as 'Row Attribute'.

5)The third parameter.

Please provide the third parameter as "INPUT_CHECK" to make auto adjustment.

(But it seems the macro also works without this parameter provided, you can make further test if interested.)

Hope your macro also works well.

Best Regards,

Ada