Skip to Content
0

Pushbutton on dynpro in status 'clicked'

Oct 05, 2017 at 06:44 AM

37

avatar image

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 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

avatar image
Former Member Oct 06, 2017 at 06:13 AM
1

Hi,

My suggestion is to use radio button instead.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 05, 2017 at 09:12 AM
-1

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 :

https://archive.sap.com/discussions/thread/1480331

https://archive.sap.com/discussions/thread/84401


capture.png (3.9 kB)
capture.png (3.8 kB)
Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi Oct 05, 2017 at 07:00 AM
0

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.

qcira.png (2.1 kB)
nvbmu.png (2.0 kB)
Share
10 |10000 characters needed characters left characters exceeded