Application Development 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: 

Button with Icon in TableControl

MichaelTe
Contributor
0 Kudos

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).

1 REPLY 1

MichaelTe
Contributor
0 Kudos

No solution.

Closing this.