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: 

Urgent : how to place a lock icons for the selected rows

Former Member
0 Kudos

How to place a <b>lock icon for the selected rows</b>.

I selected the rows with the help of the method seleted rows and i want to know how to place the <b>lock icon</b> after selecting the data in the grid

This is for ALV Grid control

3 REPLIES 3

settipalli_raj
Explorer
0 Kudos

1. You should have a icons-text type field in the output table

2. Set icon field of fieldcatolog for this column to 'X'.

3. Use function ICON_CREATE to create icon and set the output of this function call to icons-text type field.

Eg:

data: being of my_table occurs 0,
          field1...
          field2...
          icon_locked type icons-text,
        end of my_table.

Creating field catalog: (along with other attributes)

     fcat-fieldname = 'ICON_LOCKED'.
     fcat-icon = 'X'.

Call ICON_CREATE Function

DATA: l_message LIKE icont-quickinfo.

  CALL FUNCTION 'ICON_CREATE'
    EXPORTING
      name                  = 'ICON_RED_LIGHT'
      text                  = ' '
      info                  = l_message
      add_stdinf            = 'X'
    IMPORTING
      RESULT                = itab_my_table-icon_locked
    EXCEPTIONS
      icon_not_found        = 1
      outputfield_too_short = 2
      OTHERS                = 3.

Update internal table with icon before displaying or refreshing the control.

Hope this helps.

Former Member
0 Kudos

Hello Bharat,

Please refer to the example provided in SAP itself

Report name is : demo_dynpro_status_icons.

Go se38 -> demo_dynpro_status_icons -> display

Please go through the code and you will get a good idea on how to create and use icons...I

Reward if helpful

Regards

Byju

Former Member
0 Kudos

u can use a FM icon_create

regards

Giridhar