Application Development and Automation 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: 
Read only

header in alv

Former Member
0 Likes
636

How to give header title in alv reports onther than using text element. Pls help

How to give header title in alv reports onther than using text element. Pls help

4 REPLIES 4
Read only

Former Member
0 Likes
604

Using FM REUSE_ALV_COMMENTARY_WRITE,

you need to pass the info to that, it will write give the header. you need to call in top_of_page event..

regards

vijay

Read only

Former Member
0 Likes
604

Hi Nag,

Assign the string to the variable and then pass this variable to the itab where you will be keeping header information. Pleas find below sample code for this.

Hope This Info Helps YOU.

<i>Reward Points If It Helps YOU.</i>

Regards,

Raghav


st1 = 'Hi'.
WRITE sy-datum to v_date. .
  CLEAR ls_line.
  ls_line-typ  = 'H'.
  ls_line-info = st1 .
  APPEND ls_line TO lt_top_of_page.
* Kopfinfo: Typ S
  CLEAR ls_line.
  ls_line-typ = 'S'.
  CONCATENATE 'DATE:   ' v_date  into ls_line-info.
append ls_line to lt_top_of_page.

Read only

Former Member
0 Likes
604

Hi,

Look at my code.....

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

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = i_repid

  • i_callback_user_command = 'USER_COMMAND_PERNR'

it_fieldcat = header

is_layout = gt_layout

i_callback_top_of_page = 'TOP-OF-PAGE1'

i_grid_title = xyz

it_sort = gt_sort[]

i_default = 'X'

i_save = 'U'

is_variant = gt_variant

it_events = gt_events

tables

t_outtab = t_output.

clear t_output.

----


  • Form TOP-OF-PAGE1

----


form top-of-page1.

data: header type slis_t_listheader,

wa type slis_listheader. "infield like wa-info, nline type n.

  • TITLE AREA

wa-typ = 'S'.

wa-info = text-h04."give TITLE here.

append wa to header.

wa-typ = 'S'. "Date

write sy-datum to wa-info mm/dd/yyyy.

concatenate text-h03 wa-info into wa-info separated by space.

append wa to header.

wa-typ = 'S'. "User ID

concatenate text-h02 sy-uname into wa-info separated by space.

append wa to header.

wa-typ = 'S'."Prog name

concatenate text-h01 sy-repid into wa-info separated by space.

append wa to header.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = header

i_logo = 'ENJOYSAP_LOGO'.

endform.

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

Here you will get Prog name, User ID, Date and LOGO.

Thanks.

If this helps u reward with points.

Message was edited by: Deepak333 k

Read only

Former Member
0 Likes
604

Hi Nagarajan,

Change wording of the title (simple, two-dimensional table and hierarchical-sequential list) -- <b>SET_LIST_HEADER</b>

Change wording of the title (tree structure) -- <b>SET_HEADER</b>

Change Font Size of the Title -- <b>SET_LIST_HEADER_SIZE</b>.

Hope this helps u,

Regards,

Nagarajan.