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: 

Reuse_alv_grid_display change default column header

former_member221827
Active Participant
0 Kudos
1,559

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.

1 ACCEPTED SOLUTION

Juwin
Active Contributor
0 Kudos
208

Your modify statement is missing reptext_ddic addition. Also, populate ddictxt field as 'L' in the field catelog.

Thanks,

Juwin

1 REPLY 1

Juwin
Active Contributor
0 Kudos
209

Your modify statement is missing reptext_ddic addition. Also, populate ddictxt field as 'L' in the field catelog.

Thanks,

Juwin