2009 Jan 29 8:39 AM
Hi,
I have a pushbutton to which i need to pass different icons at runtime...
eg:
. when i click on it some activity is performed and the icon in the button is also changed .
Can some one help me.
Hi,
I have a pushbutton to which i need to pass different icons at runtime...
eg:
. when i click on it some activity is performed and the icon in the button is also changed .
Can some one help me.
2009 Jan 29 8:42 AM
Hi
U should insert the pushbuttons on different subscreens: in this u can decide which subscreen to be load in order to show a certain pushbutton.
Max
2009 Jan 29 8:47 AM
you must search the forum, this topic has been answered lots of times. And there are demos in your sap system (se38, environment, examples, abap)
2009 Jan 29 8:49 AM
copy-paste from http://abaplovers.blogspot.com/2008/05/abap-game-tic-tac-toe.html
Edited by: Vijay Babu Dudla on Jan 31, 2009 4:02 AM
2009 Jan 29 8:49 AM
Hi,
Did you want something like this
TABLES: sscrfields.
DATA: butt_sel.
SELECTION-SCREEN: PUSHBUTTON /2(10) but_sel USER-COMMAND test.
AT SELECTION-SCREEN.
CASE sscrfields.
WHEN 'TEST'.
IF butt_sel EQ 0.
butt_sel = 1.
but_sel = '@0H@'.
ELSE.
butt_sel = 0.
but_sel = '@0E@'.
ENDIF.
endcase.
INITIALIZATION.
but_sel = '@0E@'.
butt_sel = 0.Regards
2009 Jan 29 8:51 AM
Hi
In PAI during button click set a flag.
In PBO routine,
write a module that changes the screen display.
Within that check for flag value and modify.
PROCESS BEFORE OUTPUT.
MODULE STATUS_2700.
MODULE CHANGE_SCREEN. "module that changes the screen display
PROCESS AFTER INPUT.
MODULE USER_COMMAND_2700. "set flag value for the button
MODULE CHANGE_SCREEN OUTPUT. " enables and disables my tbl control " modify to change icon
CASE FLAG.
WHEN 1.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_ENA'.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_DIS'.
SCREEN-INVISIBLE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN 2.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_DIS'.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_ENA'.
SCREEN-INVISIBLE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDCASE.
ENDMODULE. " CHANGE_SCREEN OUTPUT
Hope this helps
Regards,
Jayanthi.K
2009 Jan 29 9:01 AM
Hi,
try this short example:
* DB-Tabellen und TYPE-POOLS
TYPE-POOLS: ICON.
*
SELECTION-SCREEN: SKIP.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: PUSHBUTTON 30(30) PB01 USER-COMMAND FB01
VISIBLE LENGTH 15.
SELECTION-SCREEN: END OF LINE.
*
DATA: PB01_INIT(80).
*
AT SELECTION-SCREEN.
*
* Button in Dynpro
IF PB01 = PB01_INIT.
*
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = ICON_CANCEL
TEXT = 'Cancel'
INFO = 'Report cancel'
IMPORTING
RESULT = PB01
EXCEPTIONS
OTHERS = 0.
ELSE.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = ICON_EXECUTE_OBJECT
TEXT = 'Start'
INFO = 'Report ausführen'
IMPORTING
RESULT = PB01
EXCEPTIONS
OTHERS = 0.
ENDIF.
*
INITIALIZATION.
* Button in Dynpro
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = ICON_EXECUTE_OBJECT
TEXT = 'Start'
INFO = 'Report ausführen'
IMPORTING
RESULT = PB01
EXCEPTIONS
OTHERS = 0.
*
PB01_INIT = PB01.
*
************************************************************************
*
START-OF-SELECTION.
*
*
END-OF-SELECTION.
*
************************************************************************
regards, Dieter
2009 Jan 31 9:23 AM
Hi,
Check out this demo program
DEMO_DYNPRO_STATUS_ICONS
Hope this helps.
Regards,
Deepthi.S
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |