cancel
Showing results for 
Search instead for 
Did you mean: 

Limiting Default Script to Specific Entity

former_member234894
Participant
0 Kudos

Limiting Default Script to Specific Entity
Hi Experts
I created a manual task (copy of Default) that executes the default script.  I would like to limit to a specific ENTITY.  However, it runs for all entities.
Below is the DM script I used and part of the default script (it runs 2 separate ABC to calculate Net Income and the variation F15 flow).
The script does not limit to entity – even when I hard code the entity value and run in UJKT.
Any way to limit?


1) Added ENTITY_DIM
DM Script:
PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%,%ENTITY_DIM%,%TIME_DIM%")
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SELECTION,%SELECTION%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,DEFAULT_AUTOMATIC.LGF )


// DEFAULT_AUTOMATIC.LGF  23/3/15 SETUP TO RUN BY DM TASK

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
ENTITY =  %ENTITY_SET%
CURRENCY = %CURRENCY_SET%
TID_RA = %TIME_SET%
SCOPE = S_NONE  

CALC=NETINCOMESPLIT2
*ENDRUN_PROGRAM

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
ENTITY =  %ENTITY_SET%
CURRENCY = %CURRENCY_SET%
TID_RA = %TIME_SET%
SCOPE = S_NONE  

CALC = TBS
*ENDRUN_PROGRAM

Accepted Solutions (1)

Accepted Solutions (1)

former_member544285
Participant
0 Kudos

Hi Eyal,

Change your logic to:

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%

TID_RA = %TIME_SET%
GROUPS = S_NONE 

CALC=NETINCOMESPLIT2

OTHER=[ENTITY =  %ENTITY_SET%;CURRENCY = %CURRENCY_SET%]
*ENDRUN_PROGRAM

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
TID_RA = %TIME_SET%
GROUPS = S_NONE 

CALC = TBS

OTHER=[ENTITY =  %ENTITY_SET%;CURRENCY = %CURRENCY_SET%]
*ENDRUN_PROGRAM

Let me know how it goes

BR,

Hendry

former_member234894
Participant
0 Kudos


Hi All,
Thanks for your helpful responses.

1) Hendri/Vadim - I ran the script as below via 2 tests below. It runs the script and filters on the category currency and time as expected but not entity.  To verify I loaded

data in different currencies, periods and another category and confirmed the script did not update that data. 

2) The name of the entity dimension is ENTITY as per the script logic.

3) If I use this script in UJKT and hard code the entity value e.g. ENTITY = 3521, it still runs for the 3 entities regardless of whether I limit the entity.

This leads me to believe that the default script code does not allow for limiting to ENTITY.  See script below for UJKT (TEST 3)


4)  There's no BADI involved here, straight ABC and script logic


Ideas? 
Thanks again.
Eyal


TEST 1
// DEFAULT_AUTOMATIC.LGF  23/3/15 SETUP TO RUN BY DM TASK
*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
TID_RA = %TIME_SET%
SCOPE = S_NONE
OTHER [CURRENCY = %CURRENCY_SET%;ENTITY=%ENTITY_SET%]

CALC = NETINCOMESPLIT2
*ENDRUN_PROGRAM

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
OTHER [ENTITY=%ENTITY_SET%;CURRENCY=%CURRENCY_SET%]
TID_RA = %TIME_SET%
SCOPE = S_NONE

CALC = TBS
*ENDRUN_PROGRAM

TEST 2

// DEFAULT_AUTOMATIC.LGF  23/3/15 SETUP TO RUN BY DM TASK
*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
//ENTITY = %ENTITY_SET%
CURRENCY = %CURRENCY_SET%
TID_RA = %TIME_SET%
SCOPE = S_NONE
OTHER [ENTITY=%ENTITY_SET%]

CALC = NETINCOMESPLIT2
*ENDRUN_PROGRAM

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
//ENTITY = %ENTITY_SET%
CURRENCY = %CURRENCY_SET%
TID_RA = %TIME_SET%
SCOPE = S_NONE
OTHER [ENTITY=%ENTITY_SET%]

CALC = TBS
*ENDRUN_PROGRAM

TEST 3

As run in UJKT:

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
CATEGORY = ACTUAL
ENTITY = 3521
CURRENCY = USD
TID_RA = 2015.12
SCOPE = S_NONE

CALC = NETINCOMESPLIT2
*ENDRUN_PROGRAM

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = ACTUAL
ENTITY = 3521
CURRENCY = USD
TID_RA = 2015.12
SCOPE = S_NONE

CALC = TBS
*ENDRUN_PROGRAM

former_member186338
Active Contributor
0 Kudos

Hi Eyal,

Syntax error!!!

Not:

OTHER [ENTITY=%ENTITY_SET%]

But

OTHER = [ENTITY =  %ENTITY_SET%]

Vadim

former_member182766
Contributor
0 Kudos

You forgetting "=" in other.

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = %CATEGORY_SET%
TID_RA = %TIME_SET%
SCOPE = S_NONE
OTHER = [ENTITY=%ENTITY_SET%;CURRENCY = %CURRENCY_SET%]

CALC = NETINCOMESPLIT2
*ENDRUN_PROGRAM

former_member234894
Participant
0 Kudos

Thank you both

It works !!!

Ahh the joys of logic script.

former_member186338
Active Contributor
0 Kudos

Hi Vadim,

Just to correct:

OTHER = [ENTITY=%ENTITY_SET%;CURRENCY = %CURRENCY_SET%]

CURRENCY has to be defined before, as:

CURRENCY = %CURRENCY_SET%

Look on the help: Account-based Calculations as Script Logic - SAP Business Planning and Consolidation, version for SA...

Vadim

former_member182766
Contributor
0 Kudos

You are right, we usually include Groups under other, but currency outside.

Answers (2)

Answers (2)

former_member186338
Active Contributor
0 Kudos

Hi Eyal,

Please provide the REAL name of the ENTITY type dim!

Then use the real name in

OTHER=[ENTITY =  %ENTITY_SET%]


CURRENCY = %CURRENCY_SET% - correct!


Anyway, look on the syntax here:Account-based Calculations as Script Logic - SAP Business Planning and Consolidation, version for SA...

Vadim

Former Member
0 Kudos

Hi Eyal,

Can you please elaborate in detail.

1. What is the use of DM Script, though you r passing hard coded values.

2. if you used DM package, you need to run through RUN package and passed the values from there

3. If you wanna go with the DM package and want to check your values, please implement UJ_CUSTOM_LOGIC BADI

and write the below code in logic script.

*START_BADI XYZ (your BADI Filter name)

QUERY = ON

WRITE = ON

VERSION = %VERSION_SET%

ENTITY = %COMPANY_CODE_SET%

TIME = %YEAR%

*END_BADI

Regards

Rohit

Former Member
0 Kudos

HI Eyal,

P.S when you Dedug your BADI, you can be able to see your passed values in IT_PARAM parameter of BADI

Regards

Rohit

former_member182766
Contributor
0 Kudos

Why would you use BADI for something as simple as restricting Script's scope with selected Entity from DM Package?