<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: difference between ok_code and sy-ucomm in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002392#M709307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following links for the difference between ok-code and sy-ucomm&lt;/P&gt;&lt;P&gt;Reward points if helpful. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/sy-ucomm-and-ok-code-in-dialog-program.htm" target="test_blank"&gt;http://www.sap-img.com/abap/sy-ucomm-and-ok-code-in-dialog-program.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechies.com/difference-between-sy-ucomm-and-ok_code-in-dialog-program/" target="test_blank"&gt;http://www.saptechies.com/difference-between-sy-ucomm-and-ok_code-in-dialog-program/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geekinterview.com/question_details/46351" target="test_blank"&gt;http://www.geekinterview.com/question_details/46351&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Nov 2007 05:22:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-01T05:22:47Z</dc:date>
    <item>
      <title>difference between ok_code and sy-ucomm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002389#M709304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; Can any one tell me the difference between ok_code and sy-ucomm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2007 12:00:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002389#M709304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-31T12:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: difference between ok_code and sy-ucomm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002390#M709305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Actually OK_CODE and SY-Ucomm are the same. But experts suggest use of OK code for following reason:&lt;/P&gt;&lt;P&gt;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 function code 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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2007 13:50:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002390#M709305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-31T13:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: difference between ok_code and sy-ucomm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002391#M709306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;both are same (ok_code and sy-ucomm ) &lt;/P&gt;&lt;P&gt;we will actually store ok_code = sy-ucomm &lt;/P&gt;&lt;P&gt;As actual programing std we should not compare system variables direclty &lt;/P&gt;&lt;P&gt;so we need to store it in some local variable and compare the user command so ok_code we need to compare.&lt;/P&gt;&lt;P&gt;There is no diffrence in ok_code and sy-ucomm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2007 05:18:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002391#M709306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-01T05:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: difference between ok_code and sy-ucomm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002392#M709307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following links for the difference between ok-code and sy-ucomm&lt;/P&gt;&lt;P&gt;Reward points if helpful. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/sy-ucomm-and-ok-code-in-dialog-program.htm" target="test_blank"&gt;http://www.sap-img.com/abap/sy-ucomm-and-ok-code-in-dialog-program.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechies.com/difference-between-sy-ucomm-and-ok_code-in-dialog-program/" target="test_blank"&gt;http://www.saptechies.com/difference-between-sy-ucomm-and-ok_code-in-dialog-program/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geekinterview.com/question_details/46351" target="test_blank"&gt;http://www.geekinterview.com/question_details/46351&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2007 05:22:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002392#M709307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-01T05:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: difference between ok_code and sy-ucomm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002393#M709308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sy-ucomm, Ok_code and local variable. They must be used in the reverse order. I mean declare a local variable like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : save_ok type sy-ucomm.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and transfer the contents of ok_code to save_ok. Use save_ok in your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason save_ok is your variable there is no chance of system automatically resetting it. Where as if you use Ok_code which is global to the entire module pool program system may automatically change the variable in another screen and you may get un-known result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now coming to Sy-ucomm its system variable global to all programs. Hence system may change it any time in any program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence to avoid confusion we must use these in the order of preference given below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;local variable (Save_ok) ---&amp;gt; Ok_code -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; sy-ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful,&lt;/P&gt;&lt;P&gt;Aleem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2007 08:02:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002393#M709308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-01T08:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: difference between ok_code and sy-ucomm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002394#M709309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;STRONG&gt;OK_CODE&lt;/STRONG&gt; is for Batch input session to enter the key strokes that simulate actions to move from once screen to another. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SY-UCOMM -&lt;/STRONG&gt; is the user input value/key pressed by user used in Interactive reporting...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward points if usefull to u,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;fareedas&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 10:23:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002394#M709309</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T10:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: difference between ok_code and sy-ucomm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002395#M709310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Difference between sy-ucomm Vs OKcode&lt;/P&gt;&lt;P&gt;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 &amp;lt;pfstatus&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok_code is generally used in screen as of I have used. You will define the function in the screen. and you can use it in the main program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok_code acts just as a temporary variable that stores the value of sy-ucomm. &lt;/P&gt;&lt;P&gt;When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your ABAP programs, you should work with the OK_CODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="412361"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="209142"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="250732"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 10:28:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-ok-code-and-sy-ucomm/m-p/3002395#M709310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T10:28:34Z</dc:date>
    </item>
  </channel>
</rss>

