10-05-2017 7:44 AM
Hello guys,
is it possible to create a pushbutton on a custom dynpro that gets the status 'clicked'? I mean it should act like a switch button. In normal status it is not clicked and looks like a normal pushbutton. But when clicked, it should be displayed as clicked, means holding the status like the button is activated. I know this from alv toolbar buttons, but did not find any solution on a pushbutton.
Regards
Michael
10-05-2017 8:00 AM
I've never seen that for a dynpro pushbutton. The workaround is to change the icon or text (one way is to use an icon for active/not active, before the text, for instance ICON_WD_RADIO_BUTTON and ICON_WD_RADIO_BUTTON_EMPTY).
EDIT:
REPORT.
TABLES sscrfields.
SELECTION-SCREEN PUSHBUTTON /1(40) xpush000 USER-COMMAND feature VISIBLE LENGTH 21.
LOAD-OF-PROGRAM.
DATA: xpush001(40), xpush002(40).
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_WD_RADIO_BUTTON'
text = 'Feature is ON'
info = 'will do it'
IMPORTING
result = xpush001
EXCEPTIONS
OTHERS = 3.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_WD_RADIO_BUTTON_EMPTY'
text = 'Feature is OFF'
info = 'won''t do it'
IMPORTING
result = xpush002
EXCEPTIONS
OTHERS = 3.
xpush000 = xpush001.
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'FEATURE'.
IF xpush000 = xpush001.
xpush000 = xpush002.
ELSE.
xpush000 = xpush001.
ENDIF.
ENDCASE.
10-05-2017 10:12 AM
Hi,
you can only disalbe not clicked. There is no option as clicked in dynpro pushbutton.
You can do like this :
Before :
After :
Just grey it out.
You can do this by two ways :
Please refer the links :
10-06-2017 7:13 AM