on 10-16-2007 7:26 PM
Hi
This is my requirement i have to create 2 new KF and add them in a Cube
and in the update rules map KF1 with QTY(comes from an ODS) I am done with these steps.
and now i need to write a routine on KF2 in the update rules which shoud do this
KF2 = KF1(QTY*Price) Price also comes from the same ODS where QTY is coming and the source to this Cube.
Can some one help me write the Routine to this.
Thanks.
Hi Kim,
There are two ways of doing this.
1. To write the code in update routines
2. To write this in the start routine.
I would prefer in start routine, because this will be better from performance prespective.
Steps:
1. create an internal table TB1 with structure as data_package.
2. create TB2 with KF1 and price and other relevant fileds from ODS let say YOXYZ.
3. loop at data_package into TB1.
4. select (KF1 and price) into corresponding fields of table TB2 from /bic/yoxyz00 where (selection).
5. va_kf2 = tb1-kf1 * tb1-price.
6. TB1-kf2 = va_kf2.
append tb1 into tb_final (third internal table same in struc as data_package.)
7. endloop.
data_package[] = tb_final[].
Needless to say u need to add kf2 in comunication structure also. then only this will be in the data_package.
Hope this helps!!
Assign points if this works...
Regards,
Jadeep..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kim,
One way to do it is this:
1. Declare a global variable (in the start routine) say Var1.
2. After you assign a value to KF1, move the same value to Var1 (Var1 = result).
3. In the routine for KF2, use this variable Var1 in your calculation. Make sure that you clear this variable before leaving the routine.
PS: The pre-requisite for this is that you should have KF1 above KF2 in the UR. You can do this by using the "Move" button in the UR.
Hope this helps.
Thanks and Regards
Subray Hegde
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.