cancel
Showing results for 
Search instead for 
Did you mean: 

error in update rules

Former Member
0 Kudos

Hi,

i written routine in update rules of the ods. I am loading data from r/3 to 1st ods and from 1st ods to 2nd ods. In the update rules of 1st ods my routine is calculating the date_diff of two date fields. I am getting the output for some values like 12-,13- etc. In the 2nd ods update rules my routine is to get result based on the output of the above routine

for eg: if date_diff < 0,result = 0,

elseif date_diff = 0,result = 1.

elseif date_diff > 0, result = 2.

but i am getting the output as blank space for date_diff < 0 and for others it is working fine. How to solve this ?

Any help will be appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I can not explain what is going wrong with your routine, but if routine is working fine except date_diff < 0 why don't you try to change your conditions to

IF date_diff > 0 THEN 2

ELSE IF date_diff = 0 THEN 1

ELSE 0

?

Best regards,

Björn

Former Member
0 Kudos

Hi,

Thanks for your reply. I think the problem with the date_diff data ie., 12-,13- etc. I think the system is not considering the '-' sign and so the problem. If i get the '-' sign in front of the number ie, -12,-13 then i hope it will work. This is only my assumption and can u tell me how to get the '-' sign as prefix to the number like -12,-13 etc.

thanks in advance.

Former Member
0 Kudos

Hi Prasad,

I think Date_Diff is Char type. So it is not considering -ve sign.

Try this:

What will be the maximuma -value you can get(-1000 or

-2000...etc).

While calculateing Date_Diff, try to add 1000.

If Date_Diff is -12 then You will get

Date_Diff= -12 + 1000 = 988.

Now you can change you code to:

If Date_Diff < 1000

Result = 0

ElseIF Date_Diff > 1000

Result = 2.

Elseif Date_Diff = 1000

Result = 1.

Endif.

Hope it Helps

Srini

Former Member
0 Kudos

Hi,

date_diff is a quantity field with unit of measure days.

Former Member
0 Kudos

Prasad,

Why cant you try above work around....?

Answers (1)

Answers (1)

Former Member
0 Kudos

maybe there is something wrong in your target object definition...("0" is read as a not assigned value)...

If you don't want to loose your time to verify this setting, chenge your conditions to 1, 2 and 3 !!!

Stupid workaround, but...