cancel
Showing results for 
Search instead for 
Did you mean: 

Update routine- How to NOT overwrite the existing value

Former Member
0 Kudos

I have a code something like this in my update routine:

IF CONDITION 1

RESULT = X

ENDIF.

the infoobject has 2 update rules with this field as the overlap.

the problem is that when this field is populated by the first update rules, the second update rule (which has this code) overwrites the original value with a blank when the condition is not met.

What I want is that if the condition is not met the result should not overwrite the existing value?

How to achieve this?

Thanks,

Saurabh Bansal

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Nobody an idea?

I'm desperate. The workaround I have right now is not at all satisfying...

Thanks for your help!

Former Member
0 Kudos

BTW, where is it used ...all your condtions..h is the flow first of all??

Y not try use the ADDITION MODE...instead OVERWRITE MODE for second Update rule..

Former Member
0 Kudos

Hi,

Here if condition 1.......you mean to say if this condition is true....the result = x ? if so then if this condition does'nt satisfied.....then result = x should'nt execute.....whatever...........

You can use a temporary variable.....like result 1.....atfirst you put the original value to that variable..........if this condition does'nt satisfy.............then......result = result1......

Regards,

Debjani....

Former Member
0 Kudos

if this condition is not satisfied then the result is updated as blank. and it overwrites the existing value in the master data table. I dont want to overwrite the existing result with a blank.

There is no source field. It is calculated in the update routine based on the business logic.

I guess is what I want is that if the condition is not met then the value should be "No update" instead of "Overwrite" . How do I set my result as no update

Remember - "No update" is different from updating a blank.

Former Member
0 Kudos

Can you try this.

If condition = true.

result = x.

returncode = 0.

else.

returncode = 4.

endif.

Former Member
0 Kudos

Hello experts!

I am experiencing the same problem. I want to fill two fields (attributes) - group 1 and group 2 - from a DSO. Whether the group id is written to the attribute group 1 or group 2 is determined by a condition in the routines which check the group type.

When selecting one of the group types in the DTP the update is done correctly. When defining a second DTP for the other group this group is also updated "correctly" BUT the first group is overwritten.

How do I avoid this? I'm not very sufficient in ABAP, so I could use detailed help!

I can emagine either reading the target field to a variable and writing it back if the condition is not true or somehow skipping the record if the condition is not true.

Help would be greatly appreciated!

Cheers

debru