Application Development 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: 

ALV Column Heading as Bold

Former Member
0 Kudos


Hi all,

How can we make the column heading as Bold.

I searched in SCN but couldnot find any required solution.

e.g. This is my ALV grid output screen.

Here i want to change the 'Material' to Bold.

How to do this, please guide.

Regards,

Munu

6 REPLIES 6

Former Member
0 Kudos

Hi Munu,

I know that you can make the whole column bold easily by using emphasize in field catalog or layout.

Please refer to the link below to make only the column header bold:

SAP-ABAP Technical: Alv with header in bold

Regards,

Ashvin

former_member201275
Active Contributor
0 Kudos

In my opinion i don't think this is currently possible.

0 Kudos

I am with Glen, not possible.

raphael_almeida
Active Contributor
0 Kudos

Hi Munu,

You can bold a column passing on parameter "is_layout" values what you want, below a sample statement example:

  gt_layout-no_input= 'X'.

  gt_layout-colwidth_optimize = 'X'.

  gt_layout-coltab_fieldname = 'CELLCOLOR'.


DATA: WA_CELLCOLOR TYPE LVC_S_SCOL.


  LOOP AT "YOUR_ITAB" INTO "YOUR_WORKAREA".

    WA_CELLCOLOR-FNAME = 'COLUMN'.

    WA_CELLCOLOR-COLOR-COL = sy-tabix.

    WA_CELLCOLOR-COLOR-INT = '1'.  "1 = Intensified on, 0 = Intensified off

    WA_CELLCOLOR-COLOR-INV = '0'.  "1 = text colour, 0 = background colour

    APPEND WA_CELLCOLOR TO "YOUR_WORKAREA".

    MODIFY "YOUR_ITAB" from "YOUR_WORKAREA" INDEX SY-TABIX TRANSPORTING CELLCOLOR.

ENDLOOP.

Regards

0 Kudos

Hi Raphael,

I tried but nothing is changing. below is de source code

TYPE-POOLS : slis.

TYPES: BEGIN OF ty_str.

       
INCLUDE TYPE zq1_ftp.

       
INCLUDE TYPE lvc_s_scol.

TYPES:END OF ty_str.

DATA : field_cat TYPE TABLE OF slis_fieldcat_alv ,
wa_field_cat
TYPE slis_fieldcat_alv,

       itab
TYPE TABLE OF ty_str,

       wa
TYPE ty_str.

DATA fs_layout TYPE slis_layout_alv.


*START-OF-SELECTION.

SELECT * FROM zq1_ftp

 
INTO CORRESPONDING FIELDS OF TABLE itab.


PERFORM build_fcat.

fs_layout-no_input =
'X'.

fs_layout-colwidth_optimize =
'X'.

fs_layout-coltab_fieldname =
'CELLCOLOR'.


DATA: wa_cellcolor TYPE lvc_s_scol.


LOOP AT itab INTO wa.

  wa_cellcolor-fname =
'NAME'.

  wa_cellcolor-
color-col = sy-tabix.

  wa_cellcolor-
color-int = '1'"1 = Intensified on, 0 = Intensified off

  wa_cellcolor-
color-inv = '0'"1 = text colour, 0 = background colour

*    APPEND WA_CELLCOLOR TO wa.

 
MOVE-CORRESPONDING wa_cellcolor TO wa.

 
MODIFY itab FROM wa INDEX sy-tabix TRANSPORTING color.

ENDLOOP.


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

 
EXPORTING

    i_callback_program = sy-repid

    i_grid_title       =
'Grid Program'

    is_layout          = fs_layout

    it_fieldcat        = field_cat

 
TABLES

    t_outtab           = itab

 
EXCEPTIONS

    program_error      =
1

   
OTHERS             = 2.

FORM build_fcat.

  wa_field_cat-fieldname =
'STUDNO'.

  wa_field_cat-
key = 'X'.

  wa_field_cat-fix_column =
'X'.

  wa_field_cat-seltext_m =
'Student No.'.

 
APPEND wa_field_cat TO field_cat.

 
CLEAR wa_field_cat.

  wa_field_cat-fieldname =
'NAME'.

  wa_field_cat-seltext_m =
'NAME'.

 
APPEND wa_field_cat TO field_cat.

 
CLEAR wa_field_cat.

  wa_field_cat-fieldname =
'COUNTRY1'.

  wa_field_cat-seltext_m =
'COUNTRY'.

 
APPEND wa_field_cat TO field_cat.

 
CLEAR wa_field_cat.

ENDFORM.                    "build_fcat

Regards,

Munu

0 Kudos

This is not going to work anyway. Your requirement is to "bold" the header, whereas the proposed code is to "bold" a column so why are you even trying this?