Skip to Content
0
Former Member
Dec 18, 2006 at 10:13 AM

cl_gui_alv_grid: Display Zero-Values with 3 decimals digits

124 Views

Hi everybody,

<b>This is the problem:</b>

I need to display quantities with 3 decimals.

This works fine, but only if there are decimal values:

(123.001) but not, if the figure is zero or doesn't have any decimals.

(123 or 0)

But the customer wants to get the figures shown as follows:

123.000

123.001

0.000

<b>REMARK:</b>

If I use FM: call function 'REUSE_ALV_GRID_DISPLAY' it works fine!

<b>These are my settings:</b>

The field <BTGEW> is defined as quantity.

LOOP AT ct_fcat INTO ls_fcat.

ls_fcat-edit = false.

CASE ls_fcat-fieldname.

WHEN 'BTGEW' .

ls_fcat-decimals_o = 3.

ls_fcat-no_zero = false.

ls_fcat-outputlen = '15'.

ls_fcat-do_sum = true.

ls_fcat-qfieldname = 'GEWEI'.

ls_fcat-tabname = 'ZWIT02_AUS_LFK_CNTRL'.

  • clear: ls_fcat-tabname,

  • ls_fcat-qfieldname.

  • ls_fcat-datatype = 'DEC'.

  • ls_fcat-edit_mask = '____________,___'.

</b>

Thanks a lot in advance for your help

Michael<b></b>