on 08-07-2017 10:48 AM
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
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/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You may also read my other blog: https://blogs.sap.com/2014/05/05/calculations-in-write-back-badi-defaultlgf-replacement/
to understand the difference between scope of default.lgf and the data records passed to write back badi.
Yes, you have to maintain 2 scripts!
1. If you define scope in default.lgf then calculations will happen for this scope independent of user data entry - will slow down save execution. For example you defined some scope for ACCOUNT. Then even if user is not saving data for this account the default.lgf will perform calculations!
2. Please read about different sign calculation logic in my document!
"I understand it doesnt really mean anything when default is triggered by input form" - incorrect understanding, please read again: https://blogs.sap.com/2014/06/09/how-to-write-defaultlgf
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.