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: 

Interactive Icon in alv grid cell

former_member224444
Participant
0 Kudos

Dear All,

I need to develop a report like ME28 in which one column will contain icon 'ICON_SET_STATUS', when i click that icon i will store a value 'X' in my ztable against that PO, after clicking that Icon it should change to 'ICON_CHECKED' in that cell itself.  Please let me know the way to do this.

Example layout: 

Icon                          PO number                    Value


Regards,

Rithika.

Moderator message: Please do some research before posting

Message was edited by: Kesavadas Thekkillath

3 REPLIES 3

Former Member
0 Kudos

Hi Rithika,

In the table ICON you will find all the icons and the codes with which they are stored in SAP database tables.

For ICON_CHECKED the code is @01@

For eg.

Take a field CHECK in your internal table.

DATA : CHECK TYPE TV_IMAGE.

Whenever the condition is met then simply assign this code to field and it will show the image.

ITAB-FIELD = '@01@'

Let me know if you need additional information on this. Hope this helps.

Thanks,

Tooshar Bendale

0 Kudos

Dear Tooshar Bendale,

Thanks for your reply, as you said i brought the icon in the alv grid, i have made that icon to hotspot also, but when i click that icon i will store a value in my z table based on that row, and that icon should change to other icon. How to change that icon. My coding is below which i wrote inside hotspot_click event of class cl_gui_alv_grid in this i get icon which is clicked but it is not changing to other icon, in the alv grid even i assign that in itab.

FORM HOT_SPOT  USING    P_E_ROW type LVC_S_ROW

                         P_E_COLUMN_ID type LVC_S_COL

                         P_ES_ROW_NO type LVC_S_ROID.

  READ TABLE ITAB ASSIGNING <GICON> INDEX P_ES_ROW_NO-ROW_ID.

  IF SY-SUBRC EQ 0.

    IF <GICON>-ID EQ '@3J@'.

      <GICON>-ID = '@01@'.

    ELSEIF <GICON>-ID EQ '@01@'.

      <GICON>-ID = '@3J@'.

    ENDIF.

    ENDIF.

ENDFORM.

0 Kudos

Hi Rithika,

Seems like the hopspot click even is not gettting triggered, Check if the hotspot_click event is triggered. Have you tried placing a break-point in your code.

Place a break point in your code and during run time pressing on the hotspot should trigger the breakpoint.

Thanks,

Tooshar Bendale