cancel
Showing results for 
Search instead for 
Did you mean: 

Default logic for Net variation

Former Member
0 Kudos

  I have the following  Default script logic for net variation. My understanding of the function is that whenever the data is entered, system should run the default and caculate the net variation. For example my end flow for a BS account relevant for net variation is 1000 and the OB flow is zero, default logic should calculate the net variation which in this case is 1000. But this is not happening. Pl let me know whether my line of thinking is correct and if not what is this suppose to do.

Calculating F15 - net variation as the difference between closing and the sum of other balance sheet flows

//---------------------------------------------------------------------------------------------------------------------------------------------

// Information: [XDIM_MEMBERSET FLOW = <all>] is mandatory in the default logic

 

 

*XDIM_MEMBERSET MEASURES = YTD

*XDIM_MEMBERSET ACCOUNT = <all>

*XDIM_MEMBERSET FLOW = <all>

*XDIM_MEMBERSET AUDITID = %AUDITID_LIST%

*WHEN ACCOUNT.GROUP

*IS "BSA"

*WHEN ACCOUNT.ACCTYPE

*IS "AST", "LEQ"

*WHEN FLOW

*IS "F99"

*REC(FACTOR = 1,FLOW = "F15")

*ELSE

*WHEN FLOW.PARENTH1

*IS "END"

*WHEN FLOW

*IS "F15"

// nothing

*ELSE

*REC(FACTOR = -1,FLOW = "F15")

*ENDWHEN

*ENDWHEN

*ENDWHEN

*ENDWHEN

*ENDWHEN

*COMMIT

Appreciate an answer.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

Hi,

Some generic comments about your code:

1. Avoid usage of XDIM_MEMBERSET in the default.lgf. The default.lgf will receive a scope based on the send members and your code have to do calculations using *IS criteria in WHEN/ENDWHEN.

2. Do not use *COMMIT with WHEN/REC/ENDWHEN - this loop will do autocommit at the end. The side effect of *COMMIT is that it will reset scope to the incoming script scope.

3. Test your code in UJKT emulating user input (store some values in advance, then define UJKT scope to include this values). With UJKT log you can better understand what's going on.

B.R. Vadim

Former Member
0 Kudos

Hi

Thanks for your observations and my reply is as follows:

The default logic which i reproduced above is from IFRS starter kit and it is not my coding. I also tested the same with UJKT and did not find anything wrong. More than the working of this code, I would like to be conceptually clear how this code is getting triggered and what is the final outcome of this and how to validate this? Any suggestion on this would be appreciated. I also referred some of the SAP publications on BPC and this topic has not found a place for discussion.

Br

SAP Boss

former_member186338
Active Contributor
0 Kudos

Hi,

My recommendation - never copy scripts, write code yourself. Start with simple scripts and test results.

The default.lgf script is triggered after the user data is saved to the database and is launched with the scope of all members that was send. This behavior can be simulated by UJKT (see my previous post). If the script will work in UJKT, then it will work as default.lgf (at least for BPC 10, with 7.5 there is a small difference).

Vadim

Former Member
0 Kudos

Hello

Thanks for the reply and also your suggestion. I am trying the above only in IFRS kit and it is triggering the calculation. That is why I would like to know how it works conceptually.

Br

SAP BOSS

former_member186338
Active Contributor
0 Kudos

If you think that the scripts in IFRS kit are always correct then no comments

At least COMMIT at the end of this script is absolutely useless.

Then if this script is default.lgf then it will recalculate everything for each value send, because of the following lines:

*XDIM_MEMBERSET ACCOUNT = <all>

*XDIM_MEMBERSET FLOW = <all>

will replace the original scope by all members of ACCOUNT and FLOW. It's not an efficient way of doing things.

I have reorganized lines of script and add some comments:

*XDIM_MEMBERSET MEASURES = YTD

*XDIM_MEMBERSET ACCOUNT = <all>

*XDIM_MEMBERSET FLOW = <all>

*XDIM_MEMBERSET AUDITID = %AUDITID_LIST%

*WHEN ACCOUNT.GROUP

*IS "BSA"

  *WHEN ACCOUNT.ACCTYPE

  *IS "AST", "LEQ" //Balance accounts

    *WHEN FLOW

    *IS "F15"

      // Do nothing

    *IS "F99"

      *REC(FACTOR = 1,FLOW = "F15") //Add value with FLOW=F99 to FLOW=F15

    *ELSE // Other FLOW <> F15,F99

      *WHEN FLOW.PARENTH1

      *IS "END" // Olny FLOW having parent END

        *REC(FACTOR = -1,FLOW = "F15") //Add -(value) with FLOW<>F15 AND FLOW<>99 AND FLOW.PARENTH1=END to FLOW=F15

      *ENDWHEN

    *ENDWHEN

  *ENDWHEN

*ENDWHEN

Vadim