Skip to Content
0

Logic Script Issue

May 10 at 05:42 PM

41

avatar image

Hi,

I have an issue with the logic script in (SAP BPC NW 10.0) which is working same for two different months,

Please find the attached file for all the necessary details.

logic.txt

Thanks,

Samhita

image.png (32.1 kB)
logic.txt (8.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Vadim Kalinin May 11 at 09:46 AM
0

Now the issue is clear!

Instead of:

*REC(EXPRESSION= %VALUE%>0 ? %VALUE%-[ACCOUNT].[IC_VAR_ADJ]: %VALUE%+[ACCOUNT].[IC_VAR_ADJ], AUDIT_TRAIL=INPUT,FLOW=F20)

Use:

*REC(EXPRESSION= %VALUE%>0 ? %VALUE%-([ACCOUNT].[IC_VAR_ADJ],[AUDIT_TRAIL].[IC_ADJ],[FLOW].[F_IC]) : %VALUE%+([ACCOUNT].[IC_VAR_ADJ],[AUDIT_TRAIL].[IC_ADJ],[FLOW].[F_IC]))

And correct scope to:

*XDIM_MEMBERSET AUDIT_TRAIL=INPUT
*XDIM_MEMBERSET FLOW =F20

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thank you :-)

0
Samhita Vankayalapati

When you scope for WHEN/ENDWHEN - you scope for %VALUE%, not for extra data used in calculations!

0
Vadim Kalinin May 10 at 07:33 PM
0

First - it's not comfortable to read text attachment - why not to prepare question like here:

https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

Second:

You have formula for scoped *XDIM_MEMBERSET ACCOUNT= 340900:

REC(EXPRESSION= [ACCOUNT].[IC_VAR_ADJ]>0 ? %VALUE%+[ACCOUNT].[IC_VAR_ADJ]: %VALUE%-[ACCOUNT].[IC_VAR_ADJ]

IC_VAR_ADJ
2018.04 = -1366

340900

2018.04 = -16062

Result:

-1366<0

-16062-(-1366)=-16062+1366=14696

Why do you think that the result will be: 2018.04 = -17428???

Are you sure that:

340900

2018.04 = -16062???

May be:

340900

2018.04 = -17428

Then -16062 is a correct result!

Show 9 Share
10 |10000 characters needed characters left characters exceeded

Hi,

As per above answer I have made the changes as required for the expected result.

But this logic also works only for 2018.02 and not for 2018.04.

Kindly find the attached for all necessary details.

Logic goes as below:

*XDIM_MEMBERSET ACCOUNT= 340900, IC_VAR_ADJ
*XDIM_MEMBERSET TIME= %TIME_SET%
*XDIM_MEMBERSET CURRENCY= USD
*XDIM_MEMBERSET VERSION= Test
*XDIM_MEMBERSET SCOPE= S_NONE
*XDIM_MEMBERSET ENTITY=CO_1000
*XDIM_MEMBERSET COST_CENTER = CC_NONE
*XDIM_MEMBERSET PROFIT_CENTER=PC_NONE
*XDIM_MEMBERSET FUNCTIONAL_AREA=FA_NONE
*XDIM_MEMBERSET INTERCO=I_NONE
*XDIM_MEMBERSET AUDIT_TRAIL=INPUT,IC_ADJ
*XDIM_MEMBERSET FLOW =F20,F_IC
*XDIM_MEMBERSET MEASURES= YTD
*WHEN ACCOUNT
*IS 340900
*REC(EXPRESSION= %VALUE%>0 ? %VALUE%-[ACCOUNT].[IC_VAR_ADJ]: %VALUE%+[ACCOUNT].[IC_VAR_ADJ], ACCOUNT =340900,ENTITY=CO_1000,PROFIT_CENTER=PC_NONE,COST_CENTER=CC_NONE,FUNCTIONAL_AREA=FA_NONE,AUDIT_TRAIL=INPUT,FLOW=F20,INTERCO=I_NONE,VERSION=Test,SCOPE=S_NONE)
*ENDWHEN
*COMMIT

0
Samhita Vankayalapati

Sorry, but you are not reading: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues

Please explain the required logic in words!

Corrected!

0

Continuation

FOR 2018.02

Before logic values of accounts IC_VAR_ADJ and 340900

1.png (8.2 kB)
2.png (6.9 kB)
0

UJKT screen

3.png (25.7 kB)
4.png (126.2 kB)
0

After logic executed result for 340900 which is correct as per logic

5.png (6.3 kB)
0

2018.04

Before logic values of accounts IC_VAR_ADJ and 340900,

6.png (6.3 kB)
7.png (6.3 kB)
0

UJKT screen

8.png (23.7 kB)
9.png (121.6 kB)
0
Samhita Vankayalapati

Screenshots not visible, better to insert log text using "CODE" button!

0

After logic is executed the result of 340900

But as per the logic 340900 after value should be

340900 = -17428.73

Hope I have asked the question clearly this time.

Thanks,

Samhita

10.png (6.4 kB)
0
Vadim Kalinin May 11 at 08:25 AM
0

To ensure that you have correct data please run in UJKT and post results:

*XDIM_MEMBERSET ACCOUNT= 340900, IC_VAR_ADJ
*XDIM_MEMBERSET TIME= 2018.04
*XDIM_MEMBERSET CURRENCY= USD
*XDIM_MEMBERSET VERSION= Test
*XDIM_MEMBERSET SCOPE= S_NONE
*XDIM_MEMBERSET ENTITY=CO_1000
*XDIM_MEMBERSET COST_CENTER = CC_NONE
*XDIM_MEMBERSET PROFIT_CENTER=PC_NONE
*XDIM_MEMBERSET FUNCTIONAL_AREA=FA_NONE
*XDIM_MEMBERSET INTERCO=I_NONE
*XDIM_MEMBERSET AUDIT_TRAIL=INPUT,IC_ADJ
*XDIM_MEMBERSET FLOW =F20,F_IC
*XDIM_MEMBERSET MEASURES= YTD
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%)
*ENDWHEN

It will not change figures

Show 4 Share
10 |10000 characters needed characters left characters exceeded

P.S. Useless code removed from your script:

*XDIM_MEMBERSET ACCOUNT= 340900
*XDIM_MEMBERSET TIME= 2018.04
*XDIM_MEMBERSET CURRENCY= USD
*XDIM_MEMBERSET VERSION= Test
*XDIM_MEMBERSET SCOPE= S_NONE
*XDIM_MEMBERSET ENTITY=CO_1000
*XDIM_MEMBERSET COST_CENTER = CC_NONE
*XDIM_MEMBERSET PROFIT_CENTER=PC_NONE
*XDIM_MEMBERSET FUNCTIONAL_AREA=FA_NONE
*XDIM_MEMBERSET INTERCO=I_NONE
*XDIM_MEMBERSET AUDIT_TRAIL=INPUT,IC_ADJ
*XDIM_MEMBERSET FLOW =F20,F_IC
*XDIM_MEMBERSET MEASURES= YTD
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION= %VALUE%>0 ? %VALUE%-[ACCOUNT].[IC_VAR_ADJ]: %VALUE%+[ACCOUNT].[IC_VAR_ADJ], AUDIT_TRAIL=INPUT,FLOW=F20)
*ENDWHEN

0
UJKT Result

LGX:


*XDIM_MEMBERSET ACCOUNT= 340900, IC_VAR_ADJ
*XDIM_MEMBERSET TIME= 2018.04
*XDIM_MEMBERSET CURRENCY= USD
*XDIM_MEMBERSET VERSION= Test
*XDIM_MEMBERSET SCOPE= S_NONE
*XDIM_MEMBERSET ENTITY=CO_1000
*XDIM_MEMBERSET COST_CENTER = CC_NONE
*XDIM_MEMBERSET PROFIT_CENTER=PC_NONE
*XDIM_MEMBERSET FUNCTIONAL_AREA=FA_NONE
*XDIM_MEMBERSET INTERCO=I_NONE
*XDIM_MEMBERSET AUDIT_TRAIL=INPUT,IC_ADJ
*XDIM_MEMBERSET FLOW =F20,F_IC
*XDIM_MEMBERSET MEASURES= YTD
*WHEN ACCOUNT
IS 
*REC(EXPRESSION=%VALUE%)
*ENDWHEN


-------------------------------------------------------------------------------------------------------------------------------------
LOG:


LOG BEGIN TIME:2018-05-11 04:59:10
FILE:\ROOT\WEBFOLDERS\CONSOLIDATION \ADMINAPP\Consolidation\TEST.LGF
USER:SMITHA
APPSET:CONSOLIDATION
APPLICATION:Consolidation
[INFO] GET_DIM_LIST(): I_APPL_ID="Consolidation", #dimensions=13 
ACCOUNT,AUDIT_TRAIL,COST_CENTER,CURRENCY,ENTITY,FLOW,FUNCTIONAL_AREA,INTERCO,MEASURES,PROFIT_CENTER,SCOPE,TIME,VERSION


#dim_memberset=13 
ACCOUNT:340900,IC_VAR_ADJ,2 in total.
TIME:2018.04,1 in total.
CURRENCY:USD,1 in total.
VERSION:Test,1 in total.
SCOPE:S_NONE,1 in total.
ENTITY:CO_1000,1 in total.
COST_CENTER:CC_NONE,1 in total.
PROFIT_CENTER:PC_NONE,1 in total.
FUNCTIONAL_AREA:FA_NONE,1 in total.
INTERCO:I_NONE,1 in total.
AUDIT_TRAIL:IC_ADJ,INPUT,2 in total.
FLOW:F20,F_IC,2 in total.
MEASURES:YTD,1 in total.


REC :%VALUE%


CALCULATION BEGIN:
QUERY PROCESSING DATA
QUERY TIME : 1.00 ms. 2  RECORDS QUERIED OUT.
QUERY REFERENCE DATA
CALCULATION TIME IN TOTAL :0.00 ms.
2  RECORDS ARE GENERATED.
CALCULATION END.


ENDWHEN ACCUMULATION: 2  RECORDS ARE GENERATED.


DATA TO WRITE BACK:
ACCOUNT AUDIT_TRAIL COST_CENTER CURRENCY ENTITY FLOW FUNCTIONAL_AREA INTERCO PROFIT_CENTER SCOPE TIME VERSION SIGNEDDATA
340900 INPUT CC_NONE USD CO_1000 F20 FA_NONE I_NONE PC_NONE S_NONE 2018.04 Test - 16062.27
IC_VAR_ADJ IC_ADJ CC_NONE USD CO_1000 F_IC FA_NONE I_NONE PC_NONE S_NONE 2018.04 Test - 1366.47
2  RECORDS HAVE BEEN WRITTEN BACK.
WRITING TIME :2.00  ms.


SCRIPT RUNNING TIME IN TOTAL:3.00 s.
LOG END TIME:2018-05-11 04:59:11

0

2018.04

UJKT result as per your logic:

LGX:


*XDIM_MEMBERSET ACCOUNT= 340900
*XDIM_MEMBERSET TIME= 2018.04
*XDIM_MEMBERSET CURRENCY= USD
*XDIM_MEMBERSET VERSION= Test
*XDIM_MEMBERSET SCOPE= S_NONE
*XDIM_MEMBERSET ENTITY=CO_1000
*XDIM_MEMBERSET COST_CENTER = CC_NONE
*XDIM_MEMBERSET PROFIT_CENTER=PC_NONE
*XDIM_MEMBERSET FUNCTIONAL_AREA=FA_NONE
*XDIM_MEMBERSET INTERCO=I_NONE
*XDIM_MEMBERSET AUDIT_TRAIL=INPUT,IC_ADJ
*XDIM_MEMBERSET FLOW =F20,F_IC
*XDIM_MEMBERSET MEASURES= YTD
*WHEN ACCOUNT
IS 
*REC(EXPRESSION= %VALUE%>0 ? %VALUE%-[ACCOUNT].[IC_VAR_ADJ]: %VALUE%+[ACCOUNT].[IC_VAR_ADJ], AUDIT_TRAIL=INPUT,FLOW=F20)
*ENDWHEN


-------------------------------------------------------------------------------------------------------------------------------------
LOG:


LOG BEGIN TIME:2018-05-11 05:04:04
FILE:\ROOT\WEBFOLDERS\CONSOLIDATION \ADMINAPP\Consolidation\TEST.LGF
USER:SMITHA
APPSET:CONSOLIDATION
APPLICATION:Consolidation
[INFO] GET_DIM_LIST(): I_APPL_ID="Consolidation", #dimensions=13 
ACCOUNT,AUDIT_TRAIL,COST_CENTER,CURRENCY,ENTITY,FLOW,FUNCTIONAL_AREA,INTERCO,MEASURES,PROFIT_CENTER,SCOPE,TIME,VERSION


#dim_memberset=13 
ACCOUNT:340900,1 in total.
TIME:2018.04,1 in total.
CURRENCY:USD,1 in total.
VERSION:Test,1 in total.
SCOPE:S_NONE,1 in total.
ENTITY:CO_1000,1 in total.
COST_CENTER:CC_NONE,1 in total.
PROFIT_CENTER:PC_NONE,1 in total.
FUNCTIONAL_AREA:FA_NONE,1 in total.
INTERCO:I_NONE,1 in total.
AUDIT_TRAIL:IC_ADJ,INPUT,2 in total.
FLOW:F20,F_IC,2 in total.
MEASURES:YTD,1 in total.


REC :%VALUE%>0 ? %VALUE%-[ACCOUNT].[IC_VAR_ADJ]: %VALUE%+[ACCOUNT].[IC_VAR_ADJ]


CALCULATION BEGIN:
QUERY PROCESSING DATA
QUERY TIME : 1.00 ms. 1  RECORDS QUERIED OUT.
QUERY REFERENCE DATA
QUERY TIME : 1.00 ms. 2  RECORDS QUERIED OUT.
CALCULATION TIME IN TOTAL :0.00 ms.
1  RECORDS ARE GENERATED.
CALCULATION END.


ENDWHEN ACCUMULATION: 1  RECORDS ARE GENERATED.


DATA TO WRITE BACK:
ACCOUNT AUDIT_TRAIL COST_CENTER CURRENCY ENTITY FLOW FUNCTIONAL_AREA INTERCO PROFIT_CENTER SCOPE TIME VERSION SIGNEDDATA
340900 INPUT CC_NONE USD CO_1000 F20 FA_NONE I_NONE PC_NONE S_NONE 2018.04 Test - 16062.27
1  RECORDS HAVE BEEN WRITTEN BACK.
WRITING TIME :1.00  ms.


SCRIPT RUNNING TIME IN TOTAL:3.00 s.
LOG END TIME:2018-05-11 05:04:06


0

2018.02

UJKT result as per your logic
FOR 2018.02 the result is correct

LGX:


*XDIM_MEMBERSET ACCOUNT= 340900
*XDIM_MEMBERSET TIME= 2018.02
*XDIM_MEMBERSET CURRENCY= USD
*XDIM_MEMBERSET VERSION= Test
*XDIM_MEMBERSET SCOPE= S_NONE
*XDIM_MEMBERSET ENTITY=CO_1000
*XDIM_MEMBERSET COST_CENTER = CC_NONE
*XDIM_MEMBERSET PROFIT_CENTER=PC_NONE
*XDIM_MEMBERSET FUNCTIONAL_AREA=FA_NONE
*XDIM_MEMBERSET INTERCO=I_NONE
*XDIM_MEMBERSET AUDIT_TRAIL=INPUT,IC_ADJ
*XDIM_MEMBERSET FLOW =F20,F_IC
*XDIM_MEMBERSET MEASURES= YTD
*WHEN ACCOUNT
*IS * 
*REC(EXPRESSION= %VALUE%>0 ? %VALUE%-[ACCOUNT].[IC_VAR_ADJ]: %VALUE%+[ACCOUNT].[IC_VAR_ADJ], AUDIT_TRAIL=INPUT,FLOW=F20)
*ENDWHEN


-------------------------------------------------------------------------------------------------------------------------------------
LOG:


LOG BEGIN TIME:2018-05-11 05:07:18
FILE:\ROOT\WEBFOLDERS\CONSOLIDATION \ADMINAPP\Consolidation\TEST.LGF
USER:SMITHA
APPSET:CONSOLIDATION
APPLICATION:Consolidation
[INFO] GET_DIM_LIST(): I_APPL_ID="Consolidation", #dimensions=13 
ACCOUNT,AUDIT_TRAIL,COST_CENTER,CURRENCY,ENTITY,FLOW,FUNCTIONAL_AREA,INTERCO,MEASURES,PROFIT_CENTER,SCOPE,TIME,VERSION


#dim_memberset=13 
ACCOUNT:340900,1 in total.
TIME:2018.02,1 in total.
CURRENCY:USD,1 in total.
VERSION:Test,1 in total.
SCOPE:S_NONE,1 in total.
ENTITY:CO_1000,1 in total.
COST_CENTER:CC_NONE,1 in total.
PROFIT_CENTER:PC_NONE,1 in total.
FUNCTIONAL_AREA:FA_NONE,1 in total.
INTERCO:I_NONE,1 in total.
AUDIT_TRAIL:IC_ADJ,INPUT,2 in total.
FLOW:F20,F_IC,2 in total.
MEASURES:YTD,1 in total.


REC :%VALUE%>0 ? %VALUE%-[ACCOUNT].[IC_VAR_ADJ]: %VALUE%+[ACCOUNT].[IC_VAR_ADJ]


CALCULATION BEGIN:
QUERY PROCESSING DATA
QUERY TIME : 1.00 ms. 2  RECORDS QUERIED OUT.
QUERY REFERENCE DATA
QUERY TIME : 1.00 ms. 4  RECORDS QUERIED OUT.
CALCULATION TIME IN TOTAL :0.00 ms.
1  RECORDS ARE GENERATED.
CALCULATION END.


ENDWHEN ACCUMULATION: 1  RECORDS ARE GENERATED.


DATA TO WRITE BACK:
ACCOUNT AUDIT_TRAIL COST_CENTER CURRENCY ENTITY FLOW FUNCTIONAL_AREA INTERCO PROFIT_CENTER SCOPE TIME VERSION SIGNEDDATA
340900 INPUT CC_NONE USD CO_1000 F20 FA_NONE I_NONE PC_NONE S_NONE 2018.02 Test - 2435.31
1  RECORDS HAVE BEEN WRITTEN BACK.
WRITING TIME :1.00  ms.


SCRIPT RUNNING TIME IN TOTAL:3.00 s.
LOG END TIME:2018-05-11 05:07:20
0
Vadim Kalinin May 11 at 12:12 PM
0

Better version of this script! Try to understand why? :)

XDIM_MEMBERSET ACCOUNT= 340900, IC_VAR_ADJ
*XDIM_MEMBERSET AUDIT_TRAIL=INPUT,IC_ADJ
*XDIM_MEMBERSET FLOW =F20,F_IC
*XDIM_MEMBERSET TIME= 2018.04
*XDIM_MEMBERSET CURRENCY= USD
*XDIM_MEMBERSET VERSION= Test
*XDIM_MEMBERSET SCOPE= S_NONE
*XDIM_MEMBERSET ENTITY=CO_1000
*XDIM_MEMBERSET COST_CENTER = CC_NONE
*XDIM_MEMBERSET PROFIT_CENTER=PC_NONE
*XDIM_MEMBERSET FUNCTIONAL_AREA=FA_NONE
*XDIM_MEMBERSET INTERCO=I_NONE
*XDIM_MEMBERSET MEASURES= YTD
*WHEN ACCOUNT
*IS 340900
  *WHEN AUDIT_TRAIL
  *IS INPUT
    *WHEN FLOW
    *IS F20
      *REC(EXPRESSION=%VALUE%)
    *ENDWHEN
  *ENDWHEN
*IS IC_VAR_ADJ
  *WHEN AUDIT_TRAIL
  *IS IC_ADJ
    *WHEN FLOW
    *IS F_IC
      *REC(EXPRESSION=([ACCOUNT].[340900],[AUDIT_TRAIL].[INPUT],[FLOW].[F20])>0 ? -%VALUE% : %VALUE%,ACCOUNT=340900,AUDIT_TRAIL=INPUT,FLOW=F20)
    *ENDWHEN
  *ENDWHEN
*ENDWHEN

Not clear what to do if

([ACCOUNT].[340900],[AUDIT_TRAIL].[INPUT],[FLOW].[F20])=0 or record is missing! + or - ???

Share
10 |10000 characters needed characters left characters exceeded