Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to pass pushbutton values to a function module

Hi all,

I am required  to move a subroutine in main program to a function module but I am unable to pass in the pushbutton . How do I do that?

In main program:

SELECTION-SCREEN BEGIN OF BLOCK blk1.

PARAMETERS message(10) TYPE c.

SELECTION-SCREEN SKIP 2.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 3(5) btn1 user-command cli1 modif id bt1.

SELECTION-SCREEN PUSHBUTTON 8(5) btn2 user-command cli2 modif id bt2.

SELECTION-SCREEN PUSHBUTTON 13(5) btn3 user-command cli3 modif id bt3.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK blk1.


In main program there is many subroutines perform check_button using 'P' or check_button using 'C'.


Form check_button using str type boolean.

IF btn1 = str AND btn2 = str AND btn3 = space.

     btn3 = 'C'.

     disable3 = 'X'.

     count = count + 1.

   ENDIF.

   IF btn1 = str AND btn3 = str AND btn2 = space.

     btn2 = 'C'.

     disable2 = 'X'.

     count = count + 1.

   ENDIF.

   IF btn2 = str AND btn3 = str AND btn1 = space.

     btn1 = 'C'.

     disable1 = 'X'.

     count = count + 1.

   ENDIF.


Endform.



Problem: My function module cannot possible know btn1, btn2 and btn3 values. How do I do it?

Former Member
Not what you were looking for? View more on this topic or Ask a question