cancel
Showing results for 
Search instead for 
Did you mean: 

Key figures validation using Fox Formula as part of Planning function

Former Member
0 Kudos

Dear Experts,

I have a requirement as follows to validate the key figures :

Key figures 0CS_TRN_GC and 0CS_TRN_LC;

Char 0FISCYEAR, for which the value entered as '2007'

Requirement:

As part of planned data manual input, it should throw an error message when the first keyfigure value for year 2007 is not equal to second key figure value for the same year.

I wrote below code(derived from sdn help). Please suggest me the correct code as below code is not working and also guide me if the error message next to 'MESSAGE' is correct.

DATA DIFF TYPE F.

DIFF={0CS_TRN_GC, 2007}-{0CS_TRN_LC, 2007}.

IF DIFF<>0.

MESSAGE E001(UPF) REENTER THE VALUES.

ENDIF.

Your help is much appreciated and full points will be rewarded for your cooperation

Regards

Shanthi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Also change the MESSAGE statement as below:

MESSAGE E001(UPF) WITH 'REENTER THE VALUES'.

Former Member
0 Kudos

Hi Mayank,

thanks for the suggestions.

I have implemented both your suggestions(spaces and '' in message).

and the 0FISCYEAR is ticked as 'to be changed'

I am still getting 'Formula error : } expected'

Current code is as below :

DATA DIFF TYPE F.

DIFF = {0CS_TRN_GC, 2007} - {0CS_TRN_LC, 2007}.

IF DIFF<>0.

MESSAGE E001(UPF) WITH 'REENTER THE VALUES'.

ENDIF.

Please advise

Regards

Shanthi

Former Member
0 Kudos

Hi,

Please specify the new complete code. The error message mentions which line and column the error was found. Please specify this also.

At the bottom of the formula editor, you have the operands list for the formula mentioned like <i>Operand:{Key figure name, .......}</i>. Please specify this also. This would help to identify exactly what problem you are having.

Former Member
0 Kudos

Hi Mayank,

Please see below details

The error :

Formula error: Formula element DIFF<>0 could not be recognized

Syntax error in row 14, column 4

The complete code :

DATA DIFF TYPE F.

DIFF = {0CS_TRN_GC, 2007} - {0CS_TRN_LC, 2007}.

IF DIFF<>0.

MESSAGE E001(UPF) WITH 'REENTER THE VALUES'.

ENDIF.

The message at the bottom says :

Operand: {Key figure name, 0FISCYEAR}

Strangely the previous error with '}' is disappeared.

Regards

Shanthi

Former Member
0 Kudos

Hi Mayank,

see below for the code in the editor including the example code :

**********************************************************************************************

  • FORMULA EXAMPLE:

  • CHANGE THE VALUE OF THE KEYFIGURE ZQUANTITY OF PRODUCT11

  • TO THE VALUE OF ZQUANTITY OF PRODUCT09 TIMES 1.1

  • ASSUMPTION FOR FIELDS TO BE CHANGED: ZPRODUCT

  • ==> OPERAND: {NAME OF KEYFIGURE, ZPRODUCT}

**********************************************************************************************

  • DATA L_FACTOR TYPE F.

  • L_FACTOR = 1.1.

  • { ZQUANTITY, PRODUCT11 } = { ZQUANTITY, PRODUCT09 } * L_FACTOR.

**********************************************************************************************

DATA DIFF TYPE F.

DIFF = {0CS_TRN_GC, 2007} - {0CS_TRN_LC, 2007}.

IF DIFF<>0.

MESSAGE E001(UPF) WITH 'REENTER THE VALUES'.

ENDIF.

Former Member
0 Kudos

Hi,

Ya please also change that statment as below (space

IF DIFF <> 0.

Former Member
0 Kudos

I just did it and its working fine.

Thank you very much for you help

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I hope you have marked 0fiscyear as 'to be changed'.

Please specify the error message that you get when you press 'check formula'.

Also do the following things - Change the below statement by putting spaces like

DIFF = {0CS_TRN_GC, 2007} - {0CS_TRN_LC, 2007}.