on 12-04-2017 1:08 PM
Hi All,
System : BPC 10 NW
I have a requirement where I have a set of PROFIT CENTER values.
SOURCE PC values are defined by DC_SPLIT_PERC property which have values Y against them.
For each of the SOURCE PC values, there are a set of TARGET PC's defined by DC_SPLIT_PRNT property which have TARGET PC values.
Source PC : PC_DC16 Target PC : PC_DC02,PC_DC03
Source PC : PC_DC28 Target PC : PC_DC20,PC_DC44,PC_DC47
The Source PC value(PC_DC16 = 100,PC_DC28 = 200) needs to be split into the respective Target PC based on a % driver(yellow color) maintained for each of the Target PC.
However, for each iteration of the SOURCE PC values, it takes the complete set of TARGET DC
E.g: For Source PC_DC16 with value 100, it writes the values into all 5 Target PC and in the 2nd iteration, the PC_DC28 writes into the same 5 targets and they get added up.
I am unable to split the loop in such a way that for the iteration of PC_DC16, it takes only PC_DC02 and PC_DC03
I need to restrict the loop in such a way that the Target PC are selcted only for the respective Source PC.
Code given below and LGX file attached
*SELECT(%SDC%, ID, PROFIT_CENTER, DC_SPLIT_SRC = Y )
*SELECT(%TDC%, ID, PROFIT_CENTER, DC_SPLIT_PRNT = %SDC% )
*FOR %FSDC% = %SDC%
*FOR %FTDC% = %TDC%
*WHEN PROFIT_CENTER
*IS %FSDC%
*WHEN %FSDC%.DC_SPLIT_PRNT
*IS %FTDC%
*XDIM_MEMBERSET PROFIT_CENTER = %FSDC%
*XDIM_MEMBERSET ACCOUNT = AC_9301000
*XDIM_MEMBERSET CONT_CTRY = UTDSTATES
*XDIM_MEMBERSET FUNC_AREA = FA_9150
*XDIM_MEMBERSET TIME = 2015.11
*XDIM_MEMBERSET ENTITY = EN_1000
*XDIM_MEMBERSET AUDITTRAIL = DUAL_CREDIT
*XDIM_MEMBERSET CATEGORY = ACTUAL
*XDIM_MEMBERSET FLOW = M800
*XDIM_MEMBERSET INTERCO = IC_NONE
*XDIM_MEMBERSET RPTCURRENCY = USD
*XDIM_MEMBERSET SCOPE = S_1000
*RUNALLOCATION
*FACTOR = USING/100
*DIM ACCOUNT WHAT = AC_9301000; WHERE = <<<; USING = DC_SPLIT_PERC
*DIM CONT_CTRY WHAT = UTDSTATES; WHERE = <<<; USING = CT_NONE
*DIM FUNC_AREA WHAT = FA_9150; WHERE = <<<; USING = FA_NONE
*DIM PROFIT_CENTER WHAT = %FSDC% ; WHERE = %FTDC% ; USING = <<<
*DIM TIME WHAT = 2015.11 ; WHERE = <<<; USING = 2006.01
*ENDALLOCATION
*ENDWHEN
*ENDWHEN
*NEXT
*NEXT
Solution:
Use single property SPLIT:
For SOURCE members fill it by "Y"
For TARGET members fill it by SOURCE member ID
Code (using allocation by property):
*SELECT(%SRCS%, ID, PROFIT_CENTER, SPLIT = Y) //get SOURCE members
*FOR %SRC%=%SRCS%
*RUNALLOCATION
*FACTOR = USING/100
...
*DIM PROFIT_CENTER WHAT = %SRC%; WHERE=[SPLIT]="%SRC%"; USING = <<<
...
*ENDALLOCATION
*NEXT
Easy!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, but the code is incorrect!
You can't use RUNALLOCATION inside WHEN/ENDWHEN.
Please read at least help about script logic statements.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vadim.
Is there any approach by which I can achive the logic I have mentioned in the post.
Prior to this I have tried using FOR loop. The loop iterates twice with the values getting summed in the end from both iteration.
Code below, UJKT result attached in the end
*SELECT(%LV_SDC%, ID, PROFIT_CENTER, DC_SPLIT_SRC = Y )
*SELECT(%LV_TDC%, ID, PROFIT_CENTER, DC_SPLIT_PRNT = %LV_SDC% )
*XDIM_MEMBERSET AUDITTRAIL = DUAL_CREDIT
*XDIM_MEMBERSET ENTITY = EN_1000
*XDIM_MEMBERSET PROFIT_CENTER = %LV_SDC%
*XDIM_MEMBERSET RPTCURRENCY = USD
*XDIM_MEMBERSET SCOPE = S_1000
*XDIM_MEMBERSET TIME = 2015.11
*WHEN ACCOUNT
*IS <> DC_SPLIT_PERC
*WHEN CONT_CTRY
*IS <> CT_NONE
*WHEN FUNC_AREA
*IS <> FA_NONE
*WHEN TIME
*IS <> 2006.01
*FOR %FSDC% = %LV_SDC%
*WHEN PROFIT_CENTER
*IS %FSDC%
*FOR %FTDC% = %LV_TDC%
*WHEN %FTDC%.DC_SPLIT_PRNT
*IS %FSDC%
*BEGIN
*REC(EXPRESSION = %VALUE%*
(
[ACCOUNT].[DC_SPLIT_PERC],[AUDITTRAIL].[DUAL_CREDIT],[CATEGORY].[ACTUAL],[CONT_CTRY].[CT_NONE],[ENTITY].[EN_1000],[FLOW].[M800],[FUNC_AREA].[FA_NONE],[INTERCO].[IC_NONE],[PROFIT_CENTER].[%FTDC%],[RPTCURRENCY].[USD],[SCOPE].[S_1000],[TIME].[2006.01]
)/100
,PROFIT_CENTER = %FTDC%, FLOW = M800
)
*END
*ENDWHEN
*NEXT
*ENDWHEN
*NEXT
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
scn-lgx-for-loop.txt
Sorry, but your logic explanation was completely unclear!
Please read: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/
Provide Excel screenshot with a data sample before allocation and the desired result.
Sorry but still not clear:
"SOURCE PC values are defined by DC_SPLIT_PERC property which have values Y against them." - PC administration screen required with a column containing the property DC_SPLIT_PERC.
"For each of the SOURCE PC values, there are a set of TARGET PC's defined by DC_SPLIT_PRNT"
administration screen required with a column containing the property DC_SPLIT_PRNT
How do you handle multiple values? Comma separated or???
What is the relationship between SOURCE and TARGET? One-to-many or Many-to-many?
P.S. To my mind the whole concept is wrong...
User | Count |
---|---|
15 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.