‎2008 Jun 06 8:19 AM
Hi
Please tell me what is the purpose of the system variable
sy-ucomm.
With regards
Vijay
‎2008 Jun 06 8:23 AM
Hi Vijay,
purpose of the system variable
SAP is assigned with a Function code(User-Command) which is triggered when the user performs the action.
you can find all the system variables and their description in se11 and table name is SYST
The system variables provided by the sap are very useful in coding.
for example if u are interested to print page numbers u can use PAGNO without much effort from the developers side.
They are predefined by SAP and for example to identify the index of an internal table and loop count while debugging and not only for that they have provided for many.
By seeing the SYST table u will be familiar with all those system variables.
and also see the below link for ur quick reference
http://help.sap.com/erp2005_ehp_03/helpdata/EN/7b/fb96c8882811d295a90000e8353423/frameset.htm
Plz rewards points if helpful,
Ganesh.
‎2008 Jun 06 8:31 AM
hi,
sy-ucomm stores all the function codes given by the user.
sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using <pfstatus>
SY-UCOMM IS A system variable. It contains the latest user action triggered. Whereas ok_code is generally a variable that we declare as a type of sy-ucomm. Usually in ABAP programing it is a good practice not to refer to sy-ucomm directly, or sometimes we need to store a user interaction for later validation, these are the scenarios where an ok_code value comes handy.
thanks,
raji
‎2008 Jun 06 8:34 AM
Hi,
SY-UCOMM. UCOMM is nothing but USER COMMAND.
In ABAP , if user presses any button then the system field SY-UCOMM will be set with the buttons function code.
This you will use in the event AT USER-COMMAND .
eg:
at user-command.
case sy-ucomm.
when '/00'.
message 'Hi'.
endcase.
here /00 is the function code of a button. when you click the button the message gets displayed.
some of the codes are
%CTX Call a context menu
%EX Exit
%PC Save to file
%PRI Print
%SC Search for ...
%SC+ Find next
%SL Search in office
%ST Save to report tree
Reward points if helpful.
Thanks and Regards.
‎2008 Jun 06 9:05 AM
Hi,
Every user action in SAP is assigned with a Function code(User-Command) which is triggered when the user performs the action( like push buttons)
and this function codes are stored in the system variable sy-ucomm ,
it comes handy in module pool programming and interactive reports using at user-command event
reward if helpful
prasanth
‎2008 Jun 06 9:17 AM
sy-ucomm is the system variable, which is maintained by the system automatically. U need take care of that variable. U ca find the Function-Code that was pressed on a particular screen.
sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using <pfstatus>.SY-UCOMM Returns the code for the GUI status button pushed (Only only used in lists. In dialog programs use OKCODE)
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.
thanks
‎2008 Jun 11 1:43 PM
hi,
SY-UCOMM Returns the code for the GUI status button pushed (Only only used in lists. In dialog programs use OKCODE)Screens, function code triggered by PAI
‎2008 Jun 12 5:52 AM
hi Vijay,
SY-UCOM store the value of user command
ie back cancel etc
Regards
Amit
‎2008 Jun 24 7:38 AM
Hi,
there are 3 event with interactive list i.e, when user interacts in the list they are AT LINE-SELECTION, AT USER_COMMAND and AT PF <nn>...
whenever this events are triggered a function code is generated which is stored in the system field
sy-ucomm at runtime.
reward points if useful.
with luck,
pritam.
‎2008 Jun 24 7:44 AM
Hi Vijay ,
SAP has defined a System variable sy-ucomm which holds the current function code i.e. User-Command which is triggered when the user performs the action.
For e.g. when user presses some button on the screen then in back ground sy-ucomm holds the value of funtion code associated with that button.
In your program you can check the value and write some processing code against it.
I hope this will help you.
Help children of U.N World Food Program by rewarding points and encourage others to answer your queries.
‎2008 Jun 24 7:46 AM
hi
while working with the PF-STATUS you click a button at the Run time depending on the requirement.
SY-UCOMM is the system variable which is having the Function code of that button which helps us to proceed the execution forward in the interactive list.
Remember that SY-UCOMM only works with the interactive list.
reward points if useful
Regards
Sumit Agarwal
‎2008 Jun 24 7:47 AM
Hi,
In simple SY-UCOMM store the code of the action performed..
And mostly it doesnot store any F4 help codes... ie if u want to trap F4 help while recording its not possible..
SY-UCOMM doesnot store any F4 Help recordings...
Hope you understood the exception as well.
Regards
Narin Nandivada.
‎2008 Jun 24 9:23 AM
hi vijay,
sy-ucomm behaves in the following step.
when user make any interaction in the user-defined pf-status or dialog program , one unique predefined function-code is triggered corrsepnding to the user-action. Sy-ucomm stores the latest value of the trigerred function code.
If there is any coding given in the AT USER-COMMAND event corresponding to this user action , the same is executed.
SY-UCOMM STORES ONLY ONE VALUE AT A TIME AND IT IS THE FUCTION CODE OF LAST USER ACTION.
Reward if find helpful.
Good luck.
Anirban Bhattacharjee
‎2008 Jun 24 10:38 AM
Hi,
Sy-ucomm is a system field used to trigger the actions on user interaction.
Regards.
‎2008 Jun 24 5:04 PM
Hi,
SY-UCOMM stores the Function code that is triggered in the PAI event.
Reward if found helpful.
Warm Regards
R Adarsh
‎2008 Jun 25 6:36 AM
you can use sy-ucomm in dialog program to know which button is pressed on screen but better practise is to use ok_code for that 'coz sy-ucomm value cannot be changed as it is a system variable but ok_code can be changed manually.
define ok_code of type sy-ucomm only.
‎2008 Jun 26 10:00 AM
Hi,
Sy-UCOMM is a variable used to check any user triggered event.
There are 3 types of user events:
1. At Line Selection.
2. At User Command.
3. At Selection Screen.
whenever user perform any of these events, it get stored in Sy-UCOMM.
From thr values of this variable we can recognise the user action.
hope this information will help you.
thanks n regards,
Rajesh kumar.
‎2008 Jun 26 5:11 PM
Hi Vijay.
Your question is very interresting, basic and important.
As this question Judges the perfection of an ABAPer in reports.
SY-UCOMM - This is a system field used in Screen programming
1. Function code that triggers the event PAI (Process After Input). Every user action that triggers PAI is assigned a unique function code, with one exception: Choosing Enter triggers PAI and different function codes can be transferred to SY-UCOMM
2. If there is an entry in the command field of the standard toolbar, this is transferred to SY-UCOMM as the function code.
If there is no entry in the command field and a function code is assigned to the ENTER key, this function code is transferred to SY-UCOMM.
3. If the command field does not contain an entry and no function code is assigned to the ENTER key, it is empty and the content of SY-UCOMM is not affected.
This information is limited to only understanding of basical working. But, It has the most widest of applications in reports.
Feel free to discuss with me any queries.
Reward points if you find this information usefull.
regards
Harsh
‎2008 Jun 26 8:02 PM
Hi Vijay,
SY-UCOMM capture the fuction code triggered from the user..
i will tell u small example...
on any screen you see enter '/h' in the command prompt..
and press enter...
this switches on the debugging...
and after that you perform any action then you will be taken into corresponding program debugging mode.
there you enter in the field SY-UCOMM and press enter..
you will find the corresponding FUNCTION CODE for your action made on the screen..
The above stated process is more helpful while BDC PROGRAMMING
Hope this would help you...
Regards
Narin Nandivada