05-17-2006 4:13 PM
Hello friends,
I like to display large size text in ALV header.
Could any one help me out.
Thank your time.
Senthil
05-17-2006 4:18 PM
Hi Senthil,
chk this report
*&---------------------------------------------------------------------*
*& Report Y_TOP_PAGE *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT y_top_page .
TABLES : mara.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
w_repid = sy-repid.
DATA : BEGIN OF it_mara OCCURS 0,
matnr LIKE mara-matnr,
END OF it_mara.
*layout
DATA: wa_layout TYPE SLIS_LAYOUT_ALV.
*field catalog
DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.
START-OF-SELECTION.
SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
I_INTERNAL_TABNAME = 'IT_MARA'
* i_structure_name = 'IT_MARA'
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = w_repid
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = it_fieldcat_wrt_off[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = wa_layout
it_fieldcat = it_fieldcat_wrt_off
TABLES
t_outtab = it_mara
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 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 = 'CHANDU 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. "top-of-page
05-17-2006 4:18 PM
Hi Senthil,
chk this report
*&---------------------------------------------------------------------*
*& Report Y_TOP_PAGE *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT y_top_page .
TABLES : mara.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
w_repid = sy-repid.
DATA : BEGIN OF it_mara OCCURS 0,
matnr LIKE mara-matnr,
END OF it_mara.
*layout
DATA: wa_layout TYPE SLIS_LAYOUT_ALV.
*field catalog
DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.
START-OF-SELECTION.
SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
I_INTERNAL_TABNAME = 'IT_MARA'
* i_structure_name = 'IT_MARA'
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = w_repid
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = it_fieldcat_wrt_off[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = wa_layout
it_fieldcat = it_fieldcat_wrt_off
TABLES
t_outtab = it_mara
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 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 = 'CHANDU 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. "top-of-page
05-17-2006 4:23 PM
Hi Senthil,
As chandu said you have to include the text in top-of-page event.
=======================================================
<b>w_list_comments-typ = 'H'</b>. "H=Header, S=Selection, A=Action
w_list_comments-key = ''.
w_list_comments-info =
'FLIGHT SCHEDULE REPORT'.
append w_list_comments to gt_list_top_of_page.
=======================================================
Where H stands for header, S for selection and A for action.
Hope this will give you some idea.
Regards,
Vicky
05-17-2006 4:40 PM
hi Senthil,
Check these Links
http://www.sap-img.com/fu037.htm
http://www.sap-img.com/abap/sample-alv-heading-in-alv.htm
Regards,
santosh