‎2007 Nov 14 5:37 AM
how can i print a logo in my alv list
plz give me a format or coding for that
regards
krishan rana
‎2007 Nov 14 5:40 AM
Hi,
Refer this code.
&----
*& Form sub_create_events *
&----
This form will display the ALV Events *
----
FORM sub_create_events .
*--Local Work Area
DATA: lwa_event TYPE slis_alv_event. "Work area for Events
*--Call Function to display the events for the ALV
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 1
IMPORTING
et_events = it_events.
*--Sort by Name
SORT it_events BY name.
*--Clear
CLEAR lwa_event.
READ TABLE it_events INTO lwa_event WITH KEY name =
slis_ev_top_of_page
BINARY SEARCH.
IF sy-subrc = 0.
MOVE c_top_of_page TO lwa_event-form.
MODIFY it_events FROM lwa_event TRANSPORTING form WHERE
name = slis_ev_top_of_page.
ENDIF.
*--Clear
CLEAR : lwa_event.
ENDFORM. "sub_create_events
&----
*& Form sub_top_of_page *
&----
This form is to build the Page Header *
----
FORM sub_top_of_page .
*--Local Variable
DATA : lv_title(120) TYPE c, " Title
lv_month(30) TYPE c,
lv_mont(30) TYPE c,
lv_bud(16) TYPE c.
*--Local Work Area
DATA : lwa_line TYPE slis_listheader. " Hold list header
CONCATENATE p_month 'to' s_hmonth INTO lv_month SEPARATED BY space.
IF NOT s_hmonth IS INITIAL.
lv_mont = lv_month.
ELSE.
lv_mont = p_month.
ENDIF.
*--Title Display
lwa_line-typ = 'H'. " header
lv_title = sy-title.
lwa_line-info = lv_title.
APPEND lwa_line TO it_header.
CLEAR lwa_line.
*--Month Display
lwa_line-typ = 'S'. " Item
WRITE: lv_mont TO lv_month.
lwa_line-key = text-024.
lwa_line-info = lv_month.
APPEND lwa_line TO it_header.
*--Budget Display
lwa_line-typ = 'S'. " Item
WRITE: p_bud TO lv_bud.
lwa_line-key = text-025.
lwa_line-info = lv_bud.
APPEND lwa_line TO it_header.
CLEAR: lwa_line,
lv_mont.
*--This funcation module will display the top of the page
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_header
I_LOGO = 'ZLOGO'.
*--Free
FREE : it_header.
ENDFORM. "sub_top_of_page
Regards,
Prashant
‎2007 Nov 14 5:38 AM
‎2007 Nov 14 5:40 AM
Hi,
Refer this code.
&----
*& Form sub_create_events *
&----
This form will display the ALV Events *
----
FORM sub_create_events .
*--Local Work Area
DATA: lwa_event TYPE slis_alv_event. "Work area for Events
*--Call Function to display the events for the ALV
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 1
IMPORTING
et_events = it_events.
*--Sort by Name
SORT it_events BY name.
*--Clear
CLEAR lwa_event.
READ TABLE it_events INTO lwa_event WITH KEY name =
slis_ev_top_of_page
BINARY SEARCH.
IF sy-subrc = 0.
MOVE c_top_of_page TO lwa_event-form.
MODIFY it_events FROM lwa_event TRANSPORTING form WHERE
name = slis_ev_top_of_page.
ENDIF.
*--Clear
CLEAR : lwa_event.
ENDFORM. "sub_create_events
&----
*& Form sub_top_of_page *
&----
This form is to build the Page Header *
----
FORM sub_top_of_page .
*--Local Variable
DATA : lv_title(120) TYPE c, " Title
lv_month(30) TYPE c,
lv_mont(30) TYPE c,
lv_bud(16) TYPE c.
*--Local Work Area
DATA : lwa_line TYPE slis_listheader. " Hold list header
CONCATENATE p_month 'to' s_hmonth INTO lv_month SEPARATED BY space.
IF NOT s_hmonth IS INITIAL.
lv_mont = lv_month.
ELSE.
lv_mont = p_month.
ENDIF.
*--Title Display
lwa_line-typ = 'H'. " header
lv_title = sy-title.
lwa_line-info = lv_title.
APPEND lwa_line TO it_header.
CLEAR lwa_line.
*--Month Display
lwa_line-typ = 'S'. " Item
WRITE: lv_mont TO lv_month.
lwa_line-key = text-024.
lwa_line-info = lv_month.
APPEND lwa_line TO it_header.
*--Budget Display
lwa_line-typ = 'S'. " Item
WRITE: p_bud TO lv_bud.
lwa_line-key = text-025.
lwa_line-info = lv_bud.
APPEND lwa_line TO it_header.
CLEAR: lwa_line,
lv_mont.
*--This funcation module will display the top of the page
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_header
I_LOGO = 'ZLOGO'.
*--Free
FREE : it_header.
ENDFORM. "sub_top_of_page
Regards,
Prashant
‎2007 Nov 14 5:40 AM
The following is the code for inserting the logo in ALV.
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'ENJOYSAP_LOGO'
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
ENDFORM.
‎2007 Nov 14 5:46 AM
use this FM
RESUE_ALV_COMMENTARY_WRITE.
logo should me in sap.
to upload logo in sap database level we use.
goto OAOR T-code
and upload the logo in sap.
classname:pictures
class type:OT.
‎2007 Nov 14 5:49 AM
with the fn module 'REUSE_ALV_COMMENTARY_WRITE' u can print a logo.
but the logo should be there in the application server.
to upload a logo u should use the transaction 'OAER'.
‎2007 Nov 14 5:54 AM
hi,
try writing the following code in your top_of_page subroutine :
FORM top_of_page.
*ALV Header declarations
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader.
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.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header
i_logo = 'ENJOYSAP_LOGO'.
endform.
reward if useful..