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

Button events

Former Member
0 Likes
739

How to get the button events(NAME) when we clicked it

5 REPLIES 5
Read only

Former Member
0 Likes
710

track the sy-ucomm, this system field holds the value of the current component being clicked.

null

Read only

Former Member
0 Likes
710

hi

good

you can use the following process

1-Create button in the menu painter and create action there itself and use that program at your program.

2-Create a button and use the SY-UCOMM command go getnerate the action and do the action.

thanks

mrutyun^

Read only

Former Member
0 Likes
710

hii vaisalli,

If you mean f codes by enets then you can type sy-ucomm in debugging and see the value of the event clicked,apart from that in your module pool program ok_code will have those values of the current event.

at design time you can go to screen painter and check the value of the fcode of the button,

thanks reward points if useful

Read only

Former Member
0 Likes
710

Hai Chandran,

By using sy-ucomm you can capture the all action done in the screen.Another way is you can get all the event by using SSCRFIELDS-UCOMM.

I give you one sample program for this..you can check it out...

&----


*& Report ZGOPI_SELECTION *

*& *

&----


*& *

*& *

&----


REPORT ZGOPI_SELECTION.

TABLES: SSCRFIELDS,SCREEN.

DATA: FLAG TYPE I.

*DATA: SCREEN1 LIKE TABLE OF SCREEN WITH HEADER LINE.

SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT1.

PARAMETERS: STID(4),

NAME(10),

MARK1(3),

MARK2(3).

SELECTION-SCREEN END OF BLOCK BLK1.

SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT2.

PARAMETERS DETAILS RADIOBUTTON GROUP RAD1 USER-COMMAND USR.

PARAMETERS MARKS RADIOBUTTON GROUP RAD1 DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK BLK2.

SELECTION-SCREEN PUSHBUTTON /50(12) SAVE USER-COMMAND STORE.

*SELECTION-SCREEN PUSHBUTTON /10(12) ACT USER-COMMAND ACTIVE.

*SELECTION-SCREEN PUSHBUTTON /20(12) DEACT USER-COMMAND DEACTIVE.

DATA : BEGIN OF ITAB1 OCCURS 0,

SID(4) TYPE N,

SNAME(10) TYPE C,

END OF ITAB1.

DATA : BEGIN OF ITAB2 OCCURS 0,

SMARK1(3) TYPE N,

SMARK2(3) TYPE N,

END OF ITAB2.

INITIALIZATION.

SAVE = 'STORE' .

TEXT1 = 'STUDENT DETAILS'.

TEXT2 = 'SELECT TYPE'.

AT SELECTION-SCREEN.

IF SSCRFIELDS-UCOMM = 'STORE'.

FLAG = '1' .

IF DETAILS = 'X'.

ITAB1-SID = STID.

ITAB1-SNAME = NAME.

APPEND ITAB1.

ENDIF.

IF MARKS = 'X'.

ITAB2-SMARK1 = MARK1.

ITAB2-SMARK2 = MARK2.

APPEND ITAB2.

ENDIF.

ENDIF.

  • IF SSCRFIELDS-UCOMM = 'ACTIVE'.

  • FLAG = '2'.

  • ENDIF.

AT SELECTION-SCREEN OUTPUT.

IF MARKS = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'STID' OR SCREEN-NAME = 'NAME'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF DETAILS = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'MARK1' OR SCREEN-NAME = 'MARK2'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

END-OF-SELECTION.

LOOP AT ITAB1.

WRITE: / ITAB1-SID, / ITAB1-SNAME.

ENDLOOP.

SKIP 1.

LOOP AT ITAB2.

WRITE: / ITAB2-SMARK1, / ITAB2-SMARK2.

ENDLOOP.

-


You can try this..i hope it will be useful to you...

Thanks & Regards,

Gopinathan.T

Read only

Former Member
0 Likes
710

hi,

cteate a button in se51 [SCREEN PAINTER] then goto attributes section and give

FUNCTION CODE For that button.

when u click oon the button system recognizes by checking the function code that assigned to that button.

ex:

case sy-ucomm.

when 'back'

...............

when 'save'

................

when 'others'

................

endcase.

if helpful reward some points.

with regards,

suresh babu aluri.