Skip to Content
author's profile photo Former Member
Former Member

ALV Grid top of page

HI All,

I want to display some text on top of my grid. For that I am using 'REUSE_ALV_COMMENTARY_WRITE' function & writing a subroutine 'TOP_OF_PAGE'. In that passing

it_list_commentary = header. Header is having that text I want to display. And finally passing it at 'REUSE_ALV_GRID_DISPLAY' IT_EVENTS = xt_events.

But that top of page text is not comming.

What I am missing?

Regards,

Dilip

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    Posted on Jun 14, 2005 at 08:14 AM

    Hi,

    See the smaple code

    call function 'REUSE_ALV_GRID_DISPLAY'

    exporting

    i_callback_program = gd_repid

    i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

    is_layout = gd_layout

    it_fieldcat = fieldcatalog[]

    i_save = 'X'

    tables

    t_outtab = it_ekko

    exceptions

    program_error = 1

    others = 2.

    ----


    • Form TOP-OF-PAGE *

    ----


    • ALV Report Header *

    ----


    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,

    ld_lines type i,

    ld_linesc(10) type c.

    • Title

    wa_header-typ = 'H'.

    wa_header-info = 'EKKO Table Report'.

    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.

    • Total No. of Records Selected

    describe table it_ekko 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.

    call function 'REUSE_ALV_COMMENTARY_WRITE'

    exporting

    it_list_commentary = t_header.

    • i_logo = 'Z_LOGO'.

    endform.

    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_rephead.htm

    Add a comment
    10|10000 characters needed characters exceeded

    • Ya that is what i also mentioned in my previous reply ask them to reinstall and check or u can run this program in some other system and check.

      In my system too i have this problem, I tried in other system and found that to be working fine.

      I can see the text

      <b>Displaying selected materials details</b> in the top of page in big font size.

      Please close this thread if ur problem got solved.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 14, 2005 at 06:21 AM

    Hi,

    Please have a look at the program 'BALVST03_GRID' (or any program starting with 'BALV*'for that matter)to understand how TOP_OF_PAGE has been called,

    Hope this helps.

    Rgds,

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 14, 2005 at 06:27 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 14, 2005 at 06:57 AM

    Hi,

    First please check whether u have given the event/form name inside the quotes in CAPITAL. This may also be a problem.

    Regs,

    Venkat Ramanan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 15, 2005 at 09:06 AM

    hi,

    Just follow the simple steps which areexplained witht he code.

    1. define your header data

    DATA: gs_line TYPE slis_listheader,

    i_header TYPE slis_t_listheader.

    CLEAR: gs_line.

    gs_line-typ = 'H'.

    gs_line-info = text-009.

    APPEND gs_line TO i_header.

    CLEAR: gs_line.

    gs_line-typ = 'S'.

    gs_line-key = 'Month'.

    gs_line-info = p_month.

    APPEND gs_line TO i_header.

    2. Define the events for the top-of-page

    DATA: line_event TYPE slis_alv_event,

    i_events TYPE slis_t_event.

    CLEAR line_event.

    line_event-name = 'TOP_OF_PAGE'.

    line_event-form = 'F4200_TOP_OF_PAGE'.

    APPEND line_event TO i_events.

    3. defien the form as specified in the above event defintion.

    FORM f4200_top_of_page.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    i_logo = 'ENJOYSAP_LOG'

    it_list_commentary = i_header.

    ENDFORM.

    4. call your ALV FM with the events details.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = ws_c_repid

    i_grid_title = ws_title

    is_layout = i_layout

    it_fieldcat = i_fieldcat

    i_default = 'X'

    i_save = 'A'

    • I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

    • IS_VARIANT =

    it_events = i_events

    • IT_EVENT_EXIT =

    • IS_PRINT =

    • IS_REPREP_ID =

    • I_SCREEN_START_COLUMN = 0

    • I_SCREEN_START_LINE = 0

    • I_SCREEN_END_COLUMN = 0

    • I_SCREEN_END_LINE = 0

    • IT_ALV_GRAPHICS =

    • IT_ADD_FIELDCAT =

    • IT_HYPERLINK =

    • I_HTML_HEIGHT_TOP =

    • I_HTML_HEIGHT_END =

    • IT_EXCEPT_QINFO =

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    TABLES

    t_outtab = i_final_out

    EXCEPTIONS

    program_error = 1

    OTHERS = 2

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    Regards,

    Jagath.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.