Skip to Content
0

DSO self transformation

Sep 21, 2017 at 04:44 PM

124

avatar image
Former Member

Hi,

I have one DSO which contains some data. My requirement is to replace GL Account = X with 'Y'.

This DSO has 6 other key fields.

I am trying use the following code in start routine. However the below code is not changing the existing record , but it is creating a new record by copying the existing record, and replacing the GL account = Y.

In the end, i have two records, one with GL =X and another with GL = Y.

I just need only one record with GL = Y.

LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

IF <SOURCE_FIELDS>-GL_ACCOUNT = 'X'

<SOURCE_FIELDS>-GL_ACCOUNT = 'Y'.

ENDIF.

ENDLOOP.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Sep 21, 2017 at 10:41 PM
0

Hi

in this case you can use simple field routines

for each infobject that you need to modify, you can insert in the transformation a simple routine

IF.....<your condition>

RESULT = <your result>

ENDIF.

You will wind endless examples of these simple transformations in SDN

Hope it helps

Share
10 |10000 characters needed characters left characters exceeded
Koen Hesters Sep 22, 2017 at 07:34 AM
1

Hi,

you'll need to set the recordmode of the existing one to 'D', to delete it, it is normal behavior of the flow to create a new record, because you're changing key values

PS changing GLAccount is no clean business IMO

grtz

Koen

Share
10 |10000 characters needed characters left characters exceeded
Nanda Anantha Sep 21, 2017 at 08:09 PM
0

If GL Account infoobject is part of DSO key then it will create new record.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

and you can delete the old records with a selective deletion. should give the needed content in the dso.

the best approach would be however to copy the dso, and load/transform the data in transformation to copy dso. emtpy the original dso and reload correct data from copy dso.

1