Application Development 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: 

ALV Menu Button

former_member182048
Active Contributor
0 Kudos

I am trying without sucess to add an icon to an ALV toolbar menu button. The button appears with text but no icon.

I have seen it work before just wondering what i am missing.

eg.

METHOD on_menu_button.

CALL METHOD e_object->add_function

EXPORTING fcode = 'ZCHANGE'

icon = icon_change

text = 'Contact'.

Cheers

JP

4 REPLIES 4

athavanraja
Active Contributor
0 Kudos

try giving the icon as '0Z' instead of icon_change

Raja

Former Member
0 Kudos

Check this program <b>BCALV_GRID_05</b> and I am not sure whether you are doing it correctly.

All you need to do is :

a) Define a class

b) add a method for event toolbar

c) in the method fill the internal table

e_object->mt_toolbar

Regards,

Subramanian V.

0 Kudos

Hi JP

The code you've sent is not for adding a button to ALV toolbar, but for adding a function when a menu button is pressed. And as far as I know, it does not support icons for the moment although there is such a parameter.

To have a icon for a button <b>on</b> the ALV toolbar, I guess you know, but at the event "toolbar" assign the icon name to the relevant field.

For more information, you can have a look at the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference For ALV Grid Control"</a>.

And as a last thing, let me introduce you the SDN forums pointing system: You can assign points to posts you find helpful while solving your question. You can reward points by clicking the yellow star icon at header of each reply post. You can reward;

- one 10 points (solved)

- two 6 points (very helpful answer)

- many 2 points (helpful answer)

Kind regards...

*--Serdar

0 Kudos

Serdar,

Thanks for the semantic check.

I am trying to add an icon to a function, I read the pdf before submitting question.

Cheers

JSP