Skip to Content

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

Script not aggregating as expected

I have 3 sections of script that work perfect when you run them individually, they also run perfectly when you run only the first two sections together but when the last one is added I get a totally unexpected result.   They all write to the exact same intersection so I would expect them to aggregate correctly.

Any thoughts on why this last section is causing an issue.

Thank you

///////////////////

//// Eliminate COMM REV MNL

/////////////////

*SELECT(%TOTPC31%, "[ID]", PROFITCENTER, "[CALC]='N'")

*XDIM_MEMBERSET PROFITCENTER=%TOTPC31%

*XDIM_MEMBERSET COMPANYCODE = 7500

*XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET FLOW = Balance

*XDIM_MEMBERSET TRADINGPARTNER = BAS(TTLINTERCONON)

*XDIM_MEMBERSET AUDITTRAIL = BAS(AuditTotal)

*XDIM_MEMBERSET RPTCURRENCY = USD

*XDIM_MEMBERSET ACCOUNT = 471000

*WHEN CATEGORY

*IS ACTUAL

*REC(FACTOR=-1, ACCOUNT="592000",COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*REC(FACTOR=1, ACCOUNT="662100",COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*endwhen

*COMMIT

//

//

//

///////////////////

//// Eliminate DIST REV

/////////////////

*SELECT(%TOTPC32%, "[ID]", PROFITCENTER, "[CALC]='N'")

*XDIM_MEMBERSET PROFITCENTER=%TOTPC32%

*XDIM_MEMBERSET COMPANYCODE = 7100

*XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET FLOW = Balance

*XDIM_MEMBERSET TRADINGPARTNER = BAS(TTLINTERCONON)

*XDIM_MEMBERSET AUDITTRAIL = BAS(AuditTotal)

*XDIM_MEMBERSET RPTCURRENCY = USD

*XDIM_MEMBERSET ACCOUNT = 592019,592020,592021

*WHEN CATEGORY

*IS ACTUAL

*REC(FACTOR=-1, ACCOUNT="592000", COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*REC(FACTOR=1, ACCOUNT="662100", COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*endwhen

*COMMIT

/////////////////

// Eliminate Admin Allow FIA between SRS and MNL

///////////////

*SELECT(%TOTPC65%, "[ID]", PROFITCENTER, "[CALC]='N'")

*XDIM_MEMBERSET PROFITCENTER=%TOTPC65%

*XDIM_MEMBERSET COMPANYCODE = 7200

*XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET FLOW = Balance

*XDIM_MEMBERSET TRADINGPARTNER = BAS(TTLINTERCONON)

*XDIM_MEMBERSET AUDITTRAIL = BAS(AuditTotal)

*XDIM_MEMBERSET RPTCURRENCY = USD

*XDIM_MEMBERSET ACCOUNT = 592023

*WHEN CATEGORY

*IS ACTUAL

*REC(FACTOR=-1, ACCOUNT="592000", COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*REC(FACTOR=1, ACCOUNT="662100", COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*endwhen

*COMMIT

Former Member
replied

P.S. If you have multiple independent WHEN/ENDWHEN loops like:

*WHEN xxx

...

*ENDWHEN

*WHEN xxx

...

*ENDWHEN

*WHEN xxx

...

*ENDWHEN

Then each next loop will overwrite previous if same target is used. Tj aggregate you need to have single loop - try something like:

...

*XDIM_MEMBERSET CATEGORY = ACTUAL

*XDIM_MEMBERSET COMPANYCODE = 7500,7100,7200

*XDIM_MEMBERSET ACCOUNT = 471000,592019,592020,592021,592023

*WHEN COMPANYCODE

*IS 7500

*WHEN ACCOUNT

*IS 471000

*REC(FACTOR=-1, ACCOUNT="592000",COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*REC(FACTOR=1, ACCOUNT="662100",COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*ENDWHEN

*IS 7100

*WHEN ACCOUNT

*IS 592019,592020,592021

*REC(FACTOR=-1, ACCOUNT="592000",COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*REC(FACTOR=1, ACCOUNT="662100",COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*ENDWHEN

*IS 7200

*WHEN ACCOUNT

*IS 592023

*REC(FACTOR=-1, ACCOUNT="592000",COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*REC(FACTOR=1, ACCOUNT="662100",COMPANYCODE="CC_SFGELIM",AUDITTRAIL="EquityAdj")

*ENDWHEN

*ENDWHEN

Vadim

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