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

FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

Former Member
0 Likes
9,520

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

6 REPLIES 6
Read only

Former Member
0 Likes
3,349

Hi,

Pass the sy-repid in the Resue_ALV_GRID_DISPLAY.

With Regards,

Sumodh.P

Read only

0 Likes
3,349

I have already pass the sy-repid in function module 'REUSE_ALV_GRID_DISPLAY'.

Manoj

Read only

0 Likes
3,349

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 =
.

Read only

0 Likes
3,349
Read only

Former Member
0 Likes
3,349

Hi ,

Use lt_top_of_page[].

Just try this.

With Regards,

Sumodh.P

Read only

Former Member
0 Likes
3,349

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