Quantcast
Channel: SCN : Discussion List - SAP Planning and Consolidation, version for SAP NetWeaver
Viewing all articles
Browse latest Browse all 5414

Script Logic for Multiplying Rate x quantiy per dimension

$
0
0

Script Logic for Multiplying Rate x quantiy per dimension

Hi Experts,
We are preparing allocation script logic that multiplies the quanity per a dimension (country) times a particular rate, in order to allocate shipping costs based on the combination of entity and country or entity and country property. 
We are receiving a result that is not what we want.  Please see the example and script below: 
For your troubles, you're welcome to a useful script below….

We are performing in 2 iterations:
1 Entity and Country combination X a fixed rate for Entity and Country combination e.g. Entiy 1000 & Country = France x rate for Entity and Country = France.
2 Where no match occurs in 1, we use the a property e.g. GeoRegion Entity 1000 & Country Hungary with property GeoRegion = E.Europe x rate for Entity 1000 and country Austria where GeoRegion property = E. Europe.

Example iteration 1
Entity =1000 Country = France  500 Units
PRICING
Entity 1000; Country France 3 USD

Result: 500x3=1500USD
Match by entity & country combination.

Example iteration 2
Countries:
Entity 1000 & Hungary 100 units
Entity 1000 & Poland 60 units
Entity 1000 & Czech Republic 40 units
All have property GeoRegion E.Europe

Pricing
Entity 1000 & Austria 2 USD
GeoRegion =E.Europe 2 USD

Expected result is
Hungary 100x 2 USD = 200 USD
Poland 60 x 2USD = 120 USD
Czech Republic 40 x 2 USD = 80 USD

Instead we end up with Austria 200 units x 2 USD = 400USD
How can we get the result to post to the expected result?

Script used is below. 
When we used the script:
//*DIM COUNTRY WHAT=[CO_ALLOCATION]="Y"; WHERE=>>>; USING=%CB%; 
This posted back to the country member where the pricing was located.

//*DIM COUNTRY WHAT=[CO_ALLOCATION]="Y"; WHERE=[CO_ALLOCATION]="Y"; USING=%CB%;
Logically this seems to be correct – that we use the source listing of countries selected by property (CO_ALLOCATION=Y) in the WHERE section to post back.
However, we receive the error below:

RUN_LOGIC:Region WHERE [CO_ALLOCATION]="Y" or USING CO_1,CO_10,CO_1000,CO_1006,CO_1011,CO_1012,CO_1013 has many members, but they are not equal

model: Consolidation. Package status: ERROR

FULL SCRIPT
//
*XDIM_MEMBERSET SCOPE=S_NONE
*XDIM_MEMBERSET COST_CENTER=CC_NONE
//*XDIM_MEMBERSET ACCOUNT=BAS(411110),BAS(411210)
*XDIM_MEMBERSET  ENTITY=%ENTITY_SET%
*XDIM_MEMBERSET TIME=%TIME_SET%
*XDIM_MEMBERSET CURRENCY=USD
*XDIM_MEMBERSET CATEGORY=ACTUAL
*SELECT(%CB%,"[ID]",COUNTRY,"[H2_RGN_DESC_PAR]='North America','Europe','?PAC'")
*SELECT(%CC%,"[ID]",COUNTRY,"[CO_ALLOCATION]='Y'")

*RUNALLOCATION
*FACTOR=USING*1

*DIM CURRENCY WHAT=USD ; WHERE=<<<; USING=<<<;
*DIM ACTIVITY WHAT=AC_10; WHERE=AC_10; USING=AC_NONE;
//*DIM COUNTRY WHAT=[H2_RGN_DESC_PAR]="EUROPE" ; WHERE=[H2_RGN_DESC_PAR]="EUROPE"; USING=CO_1006;
//*DIM COUNTRY WHAT=[CO_ALLOCATION]="Y"; WHERE=>>>; USING=%CB%;  this worked but stores the value in the pricing country rather than the
// the source sales quantity country.

//*DIM COUNTRY WHAT=[CO_ALLOCATION]="Y"; WHERE=[CO_ALLOCATION]="Y"; USING=%CB%; this creates an error

*DIM COUNTRY WHAT=[CO_ALLOCATION]="Y"; WHERE=>>>; USING=%CB%;
//*DIM COUNTRY WHAT=[CO_ALLOCATION]="Y"; WHERE=<<<; USING=<<<;
*DIM ACCOUNT WHAT=[A_ALLOCATION]="R"; WHERE=612313; USING=PT_100020;
*DIM ACTIVE_INGREDIEN WHAT=[AI_ALLOCATION]="X"; WHERE=<<<; USING=AI_NONE;
*DIM AUDITID WHAT=INPUT; WHERE=AD5148; USING=INPUT;

*ENDALLOCATION
*COMMIT


Any ideas?
Thanks in advance.
Eyal Feiler


Viewing all articles
Browse latest Browse all 5414

Trending Articles