ABAP Program to Display SAP Icons


This page contains two ABAP programs. The first program lets you display all the SAP icons in a report. There is absolutely no need for this program because the transaction ICON does a much better job of this. You should use the tcode ICON to view all the existing SAP icons. This program also demonstrates the usage of field-symbols in ABAP.

The second program demonstrates how to display the icons in an SAP report. Pay special attention to the comments.

Program 1: ABAP Code to display all the SAP icons.

REPORT ZICONS .
TABLES: ICON.
INCLUDE <ICON>.
FIELD-SYMBOLS: <F>.

SELECT * FROM ICON.
   ASSIGN (ICON-NAME) TO <F>.
   WRITE:   /(5) <F>, 20 '@',21 ICON-ID+1(2),23 '@',ICON-OLENG,
            ICON-BUTTON,ICON-STATUS,ICON-MESSAGE,ICON-FUNCTION,
            ICON-NAME.
ENDSELECT.

Program 2: ABAP Code that demonstrates SAP icons in a report.

REPORT ZREPICON.
INCLUDE <ICON>.
* It is very important to specifiy a field length of minimum 4
* Some icons are wider and require a field length of 5!
WRITE: (5) ICON_GREEN_LIGHT, (4) ICON_LOCKED, (4) ICON_LED_GREEN.

Output


About The Author

从事SAP行业有些年头,对SAP技术稍有了解; 如无特别声明,本博客文章为原创,转载请注明; 博主MSN:xuchunbo0901@hotmail.com; 博主邮箱:bob.xu@abaptech.com。

No Comments

Leave A Reply


注意: 评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。例如, ABC是本文的评论者之一,则使用'@ABC '(不包括单引号)将会自动将您的评论发送给ABC。使用'@all ',将会将评论发送给之前所有其它评论者。请务必注意user必须和评论者名相匹配(大小写一致)。

无觅相关文章插件,快速提升流量