on 2020 Oct 19 3:41 PM
Friends,
Env - 10.1 standard
I am looking for a functionality to copy data from a single account to another (script, badi etc)
Copy data from Account1 to Account2, for the current month ( for one specific audit trail ,rest of the dimensions should be remain same) only if the SenderCostCenter is populated with drivers percentages [Different audit trail].
example,

Scripts are easy to read and maintain, but does Does lookup function on every SenderCostCenter take a lot of time. i am inclining towards badi just for the performance.
Is there any other alternatives.
Thank you for your time.
Request clarification before answering.
sap.user62
It's not possible to test for ANY costcenter 🙂
You have to perform some precalculations for driver:
*XDIM_MEMBERSET ACCOUNT=P_DRIVER
*XDIM_MEMBERSET AUDITTRAIL=DRIVERS
*XDIM_MEMBERSET Costcenter=<ALL>
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=(%VALUE%==0) ? 0 : 1,Costcenter=TEST_CC) //Create TEST_CC in Costcenter dimension
*ENDWHEN
*XDIM_MEMBERSET ACCOUNT=AL_OPEX
*XDIM_MEMBERSET AUDITTRAIL=T_DATA
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=(([Costcenter].[TEST_CC],[ACCOUNT].[P_DRIVER],[AUDITTRAIL].[DRIVERS])>0) ? %VALUE% : 0,ACCOUNT=ALSENDER)
*ENDWHEN
TEST_CC will contain 1...n or nothing for each SenderCostCenter
If TEST_CC>0 then write tr data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sap.user62
Convert to answer - Done!
You can also add code to clear TEST_CC before writing.
Why do you scope drivers??? Only transaction data have to be scoped.
*XDIM_MEMBERSET ACCOUNT=AL_OPEX
*XDIM_MEMBERSET AUDITTRAIL=T_DATA
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=(([ACCOUNT].[P_DRIVER],[AUDITTRAIL].[DRIVERS])==0) ? 0 : %VALUE%,ACCOUNT=ALSENDER)
*ENDWHEN([ACCOUNT].[P_DRIVER],[AUDITTRAIL].[DRIVERS]) - tuple expression
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have updated the script to scope only transaction data. It correctly scopes are the transaction records, but it writes 0 values to the new account for all scoped records.
I even tried to [CostCenter],[ALL] but it still write a record with zero value,
Next I tried this,
*REC(EXPRESSION=(([Costcenter].[502041],[ACCOUNT].[P_DRIVER],[Audittrail].[DRIVERS])==0) ? 0 : %VALUE%, ACCOUNT= ALSENDER)
*ENDWHEN
and it writes the correct transaction values to the new account.
I think this operator looks for a complete match for the rest of the dimensions other than the account and audittrail we specify in the operator.
Is there a way to get the cost centers in the expression or make the expression to ignore Cost center.
Sorry, but for T_DATA line we have 505003 for both sendercostcenter and costcenter -
T_DATA auditrail has the pre allocated data that is pushed from finance to allocation model. So we have both sendercostcenter and costcenter as the same number, as finance does not have a separate sendercostcenter dimension.
What driver line you want to test for some value??? Any costcenter or ???
- Any cost center, We want to check if there is atleaset one allocation driver for the current month.
You don't need a lookup, just use member tuple and ternary operator to check:
*REC(EXPRESSION=([Audittrail].[Drivers]==0) ? 0 : %VALUE%,Account=XX2)...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you.
*REC(EXPRESSION=([Audittrail].[Drivers]==0)?0:%VALUE%,Account=XX2)when we look at condition, [audittrail].[drivers] = 0, does it expect a one to one match on rest of the dimensions except the audit trail?
in my case the account numbers for drivers and raw transaction data are different. also it possible in ternary operators to ignore one or two dimensions.
( like if category is actual, reporting currency is USD, then if there is a valid % for that sendercostcenter dimension, we need to update another account., you can ignore the values of the Costcenter dimension even if there is mismatch)
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 7 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.