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

header text of alv

Hi this is saroj.

i am new to alv reports.i have done a alv report by using FMs events_get,commentary_write,grid_display.

i am getting the data but i am not getting the header text of report and logo.

my coding is like this.

tables: kna1.
types: begin of it,
           ----------
          end of it.
data: it_field type slis_t_fieldcat_alv,
        wa_field type slis_fieldcat_alv,
       it_event type slis_t_event,
      wa_event type slis_alv_event,
      it_list type slis_t_listheader,
      wa_list type slis_listheader,
      repid type sy-repid.

perform select.
perform event.
perform header.
perform logo using it_list.
perform display.

in subroutine event:
-----------------------------------
reuse_alv_events_get
exporting
    i_list_type = 0.
importing
   et_events = it_event.

wa_event-name = 'top_of_page'.
wa_event-form = 'logo'.
append wa_event to it_event.

in subroutine header:
---------------------------------------
wa_list-typ = 'H'.
WA_LIST-INFO = 'SOME TEXT'.
APPEND WA_LIST TO IT_LIST.

IN SUBROUTINE LOGO.
---------------------------------------
REUSE_ALV_COMMENTARY_WRITE
EXPORTING
    IT_LIST_COMMENTARY = 'IT_LIST'
   I_LOGO = 'ENJOYSAP_LOGO'.

-


my issue is that i am getting the data but i am not getting the header text and logo.

please solve the issue.please give sample code.

regards

saroj kanta

Edited by: Julius Bussche on Aug 15, 2009 7:03 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2009 at 05:11 PM

    Hi Saroj,

    Try this

    ***Declarations,
    *STEP1*
    DATA : gt_events TYPE slis_t_event,      " Internal table to capture various events in ALV
           gs_events TYPE slis_alv_event.
    
    
    *STEP2*
    Perform event.  
    
      FORM event .
    
      CLEAR : gt_events[],
              gs_events.
    *PASS THE VALUE AS FOLLOWS*
      gs_events-name = slis_ev_top_of_page.    
      gs_events-form = slis_ev_top_of_page.
      APPEND gs_events TO gt_events.
    ENDFORM.     
    
    
    *STEP3*
    *DECLARE TOP OF PAGE AS BELOW.*
    *&---------------------------------------------------------------------**
    **&      Form  TOP_OF_PAGE*
    **&---------------------------------------------------------------------**
    FORM top_of_page.                                           "#EC CALLED
    
      CONSTANTS: lc_header    TYPE char1 VALUE 'H',
                 lc_selection TYPE char1 VALUE 'S'.
    
      DATA: ls_header TYPE slis_listheader,
            lt_header     TYPE slis_t_listheader.
    
    *-- Report Title
      CLEAR ls_header.
      REFRESH lt_header.
    
      ls_header-typ  = lc_header.
      ls_header-key  = 'Report :'(015).                   "Report
      ls_header-info = sy-title.
      APPEND ls_header TO lt_header.
    
    *-- Client
      ls_header-typ  = lc_selection.
      ls_header-key  = 'Client :'(012).            "Client
      ls_header-info = sy-mandt.
      APPEND ls_header TO lt_header.
      CLEAR ls_header.
    
    *-- User ID
      ls_header-typ  = lc_selection.
      ls_header-key  = 'User ID :'(013).            "User ID
      ls_header-info = sy-uname.
      APPEND ls_header TO lt_header.
      CLEAR ls_header.
    
    *-- Date (MM/DD/YYYY)
      ls_header-typ  = lc_selection.
      ls_header-key  = 'Date :'(014).               "Date
      WRITE sy-datum TO ls_header-info.
      APPEND ls_header TO lt_header.
      CLEAR ls_header.
    
    *-- Time
      ls_header-typ  = lc_selection.
      ls_header-key  = 'Time :'(016).                       "Time
      WRITE sy-uzeit TO ls_header-info.
      APPEND ls_header TO lt_header.
      CLEAR ls_header.
    
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = lt_header.
    
    ENDFORM.                    "top_of_page

    Regards,

    Vimal.

    Edited by: Julius Bussche on Aug 15, 2009 7:04 AM

    Added code tags...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 14, 2009 at 06:22 PM

    Hi Saroj,

    along with Vimol's answer you also can use the I_CALLBACK_TOP_OF_PAGE parameter like this

    I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE' <here 'TOP-OF-PAGE' is the name of a subroutine where you have to create the header>.

    just use search engine with REUSE_ALV_GRID_DISPLAY ,you get lots of code.

    Regards.

    Sarbajit.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2009 at 01:59 PM

    answered

    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.