cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the column heading in the ALV table

0 Kudos

Hi Experts,

I have a ALV table with column BELKZ from PRPS table. Now my column heading is coming as BELKZ using

SALV in Web Dynpro.

I want to set my column heading as Account assignment.

In other words how do i set the custom column heading in ALV table.

Please help.

Regards,

Chitrasen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
* Get columns
DATA: lt_columns TYPE salv_wd_t_column_ref ,
        ls_columns TYPE salv_wd_s_column_ref .

DATA: l_column_header  TYPE REF TO cl_salv_wd_column_header .

lt_columns = l_column_settings->get_columns( )              .

LOOP AT lt_columns INTO ls_columns                          .
CASE ls_columns-id                                        .

WHEN 'BELKZ'.
        l_column_header = ls_columns-r_column->get_header( )  .
        l_column_header->set_ddic_binding_field(
           if_salv_wd_c_column_settings=>ddic_bind_none )     .
        l_column_header->set_text( 'column Title' )                    .
ENDCASE

.

ENDLOOP.

Answers (1)

Answers (1)

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Use the below code.

data : lo_column_setting type ref to if_salv_wd_column_settings,

LO_COLUMN TYPE REF TO CL_SALV_WD_COLUMN,

LO_HEADER TYPE ref to cl_salv_wd_column_header.

lo_column = lo_column_setting->get_column( 'USERID' ).

CALL METHOD lo_column->CREATE_HEADER

RECEIVING

VALUE = LO_HEADER.

CALL METHOD LO_HEADER->SET_TEXT

EXPORTING

VALUE = 'User Id'.

Regards,

Priya

Former Member
0 Kudos

Hi,

You will also need to call below method before using set_text to deactivate DDIC header.

lo_header->set_ddic_binding_field( ).

Thanks,

Feroz

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I think its not mandatory to call the method to deactivate DDIC heading .

I used only SET_TEXT.

didnt use lo_header->set_ddic_binding_field( ).

it worked fine.

Regards,

Priya