Quantcast
Viewing all articles
Browse latest Browse all 3132

Re: ALV column with variable number of decimals to be displayed

Hello Jordi

 

The field that you use to indicate the decimals is the wrong type, you most likely defined it as an integer which would make sense but the ALV grid has a bug in it in the sense that it ignores your decimal field when it is initial (for integer fields this would be zero). As an example:

 

BEGIN OF mty_s_data,

         amount TYPE betrg,

         currency TYPE waers,

         decimals TYPE int4,          "<== This will not work since zero is seen as initial.

END OF mty_s_data,

 

Anyway define your decimal field to be a char type, e.g. char5, and then use it again. Zero would now be seen as non-initial and the ALV grid will use it to format your data. Example correct usage to work around ALV bug:

 

BEGIN OF mty_s_data,

         amount TYPE betrg,

         currency TYPE waers,

         decimals TYPE c LENGTH 5,

END OF mty_s_data,

 

Good luck, Ettienne


Viewing all articles
Browse latest Browse all 3132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>