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

How do I insert a logo in ALV using Function Modules?

Former Member
0 Likes
2,090

hai !

i want to display the logo on the grid .

can any one suggest me which function i should use?

any help will be appreciated.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,481

Hi,

Look at the sample code to display LOGO.

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

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = i_repid

  • i_callback_user_command = 'USER_COMMAND_PERNR'

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.

clear t_output.

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

----


  • Form TOP-OF-PAGE1

----


form top-of-page1.

data: header type slis_t_listheader,

wa type slis_listheader. "infield like wa-info, nline type n.

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

Just you need to give the text in it.

You can refer the below link also.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm

Thanks.

If this helps you reward with points.

Message was edited by: KDeepak

8 REPLIES 8
Read only

Former Member
0 Likes
1,482

Hi,

Look at the sample code to display LOGO.

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

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = i_repid

  • i_callback_user_command = 'USER_COMMAND_PERNR'

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.

clear t_output.

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

----


  • Form TOP-OF-PAGE1

----


form top-of-page1.

data: header type slis_t_listheader,

wa type slis_listheader. "infield like wa-info, nline type n.

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

Just you need to give the text in it.

You can refer the below link also.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm

Thanks.

If this helps you reward with points.

Message was edited by: KDeepak

Read only

Former Member
0 Likes
1,481

hi use this FM

REUSE_ALV_COMMENTARY_WRITE

regards

vijay

Read only

Former Member
0 Likes
1,481

Hi Raghavendra kulkarni,

By using FM 'REUSE_ALV_COMMENTARY_WRITE', u r able to insert logo in ALV Grid.

Regards,

Digesh Panchal

Read only

Former Member
0 Likes
1,481

Hi Kulkami,

You can use "REUSE_ALV_COMMENTARY_WRITE" function module to display your ALV, you can automatically insert your logo to the header. You can define the name of logo file which must be stored in SAP Web Repository Tcode: SMW0 , at the event "TOP_OF_PAGE" .

<b>Example</b>

FORM TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

I_LOGO = 'ENJOYSAP_LOGO'

IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.

ENDFORM.

Note: The logo can not be printed.

If you are using the OO version of the ALV Grid Control i.e. an instance of the class "cl_gui_alv_grid", there is no automatic way.

But independent from the ALV Grid, you can put in your screen a custom control which will be related to a "cl_gui_picture" object showing pictures in it.

For the "REUSE..." version, inspect the demo "BCALV_FULLSCREEN_DEMO"

Also see following links for reference.

Dont forget to reward pts, if it helps ;>)

Regards,

Rakesh.

Message was edited by: Rakesh

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,481

hi, to insert a logo u have to use fn module

REUSE_ALV_COMMENTARY_WRITE

SEE THE EXAMPLE,

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY =

I_LOGO = 'MY_SAP'.

MY_SAP SHOULD BE UPLOADED INTO APPLICATION SERVER USING TRANSACTION 'OAER'.

goto 'OAER'.

GIVE CLASS NAME "PICTURES"

CLASS TYPE "OT".

GO INSIDE , U WILL FIND OPTION TO UPLOAD LOGO.

ONCE THE LOGO IS IN THE APPLICATION SERVER,

U CAN CALL THE FN MODULE.

NO NEED TO GIVE PATH, JUST GIVE THE NAME OF LOGO U HAVE GIVEN.

Read only

0 Likes
1,481

thanks a lot it really solved my problem.thanks a lot.

by d by i am a raghu. how are u?

Read only

0 Likes
1,481

hi raghavendra,

if it solved ur problem,

pls reward the points

Read only

0 Likes
1,481

Hi,

For any ALV related query first you can check <b>SLIS</b> Development class , it has many beautiful examples .

Hope This Info Helps YOU.

<i>

Reward Points If It Helps YOU.</i>

Regards,

Raghavendra