Skip to Content
0
Former Member
Sep 19, 2011 at 04:35 AM

Negative sign display for CURR field in ALV grid report

1475 Views

I have a field BETRG defined as CURR field of length 15, decimal places 2. The value may be negative or positive. In case of negative values I am using EDIT_MSK option in the field catalog to bring the negative sign to the left of the value as shown below.

Quote

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'LT_FINAL'

i_inclname = sy-repid

CHANGING

ct_fieldcat = fieldcat[]

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

LOOP AT fieldcat.

CASE fieldcat-fieldname.

WHEN 'BETRG'.

fieldcat-ctabname = ' '.

fieldcat-cfieldname = ' '.

fieldcat-edit_mask = 'RRV_______________.__'.

ENDCASE.

MODIFY fieldcat.

ENDLOOP.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_buffer_active = 'X'

i_callback_program = sy-repid

i_grid_title = 'ABCD'

is_layout = gs_layout

it_fieldcat = fieldcat[]

i_save = 'A'

is_variant = gs_save

it_events = gs_events

TABLES

t_outtab = lt_final

EXCEPTIONS

program_error = 1

OTHERS = 2.

Unquote

On displaying the report using 'REUSE_ALV_GRID_DISPLAY' as shown above, when the value of BETRG is a smaller number like say 624, then the ALV output appears as '- 624.00' instead of '-624.00'.

Is there any way that I can remove the space in between the negative sign and the number before displaying the ALV output using 'REUSE_ALV_GRID_DISPLAY'?