on 05-24-2016 2:59 PM
Hi,
I need to copy from TIME "2016.01" to several "TIME" in script DEFAULT.LGF
For example: in input form, I enter the following value
TIME ACCOUNT SIGNDATA
2016.01 ACCOUNT1 200
After that I need to have when we save input form : create the 11 new records follonwing
TIME ACCOUNT SIGNDATA
2016.01 ACCOUNT1 200
2016.02 ACCOUNT1 200
2016.03 ACCOUNT1 200
2016.04 ACCOUNT1 200
2016.05 ACCOUNT1 200
2016.06 ACCOUNT1 200
2016.07 ACCOUNT1 200
2016.08 ACCOUNT1 200
2016.09 ACCOUNT1 200
2016.10 ACCOUNT1 200
2016.11 ACCOUNT1 200
2016.12 ACCOUNT1 200
I started to write the following script
*XDIM_MEMBERSET CATEGORY = ACTUAL
*XDIM_MEMBERSET ACCOUNT = ACCOUNT1
*WHEN TIME
*IS 2016.01
*WHEN ACCOUNT
*IS ACCOUNT1
*REC(TIME="2016.02")
*ENDWHEN
*ENDWHEN
Of course, the script is good for only the period 2016.02. I tried with the TMVL and variable....
Can you help me to modify this script ?
NB : NW10SP12, BW731 SP16
Regards
Bastien
Hi Bastien,
One REC = One copy!
You can use multiple REC's...
But you have to clearly explain your requirements:
Do you want to copy always from the first month?
Do you want to copy to all months of the year except the first month?
Do you want to do it only if category is ACTUAL?
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,
See my answer
Do you want to copy always from the first month? Yes
Do you want to copy to all months of the year except the first month? : Yes
Do you want to do it only if category is ACTUAL? : Yes
Remarks : I dont use the multiple REC's because in order to simplify this example, I want to copy all weeks and not all months, So 52 lines with *REC is too much
Bastien
//%TIME_SET%=2015.01,2015.02,2016.01,2016.03
*SELECT(%FPS%,[ID],TIME,BASE_PERIOD=1 AND ID=%TIME_SET%) //get list of first periods
//%FPS%=2015.01,2016.01
*SELECT(%YS%,[YEAR],TIME,ID=%FPS%) //get list of years
//%YS%=2015,2016
*XDIM_MEMBERSET CATEGORY = ACTUAL
*FOR %FP%=%FPS% AND %Y%=%YS%
*RUNALLOCATION
*FACTOR=1
*DIM TIME WHAT=%FP%;WHERE=%Y%.02,%Y%.03,...,%Y%.52
*ENDALLOCATION
This script is not perfect because it will be launched even if data is entered not for ACTUAL
The best solution is to write simple write back badi like here:
Vadim
If it's only for ACTUAL it can be slightly improved to:
In CATEGORY dimension create property ISACTUAL and fill it with Y for ACTUAL member
*SELECT(%FPS%,[ID],TIME,BASE_PERIOD=1 AND ID=%TIME_SET%)
*SELECT(%YS%,[YEAR],TIME,ID=%FPS%)
*SELECT(%AC%,[ID],CATEGORY,ISACTUAL=Y AND ID=%CATEGORY_SET%)
//%AC% will contain ACTUAL or nothing
*FOR %A%=%AC%
//The code here will not execute if no ACTUAL
// But if multiple categories are processed with ACTUAL - all time members will be calculated - even not ACTUAL
...
User | Count |
---|---|
14 | |
4 | |
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.