Skip to Content
avatar image
Former Member

Restrict *run_program calc_account by TIME

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Mar 27, 2017 at 10:13 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 27, 2017 at 01:29 PM

    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

    Add comment
    10|10000 characters needed 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

  • Mar 27, 2017 at 03:12 PM

    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

    Add comment
    10|10000 characters needed characters exceeded