Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CONDITIONAL SCRIPT LOGIC

Hello Experts,


I want to perform simple calculation.

eg: if the GL(GW) has positive balance, it should be posted in (A01) and if it has negative balance, it should be posted in (L02L)


But while performing the same logic, I am facing a strange issue when using conditional logic. My script logic is:

*XDIM_MEMBERSET CATEGORY =Actual

*XDIM_MEMBERSET AUDITTRAIL=AJ_COI

*XDIM_MEMBERSET ACCOUNT_C=GW

*XDIM_MEMBERSET TIME= 2012.12

*XDIM_MEMBERSET SCOPE=G_CGG01

*XDIM_MEMBERSET RPTCURRENCY =INR

*XDIM_MEMBERSET FLOW=F_999

*XDIM_MEMBERSET INTERCO=I_NONE

*XDIM_MEMBERSET PROFIT_CENTER=PC_7007

*XDIM_MEMBERSET COST_CENTER=CC_7007

*XDIM_MEMBERSET ENTITY=1000

*XDIM_MEMBERSET SEGMENT=10

[ACCOUNT_C].[#A01]=([ACCOUNT_C].[GW]>0?[ACCOUNT_C].[A01]:0)

[ACCOUNT_C].[#1011]=([ACCOUNT_C].[GW]<0?[ACCOUNT_C].[1011]:0)

*COMMIT.


I have entered the following data:

ACCOUNT_CAUDITTRAILCOSTCENTERENTITYFLOW INTERCOPROFITCENTERCURRENCYSCOPESEGMENT2012.12
GWAJ_COICC_70071000F_999I_NONEPC_7007INRG_CGG0110100

I am getting the following message while running the above script in UJKT.

Error Message:

*XDIM_MEMBERSET CATEGORY =Actual

*XDIM_MEMBERSET AUDITTRAIL=AJ_COI

*XDIM_MEMBERSET ACCOUNT_C=GW

*XDIM_MEMBERSET TIME= 2012.12

*XDIM_MEMBERSET SCOPE=G_CGG01

*XDIM_MEMBERSET RPTCURRENCY =INR

*XDIM_MEMBERSET FLOW=F_999

*XDIM_MEMBERSET INTERCO=I_NONE

*XDIM_MEMBERSET PROFIT_CENTER=PC_7007

*XDIM_MEMBERSET COST_CENTER=CC_7007

*XDIM_MEMBERSET ENTITY=1000

*XDIM_MEMBERSET SEGMENT=10

[ACCOUNT_C].[#A01] =([ACCOUNT_C].[GW]>0?[ACCOUNT_C].[A01]:0)

[ACCOUNT_C].[#1011] =([ACCOUNT_C].[GW]>0?[ACCOUNT_C].[1011]:0)

*COMMIT

-------------------------------------------------------------------------------------------------------------------------------------

LOG:

LOG BEGIN TIME:2015-10-21 00:11:28

FILE:\ROOT\WEBFOLDERS\\ADMINAPP\Consolidation\TEST.LGF

USER:

APPSET:

APPLICATION:Consolidation

FORMULA : [ACCOUNT_C].[A01]=([ACCOUNT_C].[GW]>0?[ACCOUNT_C].[A01]:0)

FORMULA : [ACCOUNT_C].[1011]=([ACCOUNT_C].[GW]>0?[ACCOUNT_C].[1011]:0)

CALCULATION BEGIN:

QUERY PROCESSING DATA

QUERY TIME : 1.00 ms. 1  RECORDS QUERIED OUT.

QUERY REFERENCE DATA

CALCULATION TIME IN TOTAL :0.00 ms.

2  RECORDS ARE GENERATED.

CALCULATION END.

DATA TO WRITE BACK:

ACCOUNT_C AUDITTRAIL CATEGORY COST_CENTER ENTITY FLOW INTERCO PROFIT_CENTER RPTCURRENCY SCOPE SEGMENT TIME SIGNEDDATA

A01 AJ_COI Actual CC_7007 1000 F_999 I_NONE PC_7007 INR G_CGG01 10 2012.12 0.00

1011 AJ_COI Actual CC_7007 1000 F_999 I_NONE PC_7007 INR G_CGG01 10 2012.12 0.00

2  RECORDS HAVE BEEN WRITTEN BACK.

WRITING TIME :0.00  ms.

SCRIPT RUNNING TIME IN TOTAL:1.00 s.

LOG END TIME:2015-10-21 00:11:29

Regards,

Rahul Periwal

Tags:
replied

Hi Rahul,

Instead of MDX use WHEN/ENDWHEN:

*XDIM_MEMBERSET CATEGORY =Actual

*XDIM_MEMBERSET AUDITTRAIL=AJ_COI

*XDIM_MEMBERSET ACCOUNT_C=GW

*XDIM_MEMBERSET TIME= 2012.12

*XDIM_MEMBERSET SCOPE=G_CGG01

*XDIM_MEMBERSET RPTCURRENCY =INR

*XDIM_MEMBERSET FLOW=F_999

*XDIM_MEMBERSET INTERCO=I_NONE

*XDIM_MEMBERSET PROFIT_CENTER=PC_7007

*XDIM_MEMBERSET COST_CENTER=CC_7007

*XDIM_MEMBERSET ENTITY=1000

*XDIM_MEMBERSET SEGMENT=10

*WHEN ACCOUNT

*IS *

*REC(EXPRESSION=(%VALUE%>0) ? %VALUE% : 0, ACCOUNT=A01)

*REC(EXPRESSION=(%VALUE%<0) ? %VALUE% : 0, ACCOUNT=L02L) //or 1011??

*ENDWHEN

Vadim

P.S. GW has to be base account!

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question