Why checkbox is showed as character in list report?

Viewed 162

I have a list report where i am using checkbox for selection but the problem is checkbox is showing characters only. Can anyone help me to fix the problem?

I have tried to find the solution, how to display checkbox, below is the sample code:

TYPE-POOLS:icon.

CONSTANTS:
          c_unchecked TYPE icon_d VALUE 'T9'.

TYPES: BEGIN OF ty_data,
          carrid TYPE  s_carr_id,
          carrname TYPE  s_carrname,
          currcode TYPE  s_currcode,
          url TYPE  s_carrurl ,
          checkbox TYPE icon_d,
       END OF ty_data.
DATA t_data TYPE STANDARD TABLE OF ty_data.

START-OF-SELECTION.

SELECT CARRID,CARRNAME,CURRCODE,URL  FROM SCARR INTO TABLE @t_data.

LOOP AT t_data ASSIGNING FIELD-SYMBOL(<fs_data>).
     <fs_data>-checkbox = c_unchecked .
     WRITE:/10 <fs_data>-checkbox,
            20 <fs_data>-carrid,
            35 <fs_data>-carrname,
            60 <fs_data>-currcode,
            70 <fs_data>-url.
   ENDLOOP.

Output of list report should display checkbox but it is displaying characters.

displayforecheckbox

1 Answers

Possibilities which all display the icon "T9" ("web dynpro IFrame"):

WRITE : 
    / icon_wd_iframe AS ICON, " constant '@T9@' with output length 2
    / '@T9@', " AS ICON is optional because output length is 4
    / '@T9@' AS ICON,
    / 'T9' AS ICON,
    / '@WDVIFR@'. " equivalent bitmap ID

All icon names are declared in the type pool ICON.

The program SHOWICON displays all icons, their 2-characters and "bitmap" IDs.

For information, another way of displaying icons is using symbols :

WRITE :
    / sym_checkbox AS SYMBOL, 'this is checked',
    / sym_large_square AS SYMBOL, 'this is unchecked'
Related