on 08-27-2015 7:54 AM
Hi Experts,
I need to migrate on BPS application into IP application and FOX formula is one of them.
The BPS code is as follows:
DATA CALMONTH TYPE 0FISCPER.
DATA CALYR TYPE 0FISCYEAR.
DATA CALMON_COPYFROM TYPE 0FISCPER.
DATA OFFSET TYPE I.
DATA PERIOD TYPE 0FISCPER3.
OFFSET = 1.
PERIOD = 000.
CALYR = VARV('VFISCYR0').
CALMON_COPYFROM = CONCAT(CALYR, PERIOD).
PERIOD = 001.
IF {CALMON_COPYFROM, 000} <> 0.
DO.
CALMONTH = TMVL(CALMON_COPYFROM, OFFSET).
{CALMONTH, PERIOD} = {CALMON_COPYFROM, 000}.
OFFSET = OFFSET + 1.
PERIOD = PERIOD + 001. IF PERIOD = 013. EXIT. ENDIF.
ENDDO.
ENDIF.
{CALMON_COPYFROM, 000} = 0.
When I copy and pasted the same code in IP, it was giving me error as below:
So, I replaced the code as below:
DATA CALMONTH TYPE 0FISCPER.
DATA CALYR TYPE 0FISCYEAR.
DATA CALMON_COPYFROM TYPE 0FISCPER.
DATA KF1 TYPE KEYFIGURE_NAME.
DATA OFFSET TYPE I.
DATA PERIOD TYPE 0FISCPER3.
OFFSET = 1.
PERIOD = 000.
CALYR = VARV(D_P0FISCYEAR).
CALMON_COPYFROM = CONCAT(CALYR, PERIOD).
PERIOD = 001.
IF {KF1, CALMON_COPYFROM, 000} <> 0 .
DO.
CALMONTH = TMVL(CALMON_COPYFROM, OFFSET).
{KF1, CALMONTH, PERIOD} = {KF1, CALMON_COPYFROM, 000}.
OFFSET=OFFSET + 1.
PERIOD = PERIOD + 001. IF PERIOD = 013. EXIT. ENDIF.
ENDDO.
ENDIF.
{KF1, CALMON_COPYFROM, 000} = 0.
Is this correct ?
When I am executing the FOX Formula, I am getting an error.
Also, It would be of great help if someone can help in explaining what exactly does this code do
Thanks,
Dinesh Vadwa
Hi Dinesh,
as you have already noticed, FOX in BW-IP requires that the key figure is specified in the {...} operands. You added KF1 but you also need to set KF1 to the name of the key figure you want to change. If you need this to work for all key figures you can add a FOREACH .... IN KEYFIGURES loop around your code.
What it does? Looks like copying data from period 0 to one year to all periods of another year.
Regards,
Marc Bernard
Product Management SAP EDW (BW/HANA)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Corenlia,
I have tried it but still getting the same error while running it. No syntax error.
Below is my current code.
DATA CALMONTH TYPE 0FISCPER.
DATA CALYR TYPE 0FISCYEAR.
DATA CALMON_COPYFROM TYPE 0FISCPER.
DATA OFFSET TYPE I.
DATA PERIOD TYPE 0FISCPER3.
OFFSET = 1.
PERIOD = 000.
CALYR = VARV( D_P0FISCYEAR ).
CALMON_COPYFROM = CONCAT( CALYR, PERIOD ).
PERIOD = 001.
IF { TARGET, CALMON_COPYFROM, 000 } <> 0.
DO.
CALMONTH = TMVL( CALMON_COPYFROM, OFFSET ).
{ TARGET, CALMONTH, PERIOD } = { TARGET, CALMON_COPYFROM, 000 }.
OFFSET = OFFSET + 1.
PERIOD = PERIOD + 001.
IF PERIOD = 013.
EXIT.
ENDIF.
ENDDO.
ENDIF.
{ TARGET, CALMON_COPYFROM, 000 } = 0.
Thanks,
Dinesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dinesh,
TARGET is the technical name of your key figure - right?
Why do you use a data declaration for 0FISCYEAR? From the formula tuples I don´t see any fiscyear.
What are your fields to be changed? I assume its 0FISCPER and 0FISCPER3?
if period = 0FISCPER3 then this line should not work
PERIOD = PERIOD + 001.
since 0FISCPER3 is a time char you need to work with the TMVL again,
so it sould be period = tmvl(period, 1).
regards
Cornelia
I have created Planning Sequence and executed it with trace to get the below Error:
Please help me here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dinesh,
why are you asking us what the code is doing? You should know what you want your function to do.
What I can see is, that it is copying data from period 000 to periods 001 -> 012 and then deletes the value on period 000.
do you get errors when checking the fox code?
What is the error you get when running the function?
regards
Cornelia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.