04-24-2019 11:33 AM
Hi All,
I have one small doubt.
Can anyone please help me to understand the maximum possible values for No. of characters :13, Dec: 3
and Output len:17.
Because, I am facing the dump issue.
Waiting for the quicker response.
Thanks
04-24-2019 11:59 AM
Just did a simple test with a DEC 13 Dec 2 and it looks like 13 characters including decimals. So max 11 before decimals. In your case I think that would be max 10 before the decimals.
04-24-2019 11:59 AM
Just did a simple test with a DEC 13 Dec 2 and it looks like 13 characters including decimals. So max 11 before decimals. In your case I think that would be max 10 before the decimals.
04-24-2019 12:10 PM
Hi Arthur,
Thanks for your response.
So you are saying like this may be the possible value - 1234567890.99
If I am correct, for this one, what may be the output length. If wrong please correct me.
04-24-2019 12:09 PM
Hello Karthick,
The output length is calculated on the values, the decimal sign, the negative sign (if any) and also the thousands separaters.
:13, Dec: 3 and Output len:17.
Example for the a variable on the type that you declared, in your case with no sign negative values allowed you will have : 1,234,567,890.123
04-24-2019 12:28 PM
The value would be 12345678901.99 for my test. For yours it would probably be 1234567890.999 As for the output length see the answer from Deenesh Ramrekha.
04-25-2019 5:35 AM
Hello Karthick,
Output length is dependent upon the data type that being used .
if you are using the curr type then No of characters = sign + 11 digits + dot/comma
Decimal = number of decimals
type CURR has min Value = -99999999999.99
If you are using type as P then value range: (-10^(2len-1) +1) / (10^(+dec)) to (+10^(2len-1) -1) /(10^(+dec)) in increments of 10^(-dec)
You can use the below code to check the max and min value for any type
DATA: pack TYPE p LENGTH 15 DECIMALS 2,
result TYPE REF TO data.
FIELD-SYMBOLS <result> TYPE ANY.
result = cl_abap_exceptional_values=>get_min_value( pack ).
IF result IS NOT INITIAL.
ASSIGN result->* TO <result>.
cl_demo_output=>write_data( <result> ).
ENDIF.
result = cl_abap_exceptional_values=>get_max_value( pack ).
IF result IS NOT INITIAL.
ASSIGN result->* TO <result>.
cl_demo_output=>write_data( <result> ).
ENDIF.
cl_demo_output=>display( ).