Display and output of icons

Source: Internet
Author: User

1. Define Fields
Data: status_icon type icons-text.

2. Create a screen and create a "status icon" control on the screen definition. The control is named status_icon.

3. Use the icon_create function to set the icon in the output.
Call function 'icon _ create'
Exporting
Name = 'icon _ green_light'
TEXT = 'text displayed after the icons'
Info = 'hup'
Add_stdinf = 'X'
Importing
Result = status_icon
Exceptions
Icon_not_found = 1
Outputfield_too_short = 2
Others = 3.

4. Use the icon_show function to display and list sap icons.
Call function 'icon _ show 'exporting onlydisplay = 'X'
Exceptions no_object_found = 1
No_icon_selected = 2.

5. For an example of the icon, see the sap DEMO code: demo_dynpro_status_icons.

Report demo_dynpro_status_icons.

Data Value Type I value 1.

Data: status_icon type icons-text,
Icon_name (20) type C,
Icon_text (10) type C.

Call screen 100.

Module set_icon output.

Set PF-STATUS 'screen _ 000000 '.

Case value.
When 1.
Icon_name = 'icon _ green_light '.
Icon_text = text-003.
When 2.
Icon_name = 'icon _ yellow_light '.
Icon_text = text-002.
When 3.
Icon_name = 'icon _ red_light '.
Icon_text = text-001.
Endcase.

Call function 'icon _ create'
Exporting
Name = icon_name
TEXT = icon_text
Info = 'status'
Add_stdinf = 'X'
Importing
Result = status_icon
Exceptions
Icon_not_found = 1
Outputfield_too_short = 2
Others = 3.

Case sy-subrc.
When 1.
Message e888 (sabapdocu) with text-004.
When 2.
Message e888 (sabapdocu) with text-005.
When 3.
Message e888 (sabapdocu) with text-006.
Endcase.

Endmodule.

Module cancel input.
Leave program.
Endmodule.

Module change.
Case value.
When 1.
Value = 2.
When 2.
Value = 3.
When 3.
Value = 1.
Endcase.
Endmodule.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.