cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BPC 10 NW - Script Logic sum records

former_member226891
Participant
0 Kudos
214

Hi,

Looking for script logic to sum records then divide and store in separate Account.

Formula : (A+B) / (C+D) = E

(12846+957)/(8.05+0.6)=1595.72

INV_ACCOUNTINCOTERMSSIGNEDDATASP_CCCIF12,846SP_CCCFR957SALESCIF8.05SALESCFR0.6

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member186338
Active Contributor
0 Kudos

Sorry, but the info is still missing! No info about dimensions and hierarchy...

Look on:

([INV_ACCOUNT].[SP_QTY_STOCK],[AUDITTRAIL].[%C1%])

aggregation for INCOTERMS is missing

Has to be:

([INV_ACCOUNT].[SP_QTY_STOCK],[AUDITTRAIL].[%C1%],[INCOTERMS].[SOME_PARENT])

Where SOME_PARENT is a parent for CFR, CIF...

Not 100% sure due to missing info

former_member226891
Participant
0 Kudos

Hello Vadim,

The script logic is called by separate DM package whose input is the Version selection.

Also PFB the report with incorrect figure marked in red color.

former_member226891
Participant
0 Kudos

Hi Vadim,

SAP_BW 740 0013 SAPKW74013

CPMBPC 801 0010 SAPK-80110INCPMBPC CPM Business Planning and Consolidation

The current logic script is giving incorrect results where the issue has been identified due to multiple records of INCOTERMS. The formula should be as follows:

sum(SP_CC_MFG_REVAL) / sum(SP_QTY_STOCK) = MFG_REVAL_RATE

Incorrect Result : PFA Screenshot where the value in MFG_REVAL_RATE should be 13803.9521079/8.6529960 =

1595.280075005235, but it doubles as below script works like this formula A/B+C/D=E due to multiple records with difference in INCOTERMS

*SELECT (%START_MONTH%, START_MONTH, VERSION, ID = %VERSION_SET%)
*SELECT (%END_MONTH%, END_MONTH, VERSION, ID = %VERSION_SET%)
*SELECT (%TIME%, ID, TIME, ID >= %START_MONTH% AND ID <= %END_MONTH% AND CALC = N)


*XDIM_MEMBERSET TIME = %TIME%
*XDIM_MEMBERSET VERSION = %VERSION_SET%
*XDIM_MEMBERSET INV_ACCOUNT = SP_CC_MFG_REVAL
*XDIM_MEMBERSET RPTCURRENCY = GC
*XDIM_MEMBERSET AUDITTRAIL = BAS(INV_VALUATION)
*XDIM_MEMBERSET INV_FLOW = SALES_COGS
*XDIM_MEMBERSET AUDITTRAIL AS %AUDIT% = BAS(INV_COGS_AGING)


*FOR %C1% = %AUDIT%
*WHEN INV_ACCOUNT
*IS SP_CC_MFG_REVAL
*REC(EXPRESSION = %VALUE%/([INV_ACCOUNT].[SP_QTY_STOCK],[AUDITTRAIL].[%C1%]), INV_ACCOUNT = MFG_REVAL_RATE, AUDITTRAIL = %C1%, INCOTERMS = NO_INCOTERMS, SALES_CHANNEL = NO_SALES_CHANNEL)


*ENDWHEN
*NEXT

former_member186338
Active Contributor
0 Kudos

Sorry, but looks like you don't want to read my blog - as a result I am unable to answer your question!

"4. Clearly identify the purpose of the script: to run as default.lgf or to be launched by DM package (different calculation logic!). Please, ALWAYS answer this question!!!!"

And data sample is missing! RSA1 is not the right way to show figures. Use report.

former_member186338
Active Contributor
0 Kudos
former_member226891
Participant
0 Kudos

Hi Vadim,

SAP_BW 740 0013 SAPKW74013

CPMBPC 801 0010 SAPK-80110INCPMBPC CPM Business Planning and Consolidation

The current logic script is giving incorrect results where the issue has been identified due to multiple records of INCOTERMS. The formula should be as follows:

sum(SP_CC_MFG_REVAL) / sum(SP_QTY_STOCK) = MFG_REVAL_RATE

Incorrect Result : PFA Screenshot where the value in MFG_REVAL_RATE should be 13803.9521079/8.6529960 =

1595.280075005235, but it doubles as below script works like this formula A/B+C/D=E due to multiple records with difference in INCOTERMS

*SELECT (%START_MONTH%, START_MONTH, VERSION, ID = %VERSION_SET%)
*SELECT (%END_MONTH%, END_MONTH, VERSION, ID = %VERSION_SET%)
*SELECT (%TIME%, ID, TIME, ID >= %START_MONTH% AND ID <= %END_MONTH% AND CALC = N)


*XDIM_MEMBERSET TIME = %TIME%
*XDIM_MEMBERSET VERSION = %VERSION_SET%
*XDIM_MEMBERSET INV_ACCOUNT = SP_CC_MFG_REVAL
*XDIM_MEMBERSET RPTCURRENCY = GC
*XDIM_MEMBERSET AUDITTRAIL = BAS(INV_VALUATION)
*XDIM_MEMBERSET INV_FLOW = SALES_COGS
*XDIM_MEMBERSET AUDITTRAIL AS %AUDIT% = BAS(INV_COGS_AGING)


*FOR %C1% = %AUDIT%
*WHEN INV_ACCOUNT
*IS SP_CC_MFG_REVAL
*REC(EXPRESSION = %VALUE%/([INV_ACCOUNT].[SP_QTY_STOCK],[AUDITTRAIL].[%C1%]), INV_ACCOUNT = MFG_REVAL_RATE, AUDITTRAIL = %C1%, INCOTERMS = NO_INCOTERMS, SALES_CHANNEL = NO_SALES_CHANNEL)


*ENDWHEN
*NEXT

former_member226891
Participant
0 Kudos

Hello Vadim,

The script logic is called by separate DM package whose input is the Version selection.

Also PFB the report with incorrect figure marked in red color.