Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Pushbutton on dynpro in status 'clicked'

Missschaaa
Participant
0 Kudos

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

3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

Former Member

Hi,

My suggestion is to use radio button instead.