Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV - Decimals

Former Member
0 Likes
742

Hi,

I am using ALV for report display.

I have declare a variable X with data type DEC with 2 decimals.

I want to ouptut this field with no decimals. How?

Thanks & regards,

Esther

1 ACCEPTED SOLUTION
Read only

arpit_shah
Contributor
0 Likes
720

check in field catalog,

e.g.

LS_CAT-FIELDNAME = 'VAL6'.

LS_CAT-TABNAME = 'ZTAB'.

LS_CAT-SELTEXT_M = 'June'.

LS_CAT-JUST = 'R'.

LS_CAT-DECIMALS_OUT = 0.

LS_CAT-NO_ZERO = 'X'.

APPEND LS_CAT TO FC_DC.

CLEAR LS_CAT.

Hi,

I am using ALV for report display.

I have declare a variable X with data type DEC with 2 decimals.

I want to ouptut this field with no decimals. How?

Thanks & regards,

Esther

5 REPLIES 5
Read only

Former Member
0 Likes
720

check the options in Fieldcatalog..

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
720

just try fieldcat-decimals_out = 0.

Read only

Former Member
0 Likes
720

Pls give example on this. Thanks

Read only

0 Likes
720

hi

type-pools: slis.

DATA: begin of itab6 occurs 0,

chk type c,

a type p decimals 2,

b type p decimals 2,

c type c,

end of itab6.

data: ls_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,

wa_layout TYPE slis_layout_alv.

itab6-a = '1.12'.

itab6-b = '2.25'.

itab6-c = '+'.

append itab6.

append itab6.

append itab6.

append itab6.

ls_fieldcat-fieldname = 'A'.

ls_fieldcat-seltext_m = 'A'.

append ls_fieldcat.

ls_fieldcat-fieldname = 'B'.

ls_fieldcat-seltext_m = 'B'.

ls_fieldcat-decimals_out = 0.

append ls_fieldcat.

ls_fieldcat-fieldname = 'C'.

ls_fieldcat-seltext_m = 'C'.

append ls_fieldcat.

wa_layout-box_tabname = 'ITAB6'.

wa_layout-box_fieldname = 'CHK'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-repid

it_fieldcat = ls_fieldcat[]

IS_LAYOUT = wa_layout

TABLES

t_outtab = itab6[].

Read only

arpit_shah
Contributor
0 Likes
721

check in field catalog,

e.g.

LS_CAT-FIELDNAME = 'VAL6'.

LS_CAT-TABNAME = 'ZTAB'.

LS_CAT-SELTEXT_M = 'June'.

LS_CAT-JUST = 'R'.

LS_CAT-DECIMALS_OUT = 0.

LS_CAT-NO_ZERO = 'X'.

APPEND LS_CAT TO FC_DC.

CLEAR LS_CAT.