Currency CURR type with more than 2 decimals – ALV output
I just realized how to use CURR type with more than 2 decimals.
I created a DOMAIN with Data Type CURR and 8 decimal places. Look at what happens at SE16N Details:
Value on right (Value Unconverted) is the real values on table with 8 decimals, and values on LEFT are showing on any ALV Output (SE16, SE16N or any ALV report). There is NO Conversion Routine at the Domain, only standard CURR type.
I could set DECIMALS on SALV using CL_SALV_COLUMN->SET_DECIMALS( ‘8’ ), but it will only add ZEROS
Ex for first line in table, TOTFRDOC will show 11,006,361.60000000 instead of 11.00636160.
Yes, you may use CURR type with more than 2 decimals, knowing that this output conversion will happens.
So when use it?? If you want your CURR value converted to percentage (as a rate) usually using 4 decimals. Example:
Value unconverted: 0.6160
Output will show as percentage 61.60
Out of curiosity…
I could fix my domain using DataType DEC instead. My ALV outputs are now showing right values with 8 decimals.