cancel
Showing results for 
Search instead for 
Did you mean: 
SAP Community Downtime Scheduled for This Weekend

BPC Allocation Script Logic

0 Kudos
2,757

Hi

I am new to BPC RUNALLOCATION and have been looking at all the forums related to issues with incorrect data. I created a script that works when my what and using have all the same dimensions. What i am trying to accomplish is allocating an amount posted by the users through Input form or DM. The amount will post to the same account that it will require the allocation but the basis will be COGS per material/Total COGS. I have tried about 10 different iterations in UJKT but unable to write any records due to the error below.

Error--Merge WHAT and USING --Time to merge WHAT and USING :0.000073 second(s). Data after merging WHAT and USING :0 records.

System: SAP_BW 750 06 NW

I understand my scope is not all required but this was the latest i used to try to limit as much as possible.

Logic Script:

*XDIM_MEMBERSET ENTITY = F002
*XDIM_MEMBERSET VERSION = ACTUAL
*XDIM_MEMBERSET TIME = %TIME_SET%
*XDIM_MEMBERSET CURRENCY = USD
*XDIM_MEMBERSET ACCOUNT_COPA = STD_COST
*XDIM_MEMBERSET MATERIAL = BAS(ALL_MAT)
*XDIM_MEMBERSET CUSTOMER = BAS(YTC_ALL)
*XDIM_MEMBERSET SHIP_TO = BAS(ALL_SHIPTO)


*RUNALLOCATION


*FACTOR=USING/TOTAL


*DIM ACCOUNT_COPA WHAT= STD_COST; WHERE= BAD_DEBT; USING= BAD_DEBT; TOTAL= STD_COST


//*DIM CURRENCY WHAT = USD; WHERE=<<<; USING=USD; TOTAL= <<<


*DIM MATERIAL WHAT= BAS(ALL_MAT); WHERE=<<<; USING= NO_MAT; TOTAL= BAS(ALL_MAT)


//*DIM VERSION WHAT = ACTUAL; WHERE=ACTUAL; USING=ACTUAL; TOTAL=ACTUAL


*DIM DATASRC_COPA WHAT=SAP_BW; WHERE= DUTY_ALLC; USING= DUTY_LD; TOTAL=SAP_BW


*DIM TIME WHAT= %TIME_SET%; WHERE=%TIME_SET%; USING=<<<; TOTAL=<<<


//*DIM ENTITY WHAT= F002; WHERE=<<<; USING= F002; TOTAL=<<<


*DIM PROFIT_CTR WHAT=BAS(ALL_PC); WHERE=<<<; USING=PC_NONE; TOTAL= BAS(ALL_PC)


*ENDALLOCATION

0 Kudos

Forgot to Add I am using BPC 10.1

former_member186338
Active Contributor

Not nesessary:

SAP_BW 750 06 NW - only BPC 10.1 🙂

0 Kudos
LGX:


*XDIM_MEMBERSET ENTITY = F002
*XDIM_MEMBERSET VERSION = ACTUAL
*XDIM_MEMBERSET TIME = 2017.11
*XDIM_MEMBERSET CURRENCY = USD
*XDIM_MEMBERSET ACCOUNT_COPA = STD_COST
*XDIM_MEMBERSET MATERIAL = BAS(ALL_MAT)
*XDIM_MEMBERSET CUSTOMER = BAS(YTC_ALL)
*XDIM_MEMBERSET SHIP_TO = BAS(ALL_SHIPTO)
*RUNALLOCATION
*FACTOR=USING/TOTAL
*DIM ACCOUNT_COPA WHAT= STD_COST; WHERE= BAD_DEBT; USING= BAD_DEBT; TOTAL= STD_COST
*DIM MATERIAL WHAT= BAS(ALL_MAT); WHERE=<<<; USING= NO_MAT; TOTAL= BAS(ALL_MAT)
*DIM DATASRC_COPA WHAT=SAP_BW; WHERE= DUTY_ALLC; USING= DUTY_LD; TOTAL=SAP_BW
*DIM TIME WHAT= 2017.11; WHERE=2017.11; USING=<<<; TOTAL=<<<
*DIM PROFIT_CTR WHAT=BAS(ALL_PC); WHERE=<<<; USING=PC_NONE; TOTAL= BAS(ALL_PC)
*ENDALLOCATION


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


LOG BEGIN TIME:2018-09-07 11:19:48
FILE:\ROOT\WEBFOLDERS\YCNA_BPC_V \ADMINAPP\COPA_PRFT\TEST.LGF
USER:OMARM
APPSET:YCNA_BPC_V
APPLICATION:COPA_PRFT
FACTOR:USING/TOTAL
ALLOCATION DATA REGION:
ENTITY:F002,
VERSION:ACTUAL,
TIME:2017.11,
CURRENCY:USD,
ACCOUNT_COPA:STD_COST,
MATERIAL:110000000,110277804,120021605,130216750,150051701,150051702,150051797,NO_MAT,ZDIN,
CUSTOMER:10000001,10000001_01,10000001_02,10000001_03,10000040,10000040_01,10000040_02,10000040_03,NO_CUST,
SHIP_TO:20000000,20000001,20000001_01,20000001_02,20000164,NO_SHIPTO,
ACCOUNT_COPA:WHAT:STD_COST,WHERE:BAD_DEBT,USING:BAD_DEBT,TOTAL:STD_COST
MATERIAL:WHAT:110000000,110277804,120021605,130216750,150051701,150051702,150051797,NO_MAT,ZDIN,WHERE:<<<,USING:NO_MAT,TOTAL:110000000,110277804,120021605,130216750,150051701,150051702,150051797,NO_MAT,ZDIN
DATASRC_COPA:WHAT:SAP_BW,WHERE:DUTY_ALLC,USING:DUTY_LD,TOTAL:SAP_BW
TIME:WHAT:2017.11,WHERE:2017.11,USING:<<<,TOTAL:<<<
PROFIT_CTR:WHAT:P1000,P100000,P1001,P1010,P1020,P1030,P1040,P1041,P1050,P1060,P1070,P1071,P2000,P2010,P2020,P301000,P301001,P301002,P301003,P301004,P301005,P302000,P302001,P302002,P303000,P303001,P303002,P304000,P304001,P304002,P305000,P305001,P305002,P400000,P500000,P600000,P700000,P999999,PC_NONE,PDUMMY,WHERE:<<<,USING:PC_NONE,TOTAL:P1000,P100000,P1001,P1010,P1020,P1030,P1040,P1041,P1050,P1060,P1070,P1071,P2000,P2010,P2020,P301000,P301001,P301002,P301003,P301004,P301005,P302000,P302001,P302002,P303000,P303001,P303002,P304000,P304001,P304002,P305000,P305001,P305002,P400000,P500000,P600000,P700000,P999999,PC_NONE,PDUMMY
-----------------------------------------
--Read WHAT region
[ACCOUNT_COPA] =STD_COST
[MATERIAL] =110000000,110277804,120021605,130216750,150051701,150051702,150051797,NO_MAT,ZDIN
--Time to load WHAT :0.286694 second(s).
WHAT data:3  records.
-----------------------------------------
--Read USING region
[ACCOUNT_COPA] =BAD_DEBT
[MATERIAL] =NO_MAT
[DATASRC_COPA] =DUTY_LD
[PROFIT_CTR] =PC_NONE
[ENTITY] =F002
[VERSION] =ACTUAL
[CURRENCY] =USD
[CUSTOMER] =10000001,10000001_01,10000001_02
--Time to load USING :0.253196 second(s).
USING data:1  records.
-----------------------------------------
--Merge WHAT and USING
--Time to merge WHAT and USING :0.000073 second(s).
Data after merging WHAT and USING :0  records.
-----------------------------------------
--Apply factor
[ACCOUNT_COPA] =STD_COST
[MATERIAL] =110000000,110277804,120021605,130216750,150051701,150051702,150051797,NO_MAT,ZDIN
TOTAL data:3  records.
WHERE=WHAT *USING/TOTAL
--Time to apply factor :0.285682 second(s).
-----------------------------------------
--Read destination and calculate difference
[ACCOUNT_COPA] =BAD_DEBT
[MATERIAL] =110000000,110277804,120021605,130216750,150051701,150051702,150051797,NO_MAT,ZDIN
--Time to read destination and calculate difference :0.295649 second(s).
-----------------------------------------
--Records succeeded to write back :0
-----------------------------------------
--Time to run Allocation :1.131737 second(s).


SCRIPT RUNNING TIME IN TOTAL:1.00 s.
LOG END TIME:2018-09-07 11:19:49


Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

Please read help: https://help.sap.com/viewer/a2049170bfeb4178ace32222842c3ec1/10.1/en-US/56b10a71d21b4f0eb69a4a79a050...

"Restriction of USING

  • ...

  • USING and TOTAL must have the same definition."

Unfortunately the data sample is not clear!

You have to clearly show what do you have for source data and what to use as FACTOR

Please read and test yourself help samples (there are some errors in the samples, by the way)

0 Kudos

In one of the previous iterations I had using and total the same but it didnt work. I will try again to see the results. ALso, I added the UJKT log for the above logic script.

former_member186338
Active Contributor
0 Kudos

I recommend you to start with simple samples! Then you will understand how it works!

0 Kudos

Hi Vadim

I have tried the simple using/total and it writes a record while only stating one DIM. Once I add another DIM, even without any scope it fails to write it. I am simply trying to allocate a value entered in 100 down to the part level in an account that doesn't have any part line items. The reference for part and percentage is the STD_COST line item detail. My picture shows the user entering in the 100 and for MAT 1 200/2400 = 8%, than the 8% of the 100 is posting as bad_debt/mat1/$8.

The allocation is finding the values required for calculation but than when it writes, -Records succeeded to write back :0


*RUNALLOCATION


*FACTOR=USING/TOTAL


*DIM ACCOUNT_COPA WHAT= BAD_DEBT; WHERE= BAD_DEBT; USING= STD_COST; TOTAL= <<<


*DIM TIME WHAT= 2017.11; WHERE=2017.12; USING=2017.11; TOTAL=<<<


*DIM CURRENCY WHAT = USD; WHERE=USD; USING=USD; TOTAL= <<<


*DIM MATERIAL WHAT= NO_MAT; WHERE=120021605; USING= >>>; TOTAL= BAS(ALL_MAT)


*DIM VERSION WHAT = ACTUAL; WHERE=ACTUAL; USING=ACTUAL; TOTAL=ACTUAL


*DIM DATASRC_COPA WHAT=DUTY_LD; WHERE= DUTY_ALLC; USING= SAP_BW; TOTAL=<<<


*DIM ENTITY WHAT= F002; WHERE=<<<; USING= F002; TOTAL=<<<


*DIM PROFIT_CTR WHAT=PC_NONE; WHERE=P301000; USING=>>>; TOTAL= BAS(ALL_PC)


*ENDALLOCATION

former_member186338
Active Contributor
0 Kudos

Sorry, but you have to explain the required calculation logic very clear! Use reports screenshots with all dimensions visible.

For samples - search forum for "Vadim RUNALLOCATION"