05-23-2012 1:19 PM
Hi all,
I have a problem with the data type "dec" in a database table.
I don't want to use FLTP because I don't want to have exponents in the value.
My problem with dec is now that the values which I save into the table are too big. (factor 1000)
I think this is the known comma and point problem. --> is comma the decimal separator or the point
How can I avoid this?
Any ideas?
Regards
05-23-2012 1:26 PM
Hi
DEC is amount field with decimal point, sign, and commas separating thousands. A DEC field has a maximum length of 31 places.
instead of that you may use
CURR: Currency field. Equivalent to an amount field DEC. A field of this type must refer to a field of type CUKY (reference field). The maximum length for this data type is also 31 places.
OR
You can define and use your Own data type
Go to se38 -> System -> User profile -> Own Data
05-23-2012 2:08 PM
Hi,
thanks for the answer but I want to use dec.
I think the problem in my case is that I try to move a value of type FLTP into a variable of type DEC.
The error happened at this point.
How can I convert a FLTP type into a DEC type?
Regards
05-23-2012 2:45 PM
Hi ,
I am not exactly sure but you can try
CONVERSION_EXIT_ALPHA_INPUT'
05-23-2012 2:49 PM
Hi all,
I found the error by myself.
I have mapped a dec with 2 decimal places in a variable of type dec with zero decimal places.
Regards
05-23-2012 2:49 PM
dec_field = 0 + fltp_field. will give you a conversion. If not, try:
data: p_field(15) type p decimals nn. "however many you need.
p_field = 0 + fltp_field.
dec_field = p_field.
remember that DEC field length is set for the number, with the decimals implied. A value of 3312345678923 might thus display as 33,123,456,789.23, etc. So when you have a DEC or CURR, you need more output space to display than to store, obviously, with 13 digits often requiring 17 spaces of output, and so on. This is a consideration for reporting, especially.