04-12-2009 12:49 PM
Hello experts ,
I want to write comment in top of page on my alv , i was do this way :
l_repid = sy-cprog.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = 'X '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
i_callback_program = l_repid
I_CALLBACK_PF_STATUS_SET = 'ALV_PF_STATUS_SET'
i_callback_user_command = 'ALV_USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
i_structure_name = 'ZAGE_LCLBLK'
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
is_layout = l_layout
IT_FIELDCAT =
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
i_save = 'A'
is_variant = is_variant
it_events = gt_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 = dtab
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.
FORM e04_comment_build USING e04_lt_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = 'LOCAL CUSTOMERS AGE REPORT INCL BLOCKING INFO'(001).
APPEND ls_line TO e04_lt_top_of_page.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = text-com , p_comCod.
CONCATENATE text-com '' p_comcod INTO ls_line-info ."devlop30.11.08
APPEND ls_line TO e04_lt_top_of_page.
ENDFORM.
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page.
ENDFORM.
After this code , i wasn't sea my comment in my alv report , what can be the problem ?
Thanks for your help.
Avi.
04-12-2009 12:54 PM
Hi,
You should instead pass e04_lt_top_of_page as a parameter to the function module.
04-12-2009 12:54 PM
Hi,
You should instead pass e04_lt_top_of_page as a parameter to the function module.
04-12-2009 12:59 PM
04-12-2009 1:01 PM
Hi Avi,
In the TOP_OF_PAGE subroutine populate the gt_list_top_of_page internal tables TYP and INFO fields.
INFO should contain the content of the header in lines of 60 characters each and TYP defines the type of the INFO e.g. 'S' for normal or 'H' for header etc.
Cheers,
Aditya
04-12-2009 1:02 PM
Hi,
Please have a look here
http://www.sap-img.com/abap/sample-alv-heading-in-alv.htm
Regards
Abhinab
Edited by: Abhinab Mishra on Apr 12, 2009 5:46 PM
04-12-2009 2:36 PM
Hi,
The problem lies here:
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = e04_lt_top_of_page. "you fill this table with data not gt_list_top_of_page, so pass it here
ENDFORM.
Regards
Marcin
04-12-2009 3:08 PM
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = e04_lt_top_of_page. " <-- Please change this since you are populating data in this table.
ENDFORM.
Regards,
Lalit Mohan Gupta.