Application Development and Automation 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: 
Read only

ALV Grid cell button!!

Former Member
0 Likes
4,013

In an alv grid, for 2 columns I do need to display a Button with an Icon!

I have set the field ICON to X and style = cl_gui_alv_grid=>mc_style_button

but it shows this

<a href="http://img218.imageshack.us/my.php?image=screenshot0810gl.jpg">[ Click here ]</a>

Last 2 columns are not buttons !

why ?

regards,

2 REPLIES 2
Read only

Former Member
0 Likes
976
** set icon fields for all fields that contains the ICON in their name!
  CLEAR ls_fcat.
  ls_fcat-icon = c_checked.
  ls_fcat-edit = 'X'.
  ls_fcat-style = ls_fcat-style bit-xor
                  cl_gui_alv_grid=>MC_STYLE_BUTTON bit-xor
                  cl_gui_alv_grid=>MC_STYLE_ENABLEd.
  MODIFY exi_fieldcat FROM ls_fcat TRANSPORTING icon
          WHERE fieldname CS 'ICON'.
Read only

Former Member
0 Likes
976

Hi,

this we can do useing fieldcatlog properties.

for this u need add icon.

code like this :

INCLUDE <icon>. 'at top of program.

we need to add icon properties to fieldcatlog using performs .

code :

PERFORM fieldcat USING 'column' '<field>' '<itenaltable>' <cloun des> ' ' ' ' 'X'.

(give X to the column where you want to disply ICON)

form should be.

FORM fieldcat USING value(col_pos)

value(fieldname)

value(tabname)

value(reptext)

  • VALUE(LENGTH)

value(input)

value(checkbox)

value(icon).

CLEAR ln_fieldcat.

ln_fieldcat-col_pos = col_pos.

ln_fieldcat-fieldname = fieldname.

ln_fieldcat-tabname = tabname.

ln_fieldcat-reptext_ddic = reptext.

  • LN_FIELDCAT-OUTPUTLEN = LENGTH.

ln_fieldcat-input = input.

ln_fieldcat-checkbox = checkbox.

ln_fieldcat-icon = icon.

APPEND ln_fieldcat TO it_fieldcat.

ENDFORM. "FIELDCA

thanks