on 07-30-2014 9:15 AM
Hi Experts,
We would like to run logic using ABC only when a certain condition is met. For example, perform an account
adjustment when Account X >0.
We added the following script to the script logic to execute the ABC. However, this logic is limited to MS. Is there an equivalent NetWeaver logic that does the same?
2) Instead of this logic can
you guys suggest another way to condition the ABC?
Note we used the RUN_PROGRAM CALC_ACCOUNT statement works for us without using conditions.
We are aware of the following conditional syntax but does it work with RUN_PROGRAM CALC ACCOUNT?
REC(EXPRESSION=([ACCOUNT].[116000_R],[AUDITID].[AD3100]) >0 ?
-([ACCOUNT].[216000],[AUDITID].[AD3100]):([ACCOUNT].[116000],[AUDITID].[AD3100]),ACCOUNT="216110",AUDITID="AD3055")
Script added:
*WHEN CUENTA
*IS
59IM90000
*WHEN
GET(CUENTA="59IM90000()
*IS
> 0
Initial script to execute the ABC:
*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = ACTUAL
CURRENCY = LC,USD
TID_RA = %TIME_SET%
OTHER = [ENTITY = %ENTITY_SET%]
OTHER=[ENTITY=%ENTITY_SET%;INTERCO=%INTERCO_SET%;BANK=%BANK_SET%;TC=%TC_SET%;COST_CENTER=%COST_CENTER_SET%;ACTIVITY=%ACTIVITY_SET%;SUBGLOBALRGN=%SUBGLOBALRGN_SET%;ACTIVE_INGREDIEN=%ACTIVE_INGREDIEN_SET%;COUNTRY=%COUNTRY_SET%]
CALC=7_115_GREAT
*ENDRUN_PROGRAM
Thanks in advance.
Eyal Feiler
Hi Eyal,
There are no conditions in CALC_ACCOUNT, you requirements can't be implemented this way.
The script logic can perform conditional calculations like:
*REC(EXPRESSION=%VALUE%>0 ? %VALUE% : 0, SOMEDIM=TARGETMEMBER1)
*REC(EXPRESSION=%VALUE%>0 ? 0 : %VALUE%, SOMEDIM=TARGETMEMBER2)
In this case current value will be written to TARGETMEMBER1 if positive and to TARGETMEMBER2 if negative.
But please, provide more info inline with:
Explain the calculation logic!
Vadim
Message was edited by: Vadim Kalinin - corrected second REC
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 for your response.
Here is a fuller explanation of what we are doing.
We compare a set of asset accounts vs. liabilities in this case deferred assets vs. deferred liabilities. In
case A -> assets are < liabilities 3600 vs. -4560 (net -960).
Expected result we will use ABC logic DEF_ASSETS_LESS and reclass from an asset account -3600 and book to the liabilities 3600.
The result will be -960 on the liabilities side and 0 on assets.
The activity will be booked in a different datasource (AuditID in our model).
In case B assets > liabilities. Use ABC logic ABC logic DEF_ASSETS_MORE 5000 vs. -4560 = 440 net.
Book
4560 to a liability offset account and 4560 to an asset.
Result
is 440 in the assets. 0 liabilities.
col
column AD3100 shows results before reclassification. Column AD3057 shows the adjustment taking the sum of the liabilities and shifting to assets.
ABC is effective because we can select multiple base members of data sources and the change affects all rows for the matching accounts with the various dimensions e.g. country, bank etc.
The problem is to use the condition, so that we can decide automatically whether to apply either logic.
The issue we had with the script you suggested earlier is that we could not select
multiple base member dimensions for data source and others (see thread - http://scn.sap.com/thread/3487307).
Any ideas as to script logic or ABC?
We want to stay with script logic. Else we may need to go to ABAP.
Thanks
Eyal
Hi Eyal,
"The issue we had with the script you suggested earlier is that we could not select
multiple base member dimensions for data source and others" - not clear.
In script code you can compare some member value with 0 and write to some member something depending on the comparison result.
If you need to compare base member, then it's simple:
*REC(EXPRESSION=%VALUE%>0 ? %VALUE% : 0, SOMEDIM=TARGETMEMBER1) //%VALUE% is the current base member value.
If you want to compare parent then it's a bit more complicated. 2 options:
1. You can create some base member equivalent to parent member and first copy all base members of parent to this new member (not a children of the parent).
*XDIM MEMBERSET ACCOUNT=BAS(PARENT1)
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%,ACCOUNT=PARENT1BAS) //PARENT1BAS - will be BAS PARENT1 equivalent
*ENDWHEN
*XDIM MEMBERSET ACCOUNT=PARENT1BAS
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%>0 ? %VALUE% : 0, SOMEDIM=TARGETMEMBER1)
*ENDWHEN
2. Use *WHEN_REF_DATA = MASTER_DATA - to perform calculations even if there is no record in the scoped base member
*WHEN_REF_DATA = MASTER_DATA
*XDIM MEMBERSET ACCOUNT=BAS1 //BAS1 - any base member of PARENT1
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=[ACCOUNT].[PARENT1]>0 ? [ACCOUNT].[PARENT1] : 0, SOMEDIM=TARGETMEMBER1)
*ENDWHEN
second option can be less effective because *WHEN_REF_DATA = MASTER_DATA affects all dimensions!
Vadim
User | Count |
---|---|
14 | |
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.