Icon display on list with description

Icon display on list with description

Generally, the icons on a list are displayed using the ABAP statement WRITE <symbol-name> AS ICON. But these icons do not have any description on their own. It might be difficult for the end user to understand the significance of that particular icon. So for that, we can make use of the function module ICON_CREATE. This function module can be used to display the icons similar to the above ABAP statement. But in this case, we will get the description of the icon(s), when we move the cursor over that icon.
This program was written in v. 4.6c


REPORT zsuresh_icon_on_screen_field .

*********************************************************
* Author     : Subhas Chandra Bose                      *
* Date       : 14-Oct-2002                              *
*********************************************************

*********************************************************
* The icons on the list can be displayed using the      *
* statement WRITE <symbol-name> AS ICON           *
* but when we display the icons using the               *
* function module ICON_CREATE, we can get the           *
* description of the icon on moving the cursor          *
* over the icon                                         *
*********************************************************

* This program illustrates the differences between using
* the above two mentioned methods.......................

INCLUDE <icon>.

* declaring the work variables..........................................
DATA

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

: icon_result TYPE icons-text, icon_name(20) TYPE c, icon_text(20) TYPE c, icon_info LIKE icont-quickinfo. * to display the user name with an icon... WRITE : 'Using the statement WRITE <symbol-name> AS ICON'. WRITE :/ icon_employee AS ICON, sy-uname. SKIP. WRITE :/ 'Using the function module ICON_CREATE'. icon_name = 'ICON_EMPLOYEE'. icon_text = sy-uname. icon_info = 'Employee Name'. PERFORM iconcreation. CONDENSE icon_result. WRITE :/ icon_result. *&---------------------------------------------------------------------* *& Form iconcreation *&---------------------------------------------------------------------* * This subroutine is used to create the icons with the text *----------------------------------------------------------------------* FORM iconcreation. CALL FUNCTION 'ICON_CREATE' EXPORTING name = icon_name text = icon_text info = icon_info add_stdinf = ' ' IMPORTING result = icon_result EXCEPTIONS icon_not_found = 1 outputfield_too_short = 2 OTHERS = 3. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDFORM. " iconcreation

This was first published in October 2002

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.