Skip to Content
avatar image
Former Member

Need to add a push button with images to the ALV Grid Output

Hi,

I have implemented an ALV Grid output with cl_gui_alv_grid. I need to add a push button logic such that it has an event associated with it. So that I can do further screen level processing. I have added a pushbutton mc_style_button to it. But still Iam not able to add yes, no kind of symbole to it.

regards,

Rahul

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    May 12, 2006 at 12:46 AM

    Rahul,

    I am assuming that you have changed the appearance of a column to look like a button. In that case I am not sure if you can write text on that.

    However, what you can do is to make it an icon instead of a button. Now, you can display whatever ICON for each row of the grid. Have the HOTSPOT event active for the column so that the user clicks and you can do the required action on that column.

    Regards,

    Ravi

    Note : Please mark the helpful answers

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 12, 2006 at 01:34 AM

    HI,

    Thanks for the reply...

    Actually I want the ICON_OKAY and ICON_CANCEL on the button as image, while button click event will generate the functionality of modifying a database table.

    So, I wanted to know is it possible to have such kind of icons available on the buttons in ALV display..

    regards,

    Rahul

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Rahul,

      Yes you can put in the ICON_OKAY AND ICON_CANCEL on the column and just activate the ICON field in the field catalog and populate the icon in the column.

      Activate the hotspot and when clicked you can do whatever you want on a individual row basis.

      If you want at report level add push buttons to the toolbar and when clicked, you can do your operations.

      Regards,

      Ravi

      Note : Please mark the helpful answers

  • May 12, 2006 at 04:13 AM

    Hi rahul,

    You can try this code

    data: gs_toolbar TYPE stb_button,

    CLEAR gs_toolbar.

    MOVE 3 TO gs_toolbar-butn_type.

    APPEND gs_toolbar TO e_object->mt_toolbar.

    *...................

    • append a menu with default button (Type 1)

    • If the user klicks on the menu button ALV raises event MENU_BUTTON.

    CLEAR gs_toolbar.

    MOVE 'DISPL' TO gs_toolbar-function.

    MOVE icon_display TO gs_toolbar-icon.

    MOVE text-090 TO gs_toolbar-quickinfo.

    MOVE 0 TO gs_toolbar-butn_type.

    MOVE space TO gs_toolbar-disabled.

    APPEND gs_toolbar TO e_object->mt_toolbar.

    Hope this will help you

    Regards

    Sumit Bhutani

    <b>Ps Reward points if helpful</b>

    Add comment
    10|10000 characters needed characters exceeded