cancel
Showing results for 
Search instead for 
Did you mean: 

ALV display icon from mime repository

Former Member
0 Kudos

Hi all,

I import test.gif to my webdynpro component.

I want show my icon in table and alv table.

Table is ok, but alv table don`t display icon in column.

Here is my code:


  lo_column_settings ?= lo_value.
  lt_columns = lo_column_settings->get_columns( ).
    LOOP AT lt_columns ASSIGNING <fs_col>.
    CASE  <fs_col>-id.
      when 'TEST'.
           create object lo_image.
           lo_image->SET_SOURCE( 'objtp_mer.gif' ).
           <fs_col>-r_column->set_cell_editor( lo_image ).
      ENDCASE.
ENDLOOP.

Edited by: Konstantin Khrushchev on Jun 1, 2010 3:18 PM

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The MIMEs are stored in the MIME repostory in "Folders" according to the WD Component, not the application. Therefore when you use ALV, the ALV Component is a separate Component. You can't reference you component specific image without supplying the path as well.

Change the reference to something like this:

../<Your WD Component>/'objtp_mer.gif

Former Member
0 Kudos

Unfortunately, Thomas.

ZALV is my wd component.

I found problem in CL_WDR_UTILITIES=>CONSTRUCT_MIME_URL

If url icon is

'/zalv/objtp_mer.gif'

this method return the same and icon don`t display.

But if method return

~zalv/objtp_mer.gif 

i see icon in alv.

How i can get back ~zalv/objtp_mer.gif?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

~zalv/objtp_mer.gif isn't really a URL. It is just a shortcut name to identify the component. I wouldn't expect CL_WDR_UTILITIES=>CONSTRUCT_MIME_URL to return that. However if it works why worry with CL_WDR_UTILITIES=>CONSTRUCT_MIME_URL. Just concatenate ~, the WD Component, /, and the image name.

I wouldn't have expected '/zalv/objtp_mer.gif' to work. You would be saying that /ZALV/ is a sub-folder of the ALV component. You would the .. to say you are going up a folder.

Former Member
0 Kudos

Sorry, i don`t understand.

Before writing on sdn i tried ~/ZALV/objtp_mer.gif


An exception occurred which is explained in detail below.
The exception, which is assigned to class 'CX_WDG_UR_WEB_ICON_EXCEPTION', was
 not caught and
therefore caused a runtime error.
The reason for the exception is:
Es existiert kein WebIcon mit dem Alias "~/ZALV/objtp_mer.gif"

call stack in dump

 
40 METHOD       CL_WDG_UR_WEB_ICON_REPOSITORY=CP    CL_WDG_UR_WEB_ICON_REPOSITORY=CM008    19
   CL_WDG_UR_WEB_ICON_REPOSITORY=>GET_ICON_URL_AND_TOOLTIP
39 METHOD       CL_WDR_UTILITIES==============CP    CL_WDR_UTILITIES==============CM002    63
   CL_WDR_UTILITIES=>CONSTRUCT_MIME_URL

couse dump in table wdg_ur_web_icon, where no record.

in debuger in CONSTRUCT_MIME_URL i change R_URL on ~/ZALV/objtp_mer.gif and icon fine display.

Answers (0)