Showing results for 
Search instead for 
Did you mean: 

Conversion routine to convert integer to custom string

Hello! I am creating the conversion routine to convert custom domain with INT4 datatype to string that I would use for displaying in Web Dynpro DropDownByKey. I have the mapping defined in a user defined database table. So for example lets say I want to convert 1000 to 'Random description'. In my Conversion routine I have the following code

SELECT text FROM my_db_table INTO output WHERE id = input

And that "works", but the problem is that I get wrong size. As output I only get up to 14 characters, while in the database I have 40 characters as text. I tracked down the error to the built in method convexit_to_string, line 29. There is a call to cl_wdr_conversion_utils=>output_length_rtti method that calculates the maximum output length using datatype of the domain. Since my input is integer datatype I get 14 as output length in the line 28. Then it creates the output variable with the length 14, and that is why I can't get correct result.

I also tried defining the output characteristics of my domain, setting the output length to 40, but it didn't help, it still gave me 14 (I would assume in output_length_rtti method that output length takes effect only in line 53, but I am out of that function in line 30)

How can I fix this

Accepted Solutions (0)

Answers (0)