Skip to Content
author's profile photo Former Member
Former Member

Passing text and Image Value in ALV Button Column Field

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 27, 2014 at 06:12 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 27, 2014 at 06:18 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.