<?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: sy-ucomm and okcode in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466794#M833205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sy-ucomm is for doing the functions what the user wishes to do at that particular&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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 field instead of SY-UCOMM.&lt;/P&gt;&lt;P&gt;There are two reasons for this: Firstly, the ABAP program has full control over&lt;/P&gt;&lt;P&gt;fields declared within it, and secondly, you should never change the value of an&lt;/P&gt;&lt;P&gt;ABAP system field.However, you should also always initialize the OK_CODE field in&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;SY-UCOMM receive the contents of the corresponding screen fields in the PAIevent,&lt;/P&gt;&lt;P&gt;their contents are also assigned to the OK_CODE screen field and system field &lt;/P&gt;&lt;P&gt;SYST-UCOMM in the PBO event.Therefore, you must clear the OK_CODE field in the&lt;/P&gt;&lt;P&gt;ABAP program to ensure that the function code of a screen is not already filled&lt;/P&gt;&lt;P&gt;in the PBO event with an unwanted value. This is particularly important when the&lt;/P&gt;&lt;P&gt;next PAI event can be triggered with an empty function code(for example, using ENTER).&lt;/P&gt;&lt;P&gt;Empty function codes do not affect SY-UCOMM or the OK_CODE field,and consequently,&lt;/P&gt;&lt;P&gt;the old field contents are transported.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Mar 2008 06:31:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-12T06:31:54Z</dc:date>
    <item>
      <title>sy-ucomm and okcode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466793#M833204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one tell me what is the difference between &lt;/P&gt;&lt;P&gt;sy-ucomm and okcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;uday&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 06:30:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466793#M833204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T06:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: sy-ucomm and okcode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466794#M833205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sy-ucomm is for doing the functions what the user wishes to do at that particular&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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 field instead of SY-UCOMM.&lt;/P&gt;&lt;P&gt;There are two reasons for this: Firstly, the ABAP program has full control over&lt;/P&gt;&lt;P&gt;fields declared within it, and secondly, you should never change the value of an&lt;/P&gt;&lt;P&gt;ABAP system field.However, you should also always initialize the OK_CODE field in&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;SY-UCOMM receive the contents of the corresponding screen fields in the PAIevent,&lt;/P&gt;&lt;P&gt;their contents are also assigned to the OK_CODE screen field and system field &lt;/P&gt;&lt;P&gt;SYST-UCOMM in the PBO event.Therefore, you must clear the OK_CODE field in the&lt;/P&gt;&lt;P&gt;ABAP program to ensure that the function code of a screen is not already filled&lt;/P&gt;&lt;P&gt;in the PBO event with an unwanted value. This is particularly important when the&lt;/P&gt;&lt;P&gt;next PAI event can be triggered with an empty function code(for example, using ENTER).&lt;/P&gt;&lt;P&gt;Empty function codes do not affect SY-UCOMM or the OK_CODE field,and consequently,&lt;/P&gt;&lt;P&gt;the old field contents are transported.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 06:31:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466794#M833205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T06:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: sy-ucomm and okcode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466795#M833206</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;the sy-ucomm value of the screen is placed in the okcode of that screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 06:34:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466795#M833206</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T06:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: sy-ucomm and okcode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466796#M833207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK_CODE 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;SY-UCOMM - 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;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;P&gt;codedata : save_ok type sy-ucomm.[/code]&lt;/P&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;&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;&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;P&gt;&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;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4771950"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 06:35:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466796#M833207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T06:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: sy-ucomm and okcode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466797#M833208</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;/P&gt;&lt;P&gt;sy-ucomm is nothing but it 'll get user command for a particular object from screen that u hav declared in okcode.&lt;/P&gt;&lt;P&gt;it is used in progarm level.&lt;/P&gt;&lt;P&gt;okcode. it is the field tht gets value from the screen which action has selected... then u have to transfer the value to sy_ucomm to process next task.&lt;/P&gt;&lt;P&gt;it is used in screen level&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;Arunprasad.P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 06:38:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466797#M833208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T06:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: sy-ucomm and okcode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466798#M833209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uday and srinivaalu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not the correct place for showign your friendship's and all. I am seeing 3 threads uday u r asking the question srinivasalu giviing the answers. Uday u r putting the mark as like 10 . U r not concentrating other experts answers also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So dont cheat others valuable informations and their timings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really if u r having the doubts ask properly and validate the answers given by all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This forum is not showing your friendship's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sankar M&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 06:51:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-and-okcode/m-p/3466798#M833209</guid>
      <dc:creator>p291102</dc:creator>
      <dc:date>2008-03-12T06:51:07Z</dc:date>
    </item>
  </channel>
</rss>

