Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to make my header in ALV left justified

Hello experts,

I am using ALV_GRID_DISPLAY and I noticed that my header is not fully displayed on the left side. How can I make it as such? anyway, here is my header code. Again, thank you guys and have a nice day!

FORM top_of_page.

*ALV Header declarations

DATA: t_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader,

t_line LIKE wa_header-info,

lv_title(60),

lv_user(60),

lv_date(10),

lv_time(10),

lv_time_n_date(30),

lv_dlr_n_desc(100),

ld_lines TYPE i,

ld_linesc(10) TYPE c.

  • Title

CLEAR: lv_title, wa_header.

MOVE sy-title TO lv_title.

wa_header-typ = 'H'.

wa_header-info = lv_title.

APPEND wa_header TO t_header.

CLEAR wa_header.

  • User

CLEAR: lv_user, wa_header.

CONCATENATE: 'Generated by:' sy-uname

INTO lv_user SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = lv_user.

APPEND wa_header TO t_header.

CLEAR wa_header.

*Date and time

CLEAR: lv_date, lv_time.

WRITE: sy-datum TO lv_date MM/DD/YYYY,

sy-uzeit TO lv_time USING EDIT MASK '__:__:__'.

CONCATENATE: 'Generated on:' lv_date lv_time

INTO lv_time_n_date SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = lv_time_n_date.

APPEND wa_header TO t_header.

CLEAR wa_header.

*Dealer code and description

CONCATENATE: 'Dealer:' p_dcode p_name1

INTO lv_dlr_n_desc SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = lv_dlr_n_desc.

APPEND wa_header TO t_header.

CLEAR wa_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = t_header.

ENDFORM. " TOP_OF_PAGE

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question