‎2010 Jul 08 7:43 AM
Hi,
I want to add Header in my ALV report and i used the function module 'REUSE_ALV_COMMENTARY_WRITE' but its not displaying the header in the Output. I used the Coding as:
data :lt_top_of_page type slis_t_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = lt_top_of_page
I_LOGO = 'Test ALV Header'
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
Any Suggestions would be really helpful.
Manoj
‎2010 Jul 08 7:56 AM
Hi,
Pass the sy-repid in the Resue_ALV_GRID_DISPLAY.
With Regards,
Sumodh.P
‎2010 Jul 08 8:07 AM
I have already pass the sy-repid in function module 'REUSE_ALV_GRID_DISPLAY'.
Manoj
‎2010 Jul 08 8:12 AM
Hello
data :lt_top_of_page type slis_t_listheader. " <- here you declare lt_top_of_page type
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = lt_top_of_page " <- here you pass EMPTY lt_top_of_page type
I_LOGO = 'Test ALV Header'
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
.
You pass empty structure to function. You need to fill this like:
data :lt_top_of_page type slis_t_listheader.
data: ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = 'Write anything here'.
APPEND ls_line TO top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = lt_top_of_page
I_LOGO = 'Test ALV Header'
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
.
‎2010 Jul 08 8:15 AM
‎2010 Jul 08 10:06 AM
Hi ,
Use lt_top_of_page[].
Just try this.
With Regards,
Sumodh.P
‎2010 Jul 08 1:29 PM
HI Manoj
check below code
FORM TOP_OF_PAGE.
DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER,
T_LINE LIKE WA_HEADER-INFO,
LD_LINES(10) TYPE C.
*LD_LINESC(10) TYPE C.
REFRESH T_HEADER.
*Title.
WA_HEADER-TYP = 'H'.
WA_HEADER-KEY = ''.
WA_HEADER-INFO = V_REPID.
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.
DESCRIBE TABLE ITAB LINES LD_LINES.
LD_LINESC = LD_LINES.
CONCATENATE 'Total No. of Records Selected: ' LD_LINES
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.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
ENDFORM.
here I have made a form for top of page and then passed this form name into grid display as below.
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
in your case your table IT_LIST_COMMENTARY is empty, so you need to fill it like I have filled in my form.
I hope this will work for you.
Thanks
Lalit Gupta