on ‎2015 Nov 18 12:25 PM
Hi Experts,
I am using *Select statement in which I need to use TMVL function. But the system does not recognize TMVL function in *SELECT statement.
The script I am using is written below.
*SELECT(%DEP_LOOP%,ID,TIME,ID>=%TIME_SET% AND ID<= TMVL(5,%TIME_SET%), AND LEVEL = MONTH)
The purpose of the above statement is to use a loop from a minimum time to the maximum time.
Also guide me can I use LOOKUP within TMVL? Need your urgent expert opinion.
Regards,
Request clarification before answering.
Hi Sami,
You can't use TMVL inside SELECT, because TMVL is processed later than SELECT!
What do you want to achieve? Select next 5 months?
And what do you want to achieve with LOOKUP?
Vadim
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 reply.
I lookup the member NO_OF_MONTHS from another model.
This LOOKUP value will be used in the main model in FOR loop.
for eg. No_of_months = 4
then in the main model the for loop should start from the %TIME_SET% till the No_of_months.
e.g
if TIME_SET = 2016.01
then loop should work for 2016.01, 2016.02, 2016.03 and 2016.04 respectively.
I hope you understand.
Regards
Hi Vadim,
Please find below the script logic.
*LOOKUP CAPEX_DRIVER
*DIM ALIFE:ACC_CAP_D= "ASSETLIFE"
*DIM CURRENCY= "PKR"
*DIM VERSION = "Plan"
*DIM ASSET_SUPER = CI3
*DIM TIME = NO_TIME
*DIM ENTITY = %ENTITY_SET%
*ENDLOOKUP
*XDIM_MEMBERSET VERSION = Plan
*XDIM_MEMBERSET ACC_CAP_M = COST, ASSETDEPEXP
//*XDIM_MEMBERSET TIME = NO_TIME
*XDIM_MEMBERSET ASSET_SUPER = CI3
*XDIM_MEMBERSET COST_CENTER = 1010102001
*XDIM_MEMBERSET PROJECT = P002
*XDIM_MEMBERSET ENTITY = 1000
*SELECT(%DEP_LOOP%,ID,TIME,ID>=2016.01 AND ID <= TMVL(5,2016.01) AND LEVEL = MONTH)
//need help in the above select statement. The value ASSETLIFE is LOOKED up from CAPEX Driver model. The loop should work with the life defined in the driver model. For each ASSER super the life is different. Right now trying to test on single asset super.
//*FOR %PERIOD% = %MTHLY_LOOP%
*SELECTCASE ACC_CAP_M
*CASE ASSETVALUE > 0
*FOR %DEP% = %DEP_LOOP%
*WHEN ACC_CAP_M
*IS "COST"
*REC(EXPRESSION = %VALUE%/LOOKUP(ALIFE), TIME = TMVL(1,%DEP%), ACC_CAP_M = ASSETDEPEXP)
*ENDWHEN
*NEXT
*ENDSELECT
Capex Driver:
This below cost exist in the main CAPEX model against each Asset Super Class (Laptop, Desktop, car etc)
We need to build a mechanism in order to calculate the depreciation based on the life in months set in capex driver model.
For eg. The car depreciation calculated by the system from 2016.02 till 2017.01 = 550,000 + salvage value 150,000 = 700,00 i.e the original cost of Car.
The above planned depreciation we want to calculate in BPC.
Then I can give you a good advice - stop developing script for this scenario. On the production volumes it will calculate endlessly due to multiple nested FOR/NEXT loops. Start badi development! It's not a great job - just one day for ABAP developer!
Vadim
P.S. There are a lot of calculation scenarios that can be implemented by script logic. This is the opposite case - custom logic badi will do the job!
| User | Count |
|---|---|
| 40 | |
| 9 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.