cancel
Showing results for 
Search instead for 
Did you mean: 

Update multiple rows of DSO from Datasource

darryl_goveas3
Participant
0 Kudos

Hi,

We have a custom DSO with 4 key characteristics. It is initially populated by a custom datasource correctly.

We now need to update some of the data fields using a standard datasource, but it only has two of the key fields available.

In the transformation from the datasource to this DSO, I have generated an internal table in the start routine to collect the additional two key fileds from the DSO table.

I was wondering if there is a way to loop through when loading to update all the rows for the other two keys?

e.g.

DSO - load from custom datasource:

K1 K2 K3 K4 D1 D2

a b c d 1 2

a b e f 3 4

standard datasource

K1 K2 D2

a b 8

We would like to use the data from the standard datasource to update both rows in the DSO to populate data column D2 with the value 8.

Thanks!

Darryl

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Darryl,

The way you planned would not work. You could do what Raj suggested. Create a new DSO2 with keys K1 and K2 and load the std datasource into it.

Now create a self loop on DSO1 as explained by Raj and in the routines look-up DSO2 and fill D2 where DSO1-K1 = DSO2-K1 and DSO1-K2 = DSO2-K2.

I guess you want to update 8 for D2 for both records.........

a b c d 1 2 8

a b e f 3 4 8

Regards,

Murali.

darryl_goveas3
Participant
0 Kudos

Thanks Guys!

That worked perfectly - points assigned.

Murali - thanks for the detailed reply - that really clarified it for me.

B.Rgds,

Darryl

Answers (2)

Answers (2)

Former Member
0 Kudos

Darryl,

In case you dont want to create a new DSO, you can try this option.

Add the infosource between the standrad data source and DSO and this infosource should have the structure same

as the DSO.

The transfermations between DS and Infosource should be 1 to 1, But in the start routine of the transfermations between infosource and DSO , write the following logic.

- Declare an 2 internal tables same as the source_package.

- Read the DSO active table with key1 and key2 from source_package into the internal table1 declared above.

- Copy source_package contents to internal table2.

- delete the contents of source package.

- Loop at internal table 1 and populate key3 and key4 by reading internal table2.

- Modify source_package from internal table1.

Thanks,

Ravi.

Former Member
0 Kudos

Try creating a self loop on the DSO (Transformation from and to the same DSO) and write your code there.