cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict *run_program calc_account by TIME

Former Member
0 Kudos

Hi all,

I have an account based calculation rule which needs to be run for FEB to DEC but not in JAN. Can I add a *WHEN TIME.MONTHNUM around the *run_program call in my script? For dimensions like ENTIITY I would usually use the [OTHER ...] section but I don't think I can do this for the TIME dimension.

Thanks,
Arnold

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member186338
Active Contributor
0 Kudos

If you don't want to get warning you can use the following script based on: https://launchpad.support.sap.com/#/notes/2146749/E

*SELECT(%PER%,[ID],TIME,ID=%TIME_SET% AND PERIOD<>JAN)
*XDIM_SKIPNULLCHECK CURRENT
*XDIM_MEMBERSET TIME=%PER%
*RUN_PROGRAM CALC_ACCOUNT
CATGEORY = %CATEGORY_SET%
CURRENCY = EUR
TID_RA = %PER%
OTHER = [ENTITY = %ENTITY_SET%]
CALC = LEVLE08
*ENDRUN_PROGRAM
*COMMIT

Former Member
0 Kudos

Hi Vadim,

I have added a select like your suggestion to my script and then replaced TID_RA=%TIME_SET% with TID_RA=%PER%:

*SELECT(%PER%,[ID],TIME,ID=%TIME_SET% AND PERIOD<>JAN)

*RUN_PROGRAM CALC_ACCOUNT
CATGEORY = %CATEGORY_SET%
CURRENCY = EUR
TID_RA = %PER%
OTHER = [ENTITY = %ENTITY_SET%]
CALC = LEVLE08
*ENDRUN_PROGRAM

This seems to work fine for all periods but JAN. When I run the script for a JAN I get a warning as the package status with no real error. Could this be the case because %PER% is empty for JAN and the system doesn't know what to do with that information?

Thanks,
Arnold

former_member186338
Active Contributor
0 Kudos

"When I run the script for a JAN I get a warning as the package status with no real error." - yes!

But warning status is ok for this case to my mind 🙂

With:

TID_RA =

The CALC_ACCOUNT will do nothing

former_member186338
Active Contributor
0 Kudos

"Can I add a *WHEN TIME.MONTHNUM around the *run_program call in my script?" - NO!

But you can filter %TIME_SET% selected by user.

Something like:

*SELECT(%PER%,[ID],TIME,ID=%TIME_SET% AND PERIOD<>JAN)