Tip

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

: 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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

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.