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

fcode

Former Member
0 Likes
3,124

what is fcode and when,where and how is it used ?

5 REPLIES 5
Read only

Former Member
0 Likes
1,734

Hi,

Fcode is function code.

Mainly used in dialogue programming and menubar.

EG.

If you have created any push button in application toolbar. How program will know that a specific push button is pressed.

via fcode.

hence in program logic we shall put desired code for pushbutton when fcode is called.

*MARK all helpful answers

Read only

Former Member
0 Likes
1,734

Hi sarika,

1. Whenever the user does some action

eg.

a) presses ENTER

b) presses some BUTTON on screen,

c) presses some Toolbar button

d) presses some radiobutton/checkbox,

2. then some SIGNAL / CODE

is generated,

so that we can DETECT which button the user has pressed.

3. Such SIGNAL/CODE

gets stored in SY-UCOMM.

(this is called as fcode = function code)

regards,

amit m.

Read only

Former Member
0 Likes
1,734

Not sure in what context you are talking. But usually you have FCODE associated with all the menu items / buttons that you have on the screen. You need to know these codes in order to write a BDC program.

Regards,

Ravi

Read only

Former Member
0 Likes
1,734

Hi,

Fcode is normally used to allow user interaction.

If you press any Push button or u select any menu option, or icons in Standard tool bar, The function code will be set to SY-UCOMM. This is a system variable. Using this u can write ur logic.

ex.If-sy-ucomm eq 'DISP'.

perform disply.

If sy-ucomm eq 'SAVE'.

perform savecode.

Regds,

Vinsa.R

Read only

Former Member
0 Likes
1,734

In each PAI event that a user triggers by choosing either a pushbutton on the screen or an element in a GUI status, the corresponding <b>function code</b> is placed into the system field syst-ucomm or sy-ucomm and placed in the OK_CODE field (as long as the function code is not empty). Empty function codes are placed in neither the sy-ucomm field nor the OK_CODE field.

In the Screen Painter, you can assign a function code (up to 20 characters long) to checkboxes and radio buttons. When a function code is assigned to a checkbox or radio button, clicking it not only changes the field contents, but also triggers the PAI event and places the function code in the OK CODE field.

Have a look at below links. It will surelu give you the idea abt how to use and where to use fcodes:

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbaa1335c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/e6/83a0375b5dd003e10000009b38f8cf/content.htm

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers