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

SY-UCOMM and OK_CODE

Former Member
0 Likes
263

Hi All,

I have got a simple question that I would like to clarify. In report program, the function code will be assigned to both SY-UCOMM and OK_CODE field defined in the screen. I would like to know what's the purpose of making two different versions of the same value? Why shouldn't I access the sy-ucomm directly instead? If so, I can skip saving the OK_CODE to a temporary variable and clearing it up.

Regards,

Alex

1 REPLY 1
Read only

Former Member
0 Likes
242

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

"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."

Edited by: Alex Lau on Apr 24, 2009 10:38 AM