cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry - Decimal Number in Complex Table Drop Down

Former Member
0 Kudos

I have a complex table with two fields in it.  One is an ID field and the other is a decimal value field.  I tried setting the decimal value field to a Number type but the values got rounded to an integer.  I then changed it back to the default ASCII field type so I could have the full precision.  I am using this complex table for a drop down on a transaction screen.  The value I select in the complex table drop down is getting saved fine without rounding.  However, when I try to use it in a PROD function within an update rule it appears to be rounding the value returned from the drop down.  For example:

ComplexTableDropDownField = 1.5

OtherField = 2

PROD(ComplexTableDropDownField, OtherField) = 2

I have confirmed that it is not rounding the other field and that the rule is working correctly if I hard code the values.  It only seems to round the complex table drop down value.  Any ideas on how to get around this issue?

Accepted Solutions (1)

Accepted Solutions (1)

jason_latko
Advisor
Advisor
0 Kudos

Christopher,

Where is your PROD rule being used?  You say the value is being used as a drop-down on screen.  How do you have that screen field configured?  Is it tied to a transaction property?  If so, what data type is the transaction property?  Please post a screen shot of your rule and any other relevant screens concerning the screen field setup, transaction property, etc...

Is the data type of the field where you are using your PROD rule set up as a decimal?  If not, that might cause this behavior.  Another guess is that you need to convert the complex table field data to a decimal number with the FROM_DECIMAL_NUMBER conversion function before using it with PROD.

Need more info to help.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Thanks for the quick reply Jason!  The PROD rule is being used as an update rule in another field on the transaction screen.  The drop down field is tied to a decimal transaction property.  I've tried using the FROM_DECIMAL_NUMBER function around the ShuntAmv field in the rule below but it didn't seem to make a difference.

Here is the rule:

Here is the complex data drop down field:

Transaction Property:

jason_latko
Advisor
Advisor
0 Kudos

Christopher,

What client are you using?  Do you get different results depending on the client?  Try on the ATE (Agentry Test Environment) where you can turn on debugging for your rule to see what is happening.

I think you said if you hard-code the decimal value, it works, correct?  So your field setup must be fine.  I can't understand why that would happen.  Try getting at the drop-down value differently using:

SCREENFIELDVALUE

     ShuntAmv (This is a hand-typed constant)

You could also try looking up the value again in the CT, rather than using the already chosen value:

COMPLEXTABLE

     tablename

     SCREENFIELDVALUE

          ShuntAmv (This is a hand-typed constant)

     indexname

     returnfield

The second way is redundant obviously because you are using the value already returned in the drop-down to look up the same value again from the CT, but maybe this would help.  It seems something about referencing the field directly is rounding it.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

The solutions you suggested were still resulting in a rounded value.  However, I was able to get it to work using the PARSE_FORMATTED_DECIMAL function.  I'm not sure why FROM_DECIMAL_NUMBER wouldn't work.  Here is the working rule:

jason_latko
Advisor
Advisor
0 Kudos

Christopher,

Good to know.  Very strange bug.  Still curious if this is a problem on all clients or just the one you are working with.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

I was experiencing the issue using the iOS client.  I'm not able to use the Agentry test client as my screens don't render correctly in there.

Answers (0)