10-20-2005 4:22 PM
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.
10-20-2005 4:25 PM
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.
10-20-2005 4:25 PM
HI,
Try modifying your field catalog internal table before passing it to the list display FM.
Thanks,
Ravi
10-20-2005 4:25 PM
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.
10-20-2005 5:19 PM
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.
10-20-2005 5:43 PM
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