Skip to Content

Pushbutton on dynpro in status 'clicked'

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

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

    Hi,

    My suggestion is to use radio button instead.

    Add comment
    10|10000 characters needed 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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 05, 2017 at 07: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.
    
    Add comment
    10|10000 characters needed characters exceeded