2008 Feb 05 4:58 AM
can anybody tell me What is a function code? and what is it used for?
2008 Feb 05 5:02 AM
HI,
see when u developed one screen it may contains some buttons that is by clicking on it it performs some action then in the program u know that user has pressed button with the function code assigned to it
see suppose u r screen accepts two nubers and it has two buttons say additon function code is say add
and subtract say function code is sub then if user presse additon then sy-ucomm field will automatically gets this ADD and sub whne perforem subtraction
this is the function code
i think i am clear to u please reward if it is useful...
plzz dont forget to reward if it is useful....
Function code is attached with any GUI items( like push button or radio button or any menu item) so that we can identify those GUI item events ( such click in the push button) in our program and process accordingly.
Ex:
PROGRAM demo_dynpro_push_button .
DATA: ok_code TYPE sy-ucomm,
save_ok LIKE ok_code,
output(8) TYPE c.
CALL SCREEN 100.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BUTTON_EXIT'.
LEAVE PROGRAM.
WHEN 'BUTTON_1'.
output = 'Button 1'(001).
WHEN 'BUTTON_2'.
output = 'Button 2'(002).
WHEN 'BUTTON_3'.
output = 'Button 3'(003).
WHEN 'BUTTON_4'.
output = 'Button 4'(004).
WHEN OTHERS.
output = save_ok.
ENDCASE.
ENDMODULE.
here various ok-codes 'BUTTON_EXIT' , 'BUTTON_1' ect are attached with the push buttons.
2008 Feb 05 5:02 AM
HI,
see when u developed one screen it may contains some buttons that is by clicking on it it performs some action then in the program u know that user has pressed button with the function code assigned to it
see suppose u r screen accepts two nubers and it has two buttons say additon function code is say add
and subtract say function code is sub then if user presse additon then sy-ucomm field will automatically gets this ADD and sub whne perforem subtraction
this is the function code
i think i am clear to u please reward if it is useful...
plzz dont forget to reward if it is useful....
2008 Feb 05 5:03 AM
using Function code system can identify user interaction to perform the action
usually function code stores in SY-UCOMM system variable
Regards
Nagesh.Paruchuri
2008 Feb 05 5:04 AM
friend for every button there are two things defined
1. text over that button
2. function code
function code is that code which gets copied into sy-ucomm whenever u click that button .
it is used in event AT USER COMMAND. when u want certain action on button click
e.g. case sy-ucomm.
when 'BAK'
<code>
when 'ENTER'
<code>
here BAK & ENTER are function codes of two buttons
plz reward if useful
keep rockin
vivek
2008 Feb 05 5:05 AM
Function code is attached with any GUI items( like push button or radio button or any menu item) so that we can identify those GUI item events ( such click in the push button) in our program and process accordingly.
Ex:
PROGRAM demo_dynpro_push_button .
DATA: ok_code TYPE sy-ucomm,
save_ok LIKE ok_code,
output(8) TYPE c.
CALL SCREEN 100.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BUTTON_EXIT'.
LEAVE PROGRAM.
WHEN 'BUTTON_1'.
output = 'Button 1'(001).
WHEN 'BUTTON_2'.
output = 'Button 2'(002).
WHEN 'BUTTON_3'.
output = 'Button 3'(003).
WHEN 'BUTTON_4'.
output = 'Button 4'(004).
WHEN OTHERS.
output = save_ok.
ENDCASE.
ENDMODULE.
here various ok-codes 'BUTTON_EXIT' , 'BUTTON_1' ect are attached with the push buttons.
2008 Feb 05 5:05 AM
Context menu can be used in relation with the various screen elements
like I/O fields, subscreen,group box,table control but not with push buttons,radio,check buttons.
It can be used to show related options when the user right clicks on the screen elements. It is a type of status. SAP automatically creates a default context menu for dialog statuses consisting of all the function codes available
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |