Hi
I'm having difficulty getting the default column header of an alv grid to display correctly. When the alv grid is first displayed the column header is being pulled from the ddic for data element EMNAM of field ENAME in structure ZSCR_INCOMING_PO.
After shrinking the column the heading displayed is correctly shown from the list of seltext entries below in code. I'm imagining it's a fieldcat option I'm missing, but I haven't been able to find it in my searching of SCN and trial or trial and error.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
* I_PROGRAM_NAME =
i_internal_tabname = g_tabname_header
i_structure_name = 'ZSCR_INCOMING_PO'
* I_CLIENT_NEVER_DISPLAY = 'X'
CHANGING
ct_fieldcat = e01_lt_fieldcat[].
READ TABLE e01_lt_fieldcat INTO ls_fieldcat
WITH KEY fieldname = 'ENAME'.
IF sy-subrc EQ 0.
ls_fieldcat-seltext_s = 'Emp Resp'.
ls_fieldcat-seltext_m = 'Employee Responsible'.
ls_fieldcat-seltext_l = 'Employee Responsible'.
ls_fieldcat-reptext_ddic = 'Employee Responsible'.
MODIFY e01_lt_fieldcat FROM ls_fieldcat INDEX sy-tabix
TRANSPORTING seltext_s seltext_m seltext_l.
ENDIF.