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: 

ALV classes - header

Former Member
0 Kudos

Hello all,

I have a ALV report using classes and methods. I want to include header details (Top-of_page) to this report. Sample codes, suggestions appreciated.

Thanks

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Vijay's blog will walk you thru the entire process.

/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid

Regards,

RIch Heilman

Former Member
0 Kudos

perform top-of-page.

--


DECLARATION OF HEADER--

form top-of-page.

DATA: T_HEADER TYPE SLIS_T_LISTHEADER,

WA_HEADER TYPE SLIS_LISTHEADER,

t_line like wa_header-info,

ld_lines type i,

ld_linesc(10) type c.

--


TEXT AT HEADER--

WA_HEADER-TYP = 'H'.

WA_HEADER-INFO = 'REPORT FOR : '.

APPEND WA_HEADER TO T_HEADER.

CLEAR WA_HEADER.

WA_HEADER-TYP = 'S'.

WA_HEADER-INFO = 'MATERIAL DETAILS,'.

APPEND WA_HEADER TO T_HEADER.

CLEAR WA_HEADER.

WA_HEADER-TYP = 'S'.

WA_HEADER-INFO = 'PURCHASE ORDER DETAILS,'.

APPEND WA_HEADER TO T_HEADER.

CLEAR WA_HEADER.

WA_HEADER-TYP = 'S'.

WA_HEADER-INFO = 'SALES ORDER DETAILS.'.

APPEND WA_HEADER TO T_HEADER.

CLEAR WA_HEADER.

WA_HEADER-TYP = 'A'.

WA_HEADER-INFO = 'GENERATED BY : SINDIRI SAIKIRAN '.

APPEND WA_HEADER TO T_HEADER.

CLEAR WA_HEADER.

--


DATE--

WA_HEADER-TYP = 'S'.

WA_HEADER-KEY = 'Date: '.

CONCATENATE SY-DATUM+6(2) '.'

SY-DATUM+4(2) '.'

SY-DATUM(4) INTO WA_HEADER-INFO. "TODAYS DATE

APPEND WA_HEADER TO T_HEADER.

CLEAR: WA_HEADER.

WA_HEADER-TYP = 'H'.

WA_HEADER-INFO = ''.

APPEND WA_HEADER TO T_HEADER.

CLEAR WA_HEADER.

--


TO GET TOTAL NO OF RECORDS--

DESCRIBE TABLE I_OUT LINES LD_LINES.

LD_LINESC = LD_LINES.

CONCATENATE 'Total No. of Records Selected: ' LD_LINESC

INTO T_LINE SEPARATED BY SPACE.

WA_HEADER-TYP = 'A'.

WA_HEADER-INFO = T_LINE.

APPEND WA_HEADER TO T_HEADER.

CLEAR : WA_HEADER, T_LINE.

--


TO GET LOGO AT TO-OF-PAGE--

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

I_LOGO = 'MIRACLE22_LOGO'

IT_LIST_COMMENTARY = T_HEADER.

ENDFORM. "TOP-OF-PAGE

<b>reward points if useful</b>