Search on this Website

Tuesday, September 30, 2008

How to put Logo or photo in ALV Report


Logo should be uploaded into application server using transaction 'OAER'.
1. Go to Transaction OAER,
2. Give Class Name as PICTURES
3. Class type as OT
4. Object Key is the name you want to search or you want to upload.
5. Then select the Document from below after double click on it .Choose in screen for logos.
6. Upon execution you would be prompted to give the file path details. Just upload which ever logo u want to display
7. Now you can use the same name in your ALV FM.
In your ALV program, you need to have event for TOP_OF_PAGE, and also this works only in case of Grid not in ALV LIST.

Look at the sample code to display LOGO.

**********************


call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = i_repid
it_fieldcat = header
is_layout = gt_layout
i_callback_top_of_page = 'TOP-OF-PAGE1'
i_grid_title = xyz
it_sort = gt_sort[]
i_default = 'X'
i_save = 'U'
is_variant = gt_variant
it_events = gt_events
tables
t_outtab = t_output.

*****************

*-------------------------------------------------------------------*

* Form TOP-OF-PAGE1

*-------------------------------------------------------------------*

form top-of-page1.

data: header type slis_t_listheader,
wa type slis_listheader.

* TITLE AREA

wa-typ = 'S'.
wa-info = text-h04.
append wa to header.

wa-typ = 'S'.
write sy-datum to wa-info mm/dd/yyyy.

concatenate text-h03 wa-info into wa-info separated by space.
append wa to header.

wa-typ = 'S'.
concatenate text-h02 sy-uname into wa-info separated by space.
append wa to header.

wa-typ = 'S'.
concatenate text-h01 sy-repid into wa-info separated by space.
append wa to header.

********" LOGO

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = header

i_logo = 'ENJOYSAP_LOGO'.

*********" LOGO

endform.

Here in TOP-OF-PAGE form it will show you the Prog name,Date, User Name

No comments: