on 02-09-2016 12:10 PM
Hi there,
we need a solution to this cenario:
source (object with atributes)
material - area - lifetime
1 0 10
1 1 20
1 2 28
destination (into the same object with atributes)
material - area - lifetime - lifetime 1 - lifetime 2 - lifetime 3
1 0 10 10 20 28
1 1 20 10 20 28
1 2 28 10 20 28
this fields are all of type char.
is it possible to use group rules in the transformation to get this results?
thanks,
GPC
In the start routine, copy source_package to temp_package. Loop thru source_package, and for each record, read the temp_package to pull the needed values to the 3 new columns. The DTP will need semantic grouping by material to ensure all the rows for a material are in the same data package.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try using an APD to perform this same function? Component : Transform Data Record into List
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Goncalo,
A few options come to mind. One is to use a rule group for each value of life time, provided you have only these three values for lifetime otherwise you will have to create too many rule groups and the transformation is executed 'n' times for 'n' lifetime values.
In rule group one update only 10, in two only 20....and so on.
Another option(if only three lifetime values) is to copy the SOURCE_PACKAGE to three different internal table(one with only 10, one with 20...better have a hashed table since you are only going to be reading) and read the tables for each record passing through the SOURCE_PACKAGE loop.
Third is to copy source to a sorted internal table like Kurt Johnson suggested above and have a loop with index inside the source package for each record.
You make have to make a choice based on the performance of the transformation
Benedict
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the responses. Some more information:
material anda area are keys... when im saying lifetime 1 is for area 0, lifetime 2 is for area 1 and lifetime 3 is for area 2
source (object with atributes)
material - area - lifetime
1 0 10
1 1 20
1 2 28
destination (into the same object with atributes)
(KEY) (KEY) (for area 0) (for area 1) (for area 2)
material - area - lifetime - lifetime 1 - lifetime 2 - lifetime 3
1 0 10 10 20 28
1 1 20 10 20 28
1 2 28 10 20 28
with this new information i can use the rule group, rigth?
If these are the only fields in the transformations then you can very well use rule groups, but if you have like 15-20 fields in your source and target then executing the transformation for each rule group would be a burden..then you can think of other options like LOOP or READ inside routines.
There are a lot of documents and discussions on rule group. I would encourage you to search for documents on rule groups and try it.
One hint is in your case have the same key in target as in source. In your first rule group(default) have lifetime2 and 3 as no update and so on for every rule group.
Hi,
Something like this..
rules 1
source target
material ----- material
area ------ 0 (constant)
lifetime ------ lifetime 1
rules 2
source target
material ----- material
area ------ 1 (constant)
lifetime ------ lifetime 2
rules 3
source target
material ----- material
area ------ 2 (constant)
lifetime ------ lifetime 2
Regards,
Loed
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.