<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Button with Icon in TableControl in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-with-icon-in-tablecontrol/m-p/2330979#M512946</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;in my ModulePool I have a TableControl which contents in each line FileNames with FileExtensions.&lt;/P&gt;&lt;P&gt;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 ...).&lt;/P&gt;&lt;P&gt;Then I created a button in each line to open the file.&lt;/P&gt;&lt;P&gt;What I want now is that the button changes its icon.&lt;/P&gt;&lt;P&gt;How can I achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my PBO for this Dynpro I have the following code but this doesn't work:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The table GT_ZDRUD is the table which fills the TableControl.&lt;/P&gt;&lt;P&gt;The field GR_ZDRUD-ICON is the field which holds the name of the icon and is defined in the dynpro as PUSH(button).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jun 2007 09:21:13 GMT</pubDate>
    <dc:creator>MichaelTe</dc:creator>
    <dc:date>2007-06-11T09:21:13Z</dc:date>
    <item>
      <title>Button with Icon in TableControl</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-with-icon-in-tablecontrol/m-p/2330979#M512946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;in my ModulePool I have a TableControl which contents in each line FileNames with FileExtensions.&lt;/P&gt;&lt;P&gt;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 ...).&lt;/P&gt;&lt;P&gt;Then I created a button in each line to open the file.&lt;/P&gt;&lt;P&gt;What I want now is that the button changes its icon.&lt;/P&gt;&lt;P&gt;How can I achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my PBO for this Dynpro I have the following code but this doesn't work:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The table GT_ZDRUD is the table which fills the TableControl.&lt;/P&gt;&lt;P&gt;The field GR_ZDRUD-ICON is the field which holds the name of the icon and is defined in the dynpro as PUSH(button).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 09:21:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/button-with-icon-in-tablecontrol/m-p/2330979#M512946</guid>
      <dc:creator>MichaelTe</dc:creator>
      <dc:date>2007-06-11T09:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Button with Icon in TableControl</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/button-with-icon-in-tablecontrol/m-p/2330980#M512947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No solution.&lt;/P&gt;&lt;P&gt;Closing this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2007 09:24:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/button-with-icon-in-tablecontrol/m-p/2330980#M512947</guid>
      <dc:creator>MichaelTe</dc:creator>
      <dc:date>2007-12-04T09:24:22Z</dc:date>
    </item>
  </channel>
</rss>

