‎2006 Feb 01 11:13 AM
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,
‎2006 Feb 01 11:35 AM
** 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'.
‎2006 Feb 02 10:08 AM
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