Skip to Content
-1

How to create pushbutton with dynamic function?

Hi, all!

I am solving the following problem.

I have a one field and a few buttons (pushbuttons). I need a dynamic buttons. This means - in case I click on a button, the button copy its contents into field directly.

Thx for your help! ;-)

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Aug 09, 2017 at 07:39 AM

    Hello,

    You should have a look in SE80 on package SABAPDEMOS. You will find there a lot of useful samples. For example programs DEMO_DYNPRO_PUSH_BUTTON, DEMO_SEL_SCREEN_FUNCTION_KEY or DEMO_SEL_SCREEN_PUSHBUTTON.

    On a selection screen you could do something like that :

    PARAMETERS p_fill(10).
    SELECTION-SCREEN :
    BEGIN OF BLOCK b1 WITH FRAME,
       BEGIN OF LINE,
          PUSHBUTTON 2(10) butd USER-COMMAND del1,
          PUSHBUTTON 15(10) but1 USER-COMMAND p1,
          END OF LINE,
          END  OF BLOCK b1.
    
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'DEL1'.
          CLEAR p_fill.
        WHEN 'P1'.
          CONCATENATE p_fill '1' INTO p_fill.
      ENDCASE.
    

    Best regards

    Bertrand

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 08, 2017 at 02:39 PM

    Report screen, Dialog or ALV ?

    Are yo talking about the buttons text ?

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 09, 2017 at 07:06 AM

    Report screen.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 09, 2017 at 07:55 AM

    Problem was solved. Thx ;-)

    Add comment
    10|10000 characters needed characters exceeded