06-11-2007 10:21 AM
Hello,
in my ModulePool I have a TableControl which contents in each line FileNames with FileExtensions.
I have created a Icon-Field in each line which displays the correct Icon (if it exists) for the FileExtension (e.g. ICON_PDF, ICON_BMP ...).
Then I created a button in each line to open the file.
What I want now is that the button changes its icon.
How can I achieve this?
In my PBO for this Dynpro I have the following code but this doesn't work:
LOOP AT gt_zdrud INTO gr_zdrud.
* FuBa zur Ermittlung der Dateierweiterung
CALL FUNCTION 'CRM_IC_WZ_SPLIT_FILE_EXTENSION'
EXPORTING
iv_filename_with_ext = gr_zdrud-zzdoc
IMPORTING
ev_filename = lf_filename
ev_extension = lf_extension.
TRANSLATE lf_extension TO UPPER CASE.
CASE lf_extension.
WHEN 'PDF'. MOVE icon_pdf TO gr_zdrud-icon.
WHEN OTHERS.
MOVE icon_display TO gr_zdrud-icon.
ENDCASE.
MODIFY gt_zdrud FROM gr_zdrud.
ENDLOOP.
The table GT_ZDRUD is the table which fills the TableControl.
The field GR_ZDRUD-ICON is the field which holds the name of the icon and is defined in the dynpro as PUSH(button).
12-04-2007 9:24 AM