cancel
Showing results for 
Search instead for 
Did you mean: 

Passing text and Image Value in ALV Button Column Field

Former Member
0 Kudos

Hi Experts,

I have an ALV Column which i have created as Button.

I Need to pass an Image and Text to the Button.

How to achieve this Functionality? Kindly let me know.

Also how to create an action for this button?

Can we control the action in the On CLICK Event of ALV based on the selected column Name?

Kindly give some Suggestions.

Thanks,

Nalla B.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI Balu,

class CL_SALV_WD_UIE_BUTTON  will have all the methods which you are looking for.

example:

SET_TEXT --- Sets the Text on the Button

SET_IMAGE_SOURCE -- Sets Label Text of Image.

To register event , ( view must use the standard ALV component, wd_salv_table)

1. Go to the view

2.  create an method , in the Event Tab, select F4, and select on_Click_Event.

3. Implement Logic whatever u need in the newly created method.

Regards,

Ravikiran.K

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Nalla,

  • Set the image to the button by using method SET_IMAGE_SOURCE of class CL_SALV_WD_UIE_BUTTON. Here you pass the source of image

    

     Ex: lo_button->set_image_source( value = '~Icon/ErrorMessage' ).

  • Set the text to button using method SET_TEXT

           lo_button->set_text( value = 'My_button')

We can get the control inside event handler onCellAction event of alv.

Hope this helps you.

Regards,

Rama