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

module programming

Former Member
0 Likes
1,186

hi experts

In module programming when i click a button on the screen, how to capture which button i clicked in the abap program.

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,165

Hi,

u have to give a function code for each button in screen attributes while creating screens.that function code will be stored in sy-ucomm.and also in the okcode of the screen u are providing in the screen attributes.

rgds,

bharat,

11 REPLIES 11
Read only

Former Member
0 Likes
1,165

hi,

chk the system varaible.

sy-ucomm

Regards

Reshma

Read only

0 Likes
1,165

look in PAI process after input for returncodes sy-u(ser)com(mand)

Read only

Former Member
0 Likes
1,165

hi,

first define the function code for the button in SE51 by clicking the button attributes.

then find out the button clicked by sy-ucomm.

Reward points if it is helpful.

Regards,

Sangeetha.A

Read only

0 Likes
1,165

hi,

you should assign a fcode value for each button which should be different from each other and based on that fcode you will perform the desired action in PAI.

regards,

santosh

Read only

Former Member
0 Likes
1,165

Hi,

The Function code will be stored in SY-UCOMM system field

Regards

Sudheer

Read only

Former Member
0 Likes
1,166

Hi,

u have to give a function code for each button in screen attributes while creating screens.that function code will be stored in sy-ucomm.and also in the okcode of the screen u are providing in the screen attributes.

rgds,

bharat,

Read only

Former Member
0 Likes
1,165

hi,

u have to assign function code for buttons. When u click particular button, it's function code is transferred to the program. Depending on function code triggered u will know the button.

Read only

Former Member
0 Likes
1,165

Hi,

Check these links also :

http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm

http://www.sapdevelopment.co.uk/dialog/dialoghome.htm

http://www.sap-img.com/

http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm

http://www.sapgenie.com/links/abap.htm

http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm

http://help.sap.com/saphelp_47x200/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm

http://www.allsaplinks.com/dialog_programming.html

http://sap.mis.cmich.edu/sap-abap/abap09/

http://www.sapdevelopment.co.uk/dialog/dialoghome.htm

http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm

http://sap.mis.cmich.edu/abap-00/

http://www.allsaplinks.com/files/using_table_in_screen.pdf

http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm

http://www.sapgenie.com/links/abap.htm

http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm

http://www.sapdevelopment.co.uk/dialog/dialoghome.htm

http://help.sap.com

http://www.sapgenie.com/abap/example_code.htm

http://help.sap.com/saphelp_47x200/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm

http://www.allsaplinks.com/dialog_programming.html

http://www.sapbrain.com/TUTORIALS/default.html

http://www.sappoint.com/abap/spmp.pdf

http://sappoint.com/abap.html

http://www.sap-img.com/abap.htm

http://sap.ittoolbox.com/code/archives.asp?i=10&t=450&a=t

http://www.sapdevelopment.co.uk/dialog/dialoghome.htm

http://www.sap-img.com/abap/

http://www.sapdevelopment.co.uk/dialog/dialoghome.htm

http://www.sap-img.com/

http://www.sappoint.com/faq/faqdiapr.pdf

http://www.allsaplinks.com/dialog_programming.html

Read only

Former Member
0 Likes
1,165

Hi Ganesh,

If you are using ur own menu for the program then, you need to assign a function code for every button in se41 and when a user clicks on any of the button then the function code gets stored in system variable SY-UCOMM. In your module pool program (PAI of that screen). you can write associated opertaion which you need to perform when user clicks on that button.

example.

you have created a save button on the screen and assigned SAVE as a function code to it. Then in PAI (MODULE USER_COMMAND_<Screen number>) . you can check SY-ucomm and assign operation at that click.

case SY-UCOMM.

when 'SAVE'.

<insert a record to any table>/<Update any table>/<Any operation>

endcase.

Regards,

Vamsi

Read only

Former Member
0 Likes
1,165

hi ganesh,

Assign the FUNCTION CODE for the button in SE51 by clicking the button attributes or Pressing F3 function key. and when u click on the button then sytem variable SY_UCOMM holds the FUNCTION CODE for that button and in your REPORT program give condition [when u wanna use as]

if sy-ucomm = 'FUNCTION CODE' [in single quotations as treate as a string ]

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

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

endif.

or

CASE SY_UCOMM.

when 'FUNCTION CODE '.

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

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

endcase.

then find out the button clicked by sy-ucomm.

Reward points if it is helpful.

Regards,

suresh babu aluri

Read only

Former Member
0 Likes
1,165

It will be captured using ok_code which is in sy-ucomm which is a system variable .