‎2006 Mar 17 10:14 AM
Hi,
I've a push button on a screen with ICON_DATA_AREA_COLLAPSE icon name.
I pretend to change the name of the icon in run time (to ICON_DATA_AREA_EXPAND/COLLAPSE ), is it possibile? How?
I'm on 4.6c
Thanks in advance,
Maria João Rocha
‎2006 Mar 17 10:31 AM
Hai Rocha,
This link gives you the details and a model code..
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba9a635c111d1829f0000e829fbfe/content.htm
Regards,
Srikanth.
‎2006 Mar 17 10:26 AM
Hi maria,
1. Not only the icon will change,
but also the whole screen
can collapse / expand
It works fantastic.
2. just copy paste this in new program.
REPORT abc.
INCLUDE icons.
DATA : iv TYPE i,
in TYPE i.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETER : a(10) TYPE c MODIF ID m2.
PARAMETER : b(10) TYPE c MODIF ID m2.
PARAMETER : c(10) TYPE c MODIF ID m2.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
SELECTION-SCREEN PUSHBUTTON /1(4) p1 USER-COMMAND btn1.
SELECTION-SCREEN:
BEGIN OF LINE,
COMMENT 1(3) text-001 MODIF ID m1,
POSITION 8.
PARAMETERS:date10 LIKE rpctaxin-taxdt MODIF ID m1,
bank10(60) TYPE c MODIF ID m1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN:
BEGIN OF LINE,
COMMENT 1(3) text-001 MODIF ID m1,
POSITION 8.
PARAMETERS:date11 LIKE rpctaxin-taxdt MODIF ID m1,
bank11(60) TYPE c MODIF ID m1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b2.
*----
INITIALIZATION.
iv = 1.
in = 0.
AT SELECTION-SCREEN OUTPUT.
IF iv = 0.
WRITE icon_collapse AS ICON TO p1(4).
ENDIF.
IF iv = 1.
WRITE icon_expand AS ICON TO p1(4).
ENDIF.
LOOP AT SCREEN.
WRITE : screen-name , screen-group1.
IF screen-group1 = 'M1'.
screen-invisible = iv.
screen-input = in.
*SCREEN-INPUT = V.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*----
AT SELECTION-SCREEN.
IF iv = 1.
iv = 0.
in = 1.
ELSE.
iv = 1.
in = 0.
ENDIF.
regards,
amit m.
‎2006 Mar 17 10:31 AM
Hai Rocha,
This link gives you the details and a model code..
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba9a635c111d1829f0000e829fbfe/content.htm
Regards,
Srikanth.
‎2006 Mar 17 10:34 AM
Thanks,
but i'm not using a selection-screen, i'm using a screen with several objects.
I know that i can do a loop, endloop, and change several fields of the screen, like screen-input, etc.
I'de like to change the icon of the button!
Best Regards,
Maria João Rocha
‎2006 Mar 17 10:43 AM
hello Maria,
if you are using the class cl_gui_toolbar for creating the buttons.
then you can change icon of the button using the method.
SET_BUTTON_INFO
regards,
kinshuk
‎2006 Mar 17 11:08 AM
Hi again,
1.
DATA : active_s01(50) TYPE c.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_CHECKED'
IMPORTING
RESULT = active_s01
EXCEPTIONS
OTHERS = 0.
<b>Move active_s01 to Myicon.</b>
(where myicon is on screen)
regards,
amit m.
‎2015 Nov 16 7:17 AM
‎2006 Mar 17 11:33 AM
Thanks all,
Srikanth,
I've read the help, but i can't malke it work!
I've declared a variable with the same name of the button.
Can you please detail the steps to follow?
Example:
screen 100 - Button1
ABAP
Data: Button1(4) value '@xx@'. "Is it OK?
...?
Thanks,
Maria João Rocha
‎2006 Mar 17 11:41 AM
Hai Rocha,
At the initialization itself declare the variable,and then st selection screen, dynamically change the name accoding to the condition required............
yap what you tried is correct...
Regards,
Srikanth.
‎2006 Mar 17 11:50 AM
Thanks again.
Srikanth,
I haven't a selection-screen, but a normal screen.
But it works
According with the help, it worked!
Example:
screen 100
1 - Declare - Button1 (push button)
2 - Set the output field, at the element list
ABAP
Data: Button1(4) value '@xx@'. "xx corresponds to the pretended icon
PBO:
if ...
button1 = '@xx@'.
else.
button1 = '@yy@'.
endif.
Thanks,
Maria João Rocha