cancel
Showing results for 
Search instead for 
Did you mean: 

Transformations

Former Member
0 Kudos

I have a DSO (A) with data. Now I need to upload it into another DSO (B) with

few new infoobjects derived in between.

In my DSO A, I have data at Header and Item level.

In a header, we can have multiple items and each item can correspond to either

SOURCE or target related data and each item is categorized in to either

source or target based on TYPE infobject (S or T).

Data Set example:

HEADER|ITEM|TYPE|LOCATION|DATE|QUANTITY

500001|0010|S|PHILADELPHI|02022010|240

500001|0020|T|PITTSBURGHH|02032010|240

In the above data set, item 0010 is Source and 0020 is target. Now using above

data set, I need to make 2 records into 1, meaning both Source and its

target into 1 record.

I will create different infoobjects each 1 for Source and target. For eg,

Source Qty, target Qty, Source LOcation, target Location, Target Date, Target Qty etc...

Now when im updating from A to B, all i need is to identify 2 items in a

header with same quantities and assign the corresponding characteristic

values (Qty, Location etc) to Source and

target info objects (Source Qty, target Qty, Source LOcation,

target Location etc...).

To identify which item/record is source and which one is target,

we have a characteristic (type) which has values 'S' and 'T'.

How do I proceed with this? I know this can be done in the Start Routine, but how do i code? Starting help would be appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Would suggest you to try the option of rule groups. In one rule group map the source fields to Source fields and second map to target fields. Then in routine filter out type T in Rule Group1 and type S in Rule Group 2.

Other way is to write End Routine.

"Declare 1 internal table of structure DSO1 and 1 of DSO2

itab_dso2[] = result_package[].

Delete itab_dso2 where type = 'T'. "this will retain only records of type source.

Select * from DSO1 into itab_dso1 for all entries in result_package where header = result_package-header and type = 'T'. "Now u have the corresponding target records.

Loop at itab_dso2 assigning <result_fields>.

Read itab_dso1 into wa_dso1 with key header = <resultfields>-header.

<result_fields>-target loc = wa_target-location. "Assign target values

Endloop.

refresh result_package.

result_package[] = itab_dso2[].

Pls let me know in case u need more info.

Reg

Aparna

Answers (2)

Answers (2)

0 Kudos

If Header is the unique Key in your DSO2;

two load from DSO1 to DSO2:

- load 1 DSO1->DSO2: with Transformation mapping to Source-InfoObject:: select S records

- load 2 DSO1->DSO2: with Transformation mapping to Target-InfoObject:: select T records

is the Header is unique,overwrite Source in load 1, and Target in load 2

DSO1:

HEADER|ITEM|TYPE|LOCATION|DATE|QUANTITY

500001|0010|S|PHILADELPHI|02022010|240

500001|0020|T|PITTSBURGHH|02032010|240

DSO2:load 1(TYPE=S ; map SOURCE):

HEADER | SOURCE-LOCATION | TARGET-LOCATION

500001 | PHILADELPHI | -

DSO2:load 2 (TYPE=T; map TARGET):

HEADER | SOURCE-LOCATION | TARGET-LOCATION

500001 | PHILADELPHI | PITTSBURGHH

done

Former Member
0 Kudos

Any suggestions guys?

Former Member
0 Kudos

you might want to try the option of rule group.

In start routine, It can be done but I would not recommend. You never know that all the same header/item combination will come in a same datapackage.

former_member185181
Active Contributor
0 Kudos

copy the result_package in to another table and you need to read or loop through it.Do it in end routine of transformation from DSO1->DSO2