on 11-09-2016 4:46 AM
Hello,
I'm trying to cast a DF34_DEC type to CHAR or DECIMAL as the values appear in scientific notation for initial value (0E -12), but run into compile time errors.
Is this not supported yet? Please let me know if there is an alternate/better way.
Options used - CAST & fltp_to_dec()
Thanks!
Regards,
Shakul.
See my blog https://blogs.sap.com/2016/11/03/abap-news-for-release-7.51-floating-points-in-open-sql-and-abap-cds.... There are some remarks about decfloats.
Horst
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've fixed the link.
I pushed both casting operations through TO_DECIMAL( ) and SUM into a table function(AMDP) and it worked. Just in case someone wants to know a work-around for DECFLOAT types.
Regards,
Shakul.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do the type have a conversion routine? If yes, can you use it to convert it to internal format? Afterwards it should be easy to convert the value to a decimal or string (characters), if still needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the use case of casting a decfloat34 to characters? But do you really mean ASSIGN df34 TO <c> CASTING? Or are you talking about explicit type conversion df34 to characters?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sandra,
like I have mentioned, the initial values for DF34_DEC come up as 0E -12 which is not user friendly on the UI. I have even tried to cast using the function FLTP_TO_DEC( ) to cast this to DECIMAL, but that doesn't seem to work either.
By casting I mean, using the keyword CAST in ABAP CDS or the CDS built-in function FLTP_TO_DEC( ).
Regards,
Shakul.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.