01-15-2009 7:29 AM
Hi ,
How can i use the the the Top_of_list Event Alv grid Disply.
I have passed Events table with event name and form name to GRID FM it_events.
Form details:-
T_LISTHEADER header deatils table with data. .
FORM TOP_OF_LIST.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_LISTHEADER.
ENDFORM.
But still its not calling the form and also end_of list is working with same coding but top_of_list is not working can u give solution for this.
Regards,
raj
01-15-2009 7:33 AM
01-15-2009 8:01 AM
Hi,
No. Its generating Report without Header Details.
Regards,
Raja.
Edited by: Rajviji on Jan 15, 2009 9:02 AM
01-15-2009 8:08 AM
Hi,
When you are appending the It_events table that time also you have to append TOP_OF_PAGE.
wa_events-name = 'TOP_OF_PAGE'.
wa_events-form = 'TOP_OF_PAGE'.
APPEND wa_events TO it_events.
Regards
Sandipan
01-15-2009 7:43 AM
Hi,
Use TOP_OF_PAGE instead of TOP_OF_LIST
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_LISTHEADER.
ENDFORM.
Regards
Sandipan
01-15-2009 8:05 AM
Hello Raj,
Can you share your coding with us? May be then we will be able to give some pointers.
BR,
Suhas
01-15-2009 8:26 AM
hi Suhas,
My coding Here
*&---------------------------------------------------------------------*
*& Report ZR2K9_ALV008
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT alv_top_of_list
TABLES : t001.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
TYPES : BEGIN OF ty_comp.
INCLUDE STRUCTURE t001.
TYPES : END OF ty_comp.
DATA: T_EVENTS TYPE slis_t_event.
DATA: WA_EVENTS TYPE slis_alv_event .
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA : it_comp TYPE TABLE OF ty_comp.
INITIALIZATION.
w_repid = sy-repid.
wa_events-name = 'TOP_OF_LIST'.
wa_events-form = 'TOP_OF_LIST'.
APPEND wa_events TO t_events.
START-OF-SELECTION.
SELECT * FROM t001 INTO TABLE it_comp up to 20 rows.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
i_internal_tabname = 'IT_COMP'
I_STRUCTURE_NAME = 't001'
i_inclname = w_repid
CHANGING
ct_fieldcat = it_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
it_fieldcat = it_fieldcat[]
IT_EVENTS = T_EVENTS
TABLES
t_outtab = it_comp
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM TOP_OF_LIST.
DATA: T_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: LS_LISTHEADER TYPE SLIS_LISTHEADER.
CLEAR LS_LISTHEADER.
LS_LISTHEADER-TYP = 'S'.
LS_LISTHEADER-KEY = 'Po Heder Details :-'.
APPEND LS_LISTHEADER TO T_LISTHEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_LISTHEADER.
ENDFORM.
01-15-2009 8:30 AM
Hi Rajviji,
Please change the coding to below :-
*&---------------------------------------------------------------------*
*& Report ZR2K9_ALV008
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT alv_top_of_list
TABLES : t001.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
TYPES : BEGIN OF ty_comp.
INCLUDE STRUCTURE t001.
TYPES : END OF ty_comp.
DATA: T_EVENTS TYPE slis_t_event.
DATA: WA_EVENTS TYPE slis_alv_event .
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA : it_comp TYPE TABLE OF ty_comp.
INITIALIZATION.
w_repid = sy-repid.
*Need to change here
wa_events-name = 'TOP_OF_PAGE'. "Instead of TOP_OF_LIST
wa_events-form = 'TOP_OF_PAGE'.
APPEND wa_events TO t_events.
START-OF-SELECTION.
SELECT * FROM t001 INTO TABLE it_comp up to 20 rows.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
i_internal_tabname = 'IT_COMP'
I_STRUCTURE_NAME = 't001'
i_inclname = w_repid
CHANGING
ct_fieldcat = it_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
it_fieldcat = it_fieldcat[]
IT_EVENTS = T_EVENTS
TABLES
t_outtab = it_comp
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM TOP_OF_PAGE. "Form Name Changed
DATA: T_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: LS_LISTHEADER TYPE SLIS_LISTHEADER.
CLEAR LS_LISTHEADER.
LS_LISTHEADER-TYP = 'S'.
LS_LISTHEADER-KEY = 'Po Heder Details :-'.
APPEND LS_LISTHEADER TO T_LISTHEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_LISTHEADER.
ENDFORM.
Regards
Sandipan
01-15-2009 8:36 AM
Hi Sandipan,
Thanks For ur reply . I Know Top_of_page is working for this .
But i want how can i use top_of_list ? why its not working?
And also same top_of_list working for alv list display .
Thanks and Regards,
Raj
01-15-2009 8:49 AM
01-15-2009 11:00 AM
Hi,
Use top of page instead of using top of list.
Use this code, its working:-
*FOR TOP OF THE PAGE
DATA : it_top TYPE slis_t_listheader,
wa_top TYPE slis_listheader.
*&---------------------------------------------------------------------*
* DISPLAY RECORDS IN ALV GRID
*&---------------------------------------------------------------------*
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid "report id
i_callback_top_of_page = 'TOP' "for top of page
it_fieldcat = it_field "field catalog
it_sort = it_sort "sort records info
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
*&---------------------------------------------------------------------*
*& Form top
*&---------------------------------------------------------------------*
* TO WRITE THE HEADER
*----------------------------------------------------------------------*
FORM top.
REFRESH it_top.
wa_top-typ = 'S'.
wa_top-key = text-001. "text to be printed at top of page
wa_top-info = sy-repid. "text
APPEND wa_top TO it_top.
CLEAR wa_top.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_top
* I_LOGO =
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
.
ENDFORM. "top
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
01-15-2009 11:55 AM
Hi,
Check out this link.
http://www.sapdev.co.uk/reporting/alv/alvgrid_rephead.htm
Hope it was useful.
Regards,
Deepthi.