2008 May 06 2:10 PM
HI ALL,
I want to add a icon in the selection screen.
Please send the sample code.Answers will be rewarded.
thanks in advance......
HI ALL,
I want to add a icon in the selection screen.
Please send the sample code.Answers will be rewarded.
thanks in advance......
2008 May 06 2:15 PM
Hello,
See this:
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_100'.
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.
Search for the DEMO_DYNPRO_STATUS_ICONS program in your system.
Regards,
2008 May 06 2:16 PM
where do you want the icon? on the toolbar? On the screen in the input area?
When you push this icon, do you want it to do something like.. a Push Button?
2008 May 07 6:08 AM
Yes, when I click the icon,the out put should get displayed....
2008 May 06 2:17 PM
Sandeep,
Below sample code will help to put icon in selection screen
INCLUDE: <icon>.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(20) v_text FOR FIELD p_rfc.
PARAMETERS : p_rfc LIKE rfcdes-rfcdest DEFAULT 'D10CLNT888'.
SELECTION-SCREEN COMMENT 60(04) v_icon FOR FIELD p_rfc.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
v_text = 'RFC Destination'.
v_icon = '@12@'. "icon_test.
Define your comment V_ICON and during initialization fill it with values of the corresponding icon you wish to display on the selection-screen.
regards
Saravanan
2008 May 06 2:24 PM
Just as an FYI in the above code, because you used the INCLUDE <icon> statement, this line
v_icon = '@12@'. "icon_test.
can be done this way
v_icon = ICON_TEST. "icon_test.
Safer in the even SAP changes these values.
2008 May 06 2:38 PM
Hi Sandeep,
To add Icon on selection screen...Just do the following :
GO TO --> Text Elements --> Selection Text
Now give the reqired ICON ID before your selection text.
You will get the Icon on selection screen.
You can get the Icon ID from Type Group ICON in se11.
Reward points, if useful..
Regards,
Nitin.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |