Application Development and Automation 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: 
Read only

Push button click event

Former Member
0 Likes
8,862

Hi ,

I am using a push button in screen.

What should i do to click event for it.

I want a popup message when i click that button.

How should i proceed.

Regrds,

Priya

6 REPLIES 6
Read only

Former Member
0 Likes
2,422

Priya,

I am assuming you are talking about DIALOG pprogramming.

In the PAI event of the screen, you will have to handle all the function codes. You can assign a function code to the button in the screen editor.

In the PAI.

CASE SY-UCOMM.

WHEN 'PUSH'.

MESSAGE XXXXXXXX

Or call a POPUP function to display a POP UP.

Regards,

Ravi

Read only

0 Likes
2,422

Hi

In the PAI event, you will check which button has been clicked. If the 'next' button is clicked,

display the message.

Rgds,

Jothi.

Read only

venkat_o
Active Contributor
0 Likes
2,422

Hi Priya,

1.

Check this event under Screen Flow Logic .

<b>PROCESS AFTER INPUT.</b>

MODULE USER_COMMAND_1000.

MODULE user_command_1000 INPUT.

okcode = sy-ucomm.

CLEAR sy-ucomm.

CASE okcode.

WHEN 'CHANGE'.

Call Function module

<b>POPUP_TO_CONFORM</b> or

<b>POPUP_DISPLAY_MESSAGE</b>

ENDCASE.

I hope that it helps u .

<b>Thanks,

Venkat.O</b>

Read only

Former Member
0 Likes
2,422

Hi Priya,

I believe that your are using Dialog programming,

1. While creating the button you might have given a function code to that button. Am I right ???

2. Now what ever you do on the screen with the UI elements, the corresponding function code would be captured in the PAI event ( Process After Input) in the system variable sy-ucomm.

3. Now create a module like MODULE_GET_FCODE under the event PROCESS AFTER INPUT.

4. Now check for the sy-ucomm ( This variable will hold the function code of the UI element that you had clicked)

5. Using this variable, you can call FM's like POPUP_TO_CONFIRM etc.,, or else you can handle you own process here.

Hope this clears.

Regs,

Venkat Ramanan

Message was edited by: Venkat Ramanan Natarajan

Read only

Former Member
0 Likes
2,422

Hi Priya,

a) If u r talking about push button on selection-screen,

1)SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON 33(10) pushy USER-COMMAND DISPLAY.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

2) INITIALIZATION.

PUSHY = 'DISPLAY'.

3) AT SELECTION-SCREEN.

CASE sscrfields-ucomm.

WHEN 'DISPLAY'.

Display Message.

ENDCASE.

b) If u r talking about Module pool programming,

1) U would have created a push button on the screen and function code attached to it say it is 'DISPLAY'.

2) In the PAI event

MODULE user_command_xxx INPUT.

CASE sy-ucomm.

WHEN 'DISPLAY'.

Display error message.

ENDCASE.

Hope it will help u in some way. Thank u,

Read only

Former Member
0 Likes
2,422

Hi,

DAta wans type C.

In the PAI.

CASE SY-UCOMM.

WHEN 'PUSH'.

Call the Function Module...

Call function 'POPUP_TO_CONFIRM_STEP'

EXPORTING

textline1 = 'Your Message'

titel = 'FINAL'

cancel_display = ' '

IMPORTING

answer = wans.

if wans = 'J'.

PERFORM get_remarks.

ELSE.

LEAVE TO SCREEN 0.

ENDIF.

Hope it would solve your purpose...

Kindly reward the points...