04-11-2008 11:41 AM
Hi Experts,
How can we display icons on the selection-screen ..?
one of the methods i heard frm my frnds was to use ->cl_gui_picture_viewer
but as a begginer i am not tht comfortable with classes .So is there a way around to display icons on my selection screen without using classes .
Thanx in Advance,
Regards ,
Rajesh .
04-11-2008 12:24 PM
Hi Rajesh,
Icons occupy 4 char spaces.......it starts with @ and ends with @ ex @01@ is an icon.....
try the foll code
write : '@01@','@02@'.
Goto Icon table in SE16 der first column is icon rite...........
select an icon and copy it (Ctr+c) paste it in ur abap editor ........u ll get the icon name in @XX@ format....
To give texts for parameters in Sel-screens ull write the text goto-->selection texts rite....der wtite the desired icon name (in @XX@ format) followed by text.......
Cheers,
jose.
04-11-2008 11:44 AM
check the code
If you simply want an icon on the screen. You can do something like this.
code
report zrich_0001 .
type-pools: icon.
selection-screen begin of line.
selection-screen comment 1(5) text_001.
parameters: p_werks type marc-werks.
selection-screen end of line.
initialization.
write ICON_PLANT as icon to text_001.
[/code]
one more Example
Report zex33.
type-pools: icon.
selection-screen begin of line.
selection-screen comment 1(20) text_001.
parameters: p_werks type marc-werks.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text_002.
parameters: p_whouse(10).
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text_003.
parameters: p_auart like vbak-auart.
selection-screen end of line.
initialization.
write ICON_PLANT as icon to text_001.
concatenate text_001 text-001 into text_001 separated by space.
write ICON_WAREHOUSE as icon to text_002.
concatenate text_002 text-002 into text_002 separated by space.
write ICON_ORDER as icon to text_003.
concatenate text_003 text-003 into text_003 separated by space.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 11, 2008 4:31 PM
04-11-2008 9:33 PM
Raj...
You could at least tell that your first example belongs to Rich Heilman...Everytime I use a code that is not mine I give the credits to the author...
Greetings,
Blag.
04-11-2008 11:45 AM
type-pools: icon.
selection-screen begin of line.
selection-screen comment 1(20) text_001.
parameters: p_werks type marc-werks.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text_002.
parameters: p_whouse(10).
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text_003.
parameters: p_auart like vbak-auart.
selection-screen end of line.
initialization.
write ICON_PLANT as icon to text_001.
concatenate text_001 text-001 into text_001 separated by space.
write ICON_WAREHOUSE as icon to text_002.
concatenate text_002 text-002 into text_002 separated by space.
write ICON_ORDER as icon to text_003.
concatenate text_003 text-003 into text_003 separated by space.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 11, 2008 4:32 PM
04-11-2008 11:53 AM
Hi,
You might read:
/message/241245#241245 [original link is broken]
Regards,
Sudarsan
04-11-2008 12:14 PM
Hi,
here a short example:
REPORT Z_TEST2.
*
TABLES: SSCRFIELDS. "Felder auf Selektionsbildern
*
INCLUDE .
*
SELECTION-SCREEN: BEGIN OF BLOCK A01 WITH FRAME TITLE MELDUNG1.
*
SELECTION-SCREEN: SKIP 2.
*
*
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 10(04) T_ICON.
SELECTION-SCREEN: END OF LINE.
*
SELECTION-SCREEN: SKIP.
*
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 01(34) T_AUFSD.
PARAMETERS: P_AUFSD AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN: END OF LINE.
*
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 01(34) T_AUFCO.
PARAMETERS: P_AUFCO AS CHECKBOX DEFAULT ' '.
SELECTION-SCREEN: PUSHBUTTON 45(04) PB01 USER-COMMAND SALL.
SELECTION-SCREEN: PUSHBUTTON 50(04) PB02 USER-COMMAND DALL.
SELECTION-SCREEN: END OF LINE.
*
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 01(34) T_AUFCS.
PARAMETERS: P_AUFCS AS CHECKBOX DEFAULT ' '.
SELECTION-SCREEN: END OF LINE.
*
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 01(34) T_AUFPP.
PARAMETERS: P_AUFPP AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN: PUSHBUTTON 45(15) PB03 USER-COMMAND INIT.
SELECTION-SCREEN: END OF LINE.
*
SELECTION-SCREEN: SKIP 2.
*
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: PUSHBUTTON 45(15) PB04 USER-COMMAND ONLI.
SELECTION-SCREEN: END OF LINE.
*
SELECTION-SCREEN: SKIP 2.
*
SELECTION-SCREEN: END OF BLOCK A01.
*
**********************************************************************
AT SELECTION-SCREEN.
*
IF SSCRFIELDS-UCOMM = 'SALL'. "alle selektieren
P_AUFSD = 'X'.
P_AUFCO = 'X'.
P_AUFCS = 'X'.
P_AUFPP = 'X'.
ENDIF.
*
IF SSCRFIELDS-UCOMM = 'DALL'. "alle deselektieren
P_AUFSD = ' '.
P_AUFCO = ' '.
P_AUFCS = ' '.
P_AUFPP = ' '.
ENDIF.
*
IF SSCRFIELDS-UCOMM = 'INIT'. "initialisiern
P_AUFSD = 'X'.
P_AUFCO = ' '.
P_AUFCS = ' '.
P_AUFPP = 'X'.
ENDIF.
*
**********************************************************************
INITIALIZATION.
*
MELDUNG1 = 'Datenbankselektion'.
*
T_ICON = ICON_PRINT.
T_AUFSD = 'Kundenauftrag'.
T_AUFCO = 'Innenauftrag'.
T_AUFCS = 'Serviceauftrag'.
T_AUFPP = 'Fertingungsauftrag'.
*
PB01 = ICON_SELECT_ALL.
PB02 = ICON_DESELECT_ALL.
CONCATENATE ICON_REFRESH 'Initial' INTO PB03.
CONCATENATE ICON_EXECUTE_OBJECT 'Ausführen' INTO PB04.
*
**********************************************************************
*
START-OF-SELECTION.
*
write: / 'Test'.
*
END-OF-SELECTION.
*
**********************************************************************
Regards, Dieter
04-11-2008 12:24 PM
Hi Rajesh,
Icons occupy 4 char spaces.......it starts with @ and ends with @ ex @01@ is an icon.....
try the foll code
write : '@01@','@02@'.
Goto Icon table in SE16 der first column is icon rite...........
select an icon and copy it (Ctr+c) paste it in ur abap editor ........u ll get the icon name in @XX@ format....
To give texts for parameters in Sel-screens ull write the text goto-->selection texts rite....der wtite the desired icon name (in @XX@ format) followed by text.......
Cheers,
jose.