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

Runallocation script NW

$
0
0

Dear experts,


I have this allocation that I am trying to do in script logic but I am not sure how.

We have two models: COST and MARGIN.

In COST, users plan their costs by cost centers. Then, in MARGIN, these costs must be reallocated by PRODUCT/CUSTOMER.


Dimensions are:


COSTMARGIN
CATEGORYCATEGORY
RPTCURRENCYRPTCURRENCY
COSTELEMENTCOSTELEMENT
ORGANISATION (CC/PC)ORGANISATION
AUDITTRAILAUDITRAIL
TIMETIME
DIVISION
SITE_EXPEDITION
CUSTOMER
PRODUCT
REPART_COPA


 

I first push the data from COST to MARGIN on a particular AuditTrail (IMPORT_COST), no problem with that.


Now I need to reallocate these costs in model MARGIN.

In MARGIN we have added a dimension REPART_COPA to handle the different way each CC will reallocate to CUSTOMER/PRODUCT.


The dimension look like this:


 

IDEVDESCRIPTIONCCCOMP_CODEDISTRI_CHANNELCUSTOMERVALUEFIELDCPPRODUCT
R_BA11E001BA11E001BA11E0012521[COMPCODE]="2551"VV4301BBAS(TOTAL_PRODUCT)
R_BA13E001BA13E001BA13E0012521[COMPCODE]="2551"VV4301BBAS(TOTAL_PRODUCT)
R_BA15E001BA15E001BA15E001255130[COMPCODE]="2521" AND [CHANNEL]="30"VV4301BBAS(TOTAL_PRODUCT)
REPART_COPA_NARépartition NA


 

Extract of the CUSTOMER dimension:


IDCHANNELCOMPCODE
01302521-0010020353302521
01302521-0010020357302521
01352521-0010020363352521
01302551-0010022342302551
01302551-0010000404302551
01302551-0010022291302551
01302551-0010024230302551


 

The script I’m trying:

*SELECT(%CC_TO_REPART%,"CC","REPART_COPA","[ID]<>'REPART_COPA_NA')  // get the CC to reallocate > OK

*SELECT(%CLT%,[CLIENT],REPART_COPA,"CC = %CC_TO_REPART%") // get value of property CLIENT of the CC to reallocate

> KO

 

*XDIM_MEMBERSET CATEGORIE=BUDGETV0

*XDIM_MEMBERSET DEVISE_RPT=LC

*XDIM_MEMBERSET DIVISION=DIVISION_NA

*XDIM_MEMBERSET HCLIENT=CLIENT_NA

*XDIM_MEMBERSET HPRODUIT=PRODUIT_NA

*XDIM_MEMBERSET NATURE=BAS(PANXTNAT)

*XDIM_MEMBERSET ORGANISATION=%CC_TO_REPART%

*XDIM_MEMBERSET REPART_COPA=REPART_COPA_NA

*XDIM_MEMBERSET SITE_EXPEDITION=SITE_EXPEDITION_NA

*XDIM_MEMBERSET SOURCE_DONNEES=IMPORT_COUTS

*XDIM_MEMBERSET TEMPS=2016.01

 

*FOR %CC%=%CC_TO_REPART%

*RUNALLOCATION

*FACTOR=USING/TOTAL

*DIM_NONAGGR NATURE       WHAT=BAS(SFNA);              WHERE=VV430;           USING=VV010;                                      TOTAL=<<<

*DIM ORGANISATION            WHAT=%CC%;                    WHERE=1B;                USING=<<<;                                        TOTAL=<<<

*DIM DIVISION                     WHAT=DIVISION_NA;           WHERE=>>>;             USING=BAS(TOTAL_DIVISION);                TOTAL=<<<

*DIM HCLIENT                      WHAT=CLIENT_NA;              WHERE=>>>;             USING=%CLT%;                                   TOTAL=<<<

*DIM HPRODUIT                   WHAT=PRODUIT_NA;            WHERE=>>>;             USING=BAS(TOTAL_PRODUCT);               TOTAL=<<<

*DIM SITE_EXPEDITION        WHAT=SITE_EXPEDITION_NA;   WHERE=>>>;         USING=BAS(TOTAL_SITE_EXPEDITION);    TOTAL=<<<

*DIM SOURCE_DONNEES       WHAT=IMPORT_COUTS;         WHERE=COPA;            USING=CALCUL;                                    TOTAL=<<<

*ENDALLOCATION

*NEXT

 

This works fine if I have only one line in the dimension REPART_COPA…. When multiple line, the 2nd select will not work: error saying “UJP_RULE_EXCEPTION:'AND' missing in expression "[SOCIETE]="2521",[SOCIETE]="2521",[SOCIETE]="2551


Ideally I would need to put this 2nd select inside the FOR/NEXT but that does not work like that.

 

Any idea on how I could do this calculation in script logic? I wanted to avoid writing a BADI …

 

Thanks in advance for your help,

Camille


Viewing all articles
Browse latest Browse all 5414

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>