Skip to Content
0

Restrict *run_program calc_account by TIME

Mar 27, 2017 at 09:45 AM

75

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Vadim Kalinin Mar 27, 2017 at 10:13 AM
0

"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)

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 27, 2017 at 01:29 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

"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

0
Vadim Kalinin Mar 27, 2017 at 03:12 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded