on ‎2020 Mar 05 5:59 PM
Hi Gurus,
I have a very complicated Requirement in which I need member A (INPUT_RECURRING) to always be added with member B (FROM_TRAVEL) and store this aggregated value back to member A (INPUT_RECURRING). Essentially, I am trying to mimic a parent node aggregation of two member that sit at different levels of the hierarchy.
I did manage to write a logic script that does that and placed it in the default logic but every time we save a new record it doubles the aggregation since it does not know when to stop aggregating.
I was hoping to get some guidance onto how to achieve this requirement differently. Thanks in advance
Here is the script I wrote;
*XDIM_MEMBERSET AUDIT_TRAIL AS %INP_RECURR% = INPUT_RECURRING, FROM_TRAVEL
*XDIM_MEMBERSET AUDIT_TRAIL=%INP_RECURR%
*WHEN CURRENCY
*IS LC
*WHEN AUDIT_TRAIL
*IS %INP_RECURR%
*REC(EXPRESSION=%VALUE%*1,AUDIT_TRAIL=INPUT_RECURRING,CURRENCY=LC)
*ENDWHEN
*ENDWHEN
Request clarification before answering.
First of all, please read my blog: https://blogs.sap.com/2014/06/09/how-to-write-defaultlgf/
You will understand why *XDIM_MEMBERSET is a bad idea. When you overwrite the scope it will be executed for any write to the cube!
After some analysis I have found that it's not possible to achieve the required logic in default.lgf - due to default.lgf scope issue (read my blog!).
Only write back badi will do the job!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vadim. I will look into the Write Back then
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
Thanks a lot for your fast response. Right below is the complete Logic Script I am using in the DEFAULT.LGF and also I have added a sequence of screenshots explaining my business case
*XDIM_MEMBERSET AUDIT_TRAIL AS %INP_RECURR% = INPUT_RECURRING, FROM_TRAVEL
*XDIM_MEMBERSET AUDIT_TRAIL AS %INP_NON_RECURR% = INPUT_NON_RECURRING, FROM_TRAVEL_NR
*XDIM_MEMBERSET AUDIT_TRAIL = %INP_RECURR%,%INP_NON_RECURR%
*XDIM_MEMBERSET CURRENCY = LC
*WHEN AUDIT_TRAIL
*IS %INP_RECURR%
*REC(EXPRESSION = %VALUE%*1,AUDIT_TRAIL = INPUT_RECURRING,CURRENCY = LC)
*ENDWHEN
*WHEN AUDIT_TRAIL
*IS %INP_NON_RECURR%
*REC(EXPRESSION = %VALUE%*1,AUDIT_TRAIL = INPUT_NON_RECURRING,CURRENCY = LC)
*ENDWHEN
*COMMIT
*INCLUDE STEP2_RECOSTING_AUTO.LGF
The *INCLUDE statement at the end should then run a BADI with the new aggregated value in INPUT_RECURRING or INPUT_NON_RECURRING to calculate some ratios.






Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 12 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 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.