on 11-26-2007 5:38 PM
Hi Gurus
We are using BW 7.0 and data is loaded to a custom InfoCube using Transformations. PSA is used to store data intermediately.
We have a requirement that data records from source system will come for different value types. If source data records contain '20' as value type then we need to split-up this record into 2 new records. The new data records should have value types '25' and '30'. And we need to distribute the amount in original data record equally among the 2 newly created data records.
Can somebody please explain how can we do that?
I think, we might have to write some code in Start Routine of Update Rules to do this but I know very little ABAP. So your expert help would be appreciated.
Points guaranteed!
Regards
Adi
Hi Adi,
Data : Ls_source_package like source_package.
Data : Ls_source_package1 like source_package.
Loop at source_package into ls_source_package.
If ls_source_package-<Value Type> = '20' .
ls_source_package1-<value type> = 25.
ls_result_package1-<Amount> = ls_source_package-<amount> / 2.
append ls_result_package1 to source_package.
ls_source_package1-<value type> = 30.
ls_result_package1-<Amount> = ls_source_package-<amount> / 2.
append ls_result_package1 to source_package.
endloop.
Please apply the above code in the start routine and check..
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adi,
In transformation End Routine you do this.
Sample Code:
Data : Ls_result_package like result_package.
Data : lt_result_package type standard table of ls_result_package.
Loop at result_package into ls_result_package.
If ls_result_package-<Value Type> = '20' .
ls_result_package-<value type> = 25.
ls_result_package-<Key Figure_1> = ls_result_package-<Key Figure_1> / 2.
ls_result_package-<Key Figure_2> = ls_result_package-<Key Figure_2> / 2.
ls_result_package-<Key Figure_3> = ls_result_package-<Key Figure_3> / 2.
.
.
.
<i>--> For First Record</i>
append ls_result_package to lt_result_package.
<i>---> for secound record</i>
ls_result_package-<value type> = 30.
append ls_result_package to lt_result_package.
clear ls_result_package.
Endloop.
<i>--> Clear Result_package table</i>
Refresh result_package.
--> Push data from Lt_result_table to Result_Table.
Insert lines of table lt_result_table from 1 into result_table.
P.S: This is sample code only, check for systax errors....
Hope it Helps
Srini
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 | |
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.