Skip to Content
avatar image
Former Member

Scoping in Default Logic

Hello,

If I have a simple default logic (see below for code), do I need to scope it? whats the advantage or disadvantage of it?

Thanks.

*WHEN HR_ACCT

*IS AC_611000

*REC(EXPRESSION=%VALUE%)

*ENDHWEN

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 07, 2017 at 11:01 AM

    First of all this code do nothing :)

    In general you have to avoid scoping in default logic - you have to work with the scope passed after writing data to model.

    Please read: https://blogs.sap.com/2014/06/09/how-to-write-defaultlgf/

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 07, 2017 at 11:49 AM

    Just some samples:

    If ACCOUNT is A1 then multiply value by A2 and write result to A3

    default.lgf (for data saved by input form)

    *WHEN ACCOUNT
    *IS A1
    *REC(EXPRESSION=%VALUE%*[ACCOUNT].[A2],ACCOUNT=A3)
    *ENDWHEN

    DM package script to perform this calculation for user defined scope:

    *XDIM_MEMBERSET ACCOUNT=A1 //fixed scope for ACCOUNT
    *XDIM_MEMBERSET TIME=%TIME_SET% // user scope for TIME
    *XDIM_MEMBERSET ENTITY=%ENTITY_SET%
    //...
    *WHEN ACCOUNT
    *IS * //already scoped
    *REC(EXPRESSION=%VALUE%*[ACCOUNT].[A2],ACCOUNT=A3)
    *ENDWHEN
    Add comment
    10|10000 characters needed characters exceeded