출처: https://answers.sap.com/questions/6901690/iconcreate-on-button-on-a-screen.html
ICON_CREATE on button on a screen | SAP Community
Dear expers, I have a requirement to expand and collaspe a subscreen on click of a button. But i stuck in changing the icon of a button on every click. I have a example to change the icon of a button on selection screen but its not working on a screen with
answers.sap.com
원문:
Former Member
Jan 11, 2010 at 06:30 AM
Hi,
The example Report Program explains you how to use the code for changing the ICON for a text. But in the function module documentation of the ICON_CREATE, it is clearly mentioned that the same can be used to change the ICON of the Push Button also.
Code Snippet:
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = icon_name
text = icon_text
info = 'Status'
add_stdinf = 'X'
IMPORTING
result = push_btn
EXCEPTIONS
icon_not_found = 1
outputfield_too_short = 2
OTHERS = 3.
push_btn should be the name of the Push button on the Screen. And change the property of it to Output enabled. And then execute the code. it will change the Icon of the Push button dynamically.
have a look at the following link:
http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba9a635c111d1829f0000e829fbfe/content.htm
"Pushbuttons have a label - the text that you specify statically in the attributes - and can also have icons. If you set the Output field attribute for a pushbutton, you can also set its text dynamically in the ABAP program. To do this, you must create a field in the ABAP program with the same name as the pushbutton. You must then assign the required text to the field before the screen is displayed. You can also assign icons to dynamic texts on pushbuttons by including the icon code in the text. The icon codes are all contained in the include program <ICON>. For example, the ICON_CANCEL () icon has the code @0W@." - This explains that you can change the icon of the Push button.
Hope this helps.
Thanks,
Samantak.
'SAP > ABAP Function & Method' 카테고리의 다른 글
(ABAP F&M) CREATE_DYNAMIC_TABLE Method (0) | 2021.07.07 |
---|---|
(ABAP F&M) DDIF_FIELDINFO_GET Function (0) | 2021.07.07 |
(ABAP F&M) FILE_SAVE_DIALOG Function (0) | 2021.07.05 |
(ABAP F&M) GUI_UPLOAD Function (0) | 2021.07.05 |