Skip to Content
avatar image
Former Member

What is a function Code?

Can anybody tell me What is a Function Code while creating Application tool bar with SET PF-STATUS?

How many function codes are there?

What are they?

if I want to associate a new functionality with a new ICON....can I add custom fuction code or there are only SAP function codes available.....?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Sep 27, 2007 at 11:26 AM

    hi,

    You can have your own custom function code also.It is used to trigger a particular event.for eg .SAVE.Used to save the particular data.

    You need to write a code in event

    Case Sy-ucomm

    When 'SAVE'

    ....your code

    Regards,

    Sangeetha.A

    REgards,

    Sangeetha.a

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 27, 2007 at 11:27 AM

    Hi

    Function code is the CODE assigned to a particular through which the SAP recognises its action.

    It is something like OK code or Sy-UCOMM.

    see the doc of OK CODE

    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:

    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.

    In your application programs, the first step in PAI processing should be to save the function code in an auxiliary variable and then initialize the OK_CODE field. You can then read the function code from the auxiliary variable (for example, using a CASE structure), and control the program flow from there.

    The OK_CODE field can have a different name on each screen. However, common practice is to use the same name for the field on each screen of an ABAP program. You then only need one field in the ABAP program, with the same name, into which the function code is placed, and from which you can read it.

    Refer the link:

    http://help.sap.com/saphelp_47x200/helpdata/en/d1/801e61454211d189710000e8322d00/frameset.htm

    regards

    Anji

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 27, 2007 at 11:28 AM

    Function code is the one which triggers with the pushbutton in the application toolbar to which u assign to it after u click that.

    U can catch that by using SY-UCOMM.

    U can code for taht in SE38.

    U can enter a fn code as u wish. There is no restriction for that.

    U cannot addd any icons.

    <b>Pls reward if helpful.</b>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 27, 2007 at 11:29 AM

    Hi

    FUNCTION CODE means

    when ever you do some action like pressing a button etc... for every action there will be a reaction

    suppose if there is a button you had created on the aplication tool bar in se41

    if you want to invoke that button that will be done by a FUNCTION CODE associated with that button

    and you can write your own FUNCTION CODE , SAP already provided some FUNCTION CODES if you want you can use or other wise yu can creat ur own

    <b>reward if usefull</b>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 27, 2007 at 11:33 AM

    Hi,

    function code are values that are returned by clicking any button in ur application tool bar or button in module-pools programme These vales are compared against sy-ucomm in addition there is one table that stores function code into of standard SAP program table name is - "RSMPTEXTS". u can see function code for the standard sap program SAPLSLVC_FULLSCREEN in SE41 transaction

    Regarding your second query u can add custom function code as in se41 transaction..but for that you have to write extra logic..

    Reward Points if helpful..

    Thanks,

    Puneet Mehta

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 27, 2007 at 11:46 AM
    Add comment
    10|10000 characters needed characters exceeded