Skip to Content
0
Former Member
Dec 06, 2006 at 01:29 PM

Editing Decimals in ALV Grid

290 Views

Good Morning,

I've created a report using:

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            i_callback_program       = gd_repid
            i_callback_pf_status_set = 'SET_PF_STATUS'
*            i_callback_top_of_page   = 'ESCREVE_TOP'
            i_callback_user_command  = 'USER_COMMAND'
*            i_grid_title           = outtext
            is_layout                = gd_layout
            it_fieldcat              = fieldcatalog[]
*            it_special_groups      = gd_tabgroup
*            IT_EVENTS              = GT_XEVENTS
            i_save                   = 'X'
*            is_variant             = z_template

       TABLES
            t_outtab                = t_grid
       EXCEPTIONS
            program_error           = 1
            OTHERS                  = 2.

The last field shown in the grid is a currency field which i've defined this way:

DATA: w_zconst  TYPE zconst.

DATA: BEGIN OF w_grid,
      ...
      hslvt      LIKE w_zconst-hslvt,
      ...
END OF w_grid.

The w_zconst-hslvt is a CURR 17 with 2 Decimals.

All the fields in the grid are editable, but when i try to edit the currency field for example which is displayed with value 52.951,86 and i change it to 52.000,50 i receive an error message (DB739) saying that i cannot insert decimals since the number max of decials is 0... How can this be?

The definition for the field in the catalog is:

    fieldcatalog-fieldname   = 'HSLVT'.
    fieldcatalog-tabname     = 'T_GRID'.
    fieldcatalog-seltext_m   = text-hd5.
    fieldcatalog-col_pos     = 5.
    fieldcatalog-edit        = 'X'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR  fieldcatalog.

What can be wrong?

Best Regards,

Pedro Gaspar