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 NAME

Former Member
0 Kudos

Hi All,

Does anybody know how can I change a ALV´s column name?.

I have made my alv report but i wold like to change the name of one column and haven´t been able to do it.

Thanks for youir help

Gabriel P.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

In you fieldcat internal table , modify the field FIELDCAT-REPTEXT_DDIC for the column which you want to change the column name before calling the ALV FM.

Cheers.

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

HI,

Try modifying your field catalog internal table before passing it to the list display FM.

Thanks,

Ravi

Former Member
0 Kudos

Hi ,

In you fieldcat internal table , modify the field FIELDCAT-REPTEXT_DDIC for the column which you want to change the column name before calling the ALV FM.

Cheers.

Former Member
0 Kudos

Hi,

if you are using <b>FM REUSE_ALV_GRID_DISPLAY</b> then change your field_catalog....

fc_tmp-reptext_ddic = 'COMPANY CODE'. " here you need to type column name what you want

fc_tmp-fieldname = 'BUKRS'. " here you need to type field name of the table.




form write_report.
  perform build_field_catalog.
  perform build_sort.
* CALL ABAP LIST VIEWER (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            it_fieldcat = fieldcat
            it_sort     = sort

       TABLES
            t_outtab    = itab.


endform.

**********************************************************
*BUILD_FIELD_CATALOG
**********************************************************
form build_field_catalog.
  data: fc_tmp type slis_t_fieldcat_alv with header line.
  clear: fieldcat.
  refresh: fieldcat.
  clear: fc_tmp.
  fc_tmp-reptext_ddic    = 'COMPANY CODE'.
  fc_tmp-fieldname  = 'BUKRS'.
  fc_tmp-tabname   = 'ITAB'.
  fc_tmp-outputlen  = '8'.
  fc_tmp-col_pos    = 2.
  append fc_tmp to fieldcat.
  clear: fc_tmp.
  fc_tmp-reptext_ddic    = 'VENDOR NUMBER'.
  fc_tmp-fieldname  = 'LIFNR'.
  fc_tmp-tabname   = 'ITAB'.
  fc_tmp-outputlen  = '8'.
  fc_tmp-col_pos    = 2.
  append fc_tmp to fieldcat.

ENDFORM.

**********************************************************

reward points for helpfull answers and close the thread if your question is solved.

regards,

venu.

0 Kudos

Fill or modify these fields of the fieldcat before calling the ALV grid.

ls_fcat-scrtext_l = 'My long text for column'.

ls_fcat-scrtext_m = 'My medium text'.

ls_fcat-scrtext_s = 'Short txt'.

Srinivas