‎2007 May 11 7:37 AM
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
‎2007 May 11 7:41 AM
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,
‎2007 May 11 7:38 AM
‎2007 May 11 7:40 AM
look in PAI process after input for returncodes sy-u(ser)com(mand)
‎2007 May 11 7:40 AM
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
‎2007 May 11 7:40 AM
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
‎2007 May 11 7:40 AM
Hi,
The Function code will be stored in SY-UCOMM system field
Regards
Sudheer
‎2007 May 11 7:41 AM
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,
‎2007 May 11 7:42 AM
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.
‎2007 May 11 7:45 AM
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://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://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://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.sapdevelopment.co.uk/dialog/dialoghome.htm
‎2007 May 11 7:55 AM
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
‎2007 May 11 7:58 AM
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
‎2007 May 11 8:04 AM
It will be captured using ok_code which is in sy-ucomm which is a system variable .