Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

alv problem

Former Member
0 Likes
700

how can i print a logo in my alv list

plz give me a format or coding for that

regards

krishan rana

1 ACCEPTED SOLUTION
Read only

former_member386202
Active Contributor
0 Likes
664

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

6 REPLIES 6
Read only

Former Member
0 Likes
664

Hi,

Check the link

http://www.sap-img.com/abap/alv-logo.htm

Thanks

naren

Read only

former_member386202
Active Contributor
0 Likes
665

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

Read only

Former Member
0 Likes
664

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.

Read only

mahaboob_pathan
Contributor
0 Likes
664

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.

Read only

hymavathi_oruganti
Active Contributor
0 Likes
664

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'.

Read only

Former Member
0 Likes
664

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..