<?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 OK_CODE For ENTER and Scroll key in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784977#M1308934</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;when ever i press ENTER button in the module pool screen i need to capture the action code for that, because i suppose to do some action. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need the same for scroll button also. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help me in this . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reg, &lt;/P&gt;&lt;P&gt;Hariharan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jul 2009 06:43:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-03T06:43:48Z</dc:date>
    <item>
      <title>OK_CODE For ENTER and Scroll key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784977#M1308934</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;when ever i press ENTER button in the module pool screen i need to capture the action code for that, because i suppose to do some action. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need the same for scroll button also. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help me in this . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reg, &lt;/P&gt;&lt;P&gt;Hariharan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 06:43:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784977#M1308934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-03T06:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: OK_CODE For ENTER and Scroll key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784978#M1308935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check in the PF-STATUS if ok_code is set for ENTER and use the same.&lt;/P&gt;&lt;P&gt;Incase not try with =ENT or =00.&lt;/P&gt;&lt;P&gt;For scroll bar check if it works with the page up and page down button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 06:52:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784978#M1308935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-03T06:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: OK_CODE For ENTER and Scroll key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784979#M1308936</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;can you just explain me in detail of the PF-status creation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how we assign the OK_CODE in PF-status please give me a step by step procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reg,&lt;/P&gt;&lt;P&gt;hariharan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 07:03:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784979#M1308936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-03T07:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: OK_CODE For ENTER and Scroll key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784980#M1308937</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;I have never found an SY-UCOMM value for ENTER. What I get to do is, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a GUI Status, in the Function keys, create a function code for any of the function key, say 'ENTER' for the Enter function key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This essentially means that you have assigned a Function code 'ENTER' for the user action Enter. Now, you can start coding away with IF SY-UCOMM EQ 'ENTER'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, for Scroll Up and Scroll Down, I will give you the links of some useful threads&lt;/P&gt;&lt;P&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="7357935"&gt;&lt;/A&gt;]&lt;/P&gt;&lt;P&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="7530823"&gt;&lt;/A&gt;]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 07:06:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784980#M1308937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-03T07:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: OK_CODE For ENTER and Scroll key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784981#M1308938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;SE51 IN screen painter select the sSCREEN NO and PGM.select "Layout", DRAG AND DROP THE  check box and doube click it.In popup specfiy the Fctcode.Ex name 'chec'&lt;/P&gt;&lt;P&gt;DECLARATION.&lt;/P&gt;&lt;P&gt;DATA:OK_CODE LIKE SY-UCOMM.&lt;/P&gt;&lt;P&gt;CALLING &lt;/P&gt;&lt;P&gt;CASE OK_CODE.&lt;/P&gt;&lt;P&gt;  WHEN 'CHEC'.&lt;/P&gt;&lt;P&gt;  messgae 'Check box' type 'I'.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STATUs CREATION&lt;/P&gt;&lt;P&gt;SE41 CREATE MENU PAINTER &lt;/P&gt;&lt;P&gt;specift pgm and status creat a menu for the requirement  &lt;/P&gt;&lt;P&gt;SET PF-STATUS 'STANDARD'.--&amp;gt;MENU PAINTER&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 07:29:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784981#M1308938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-03T07:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: OK_CODE For ENTER and Scroll key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784982#M1308939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hariharan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pressing &lt;EM&gt;ENTER&lt;/EM&gt; returns empty function code in PAI, so you can just check &lt;EM&gt;OK_CODE = space&lt;/EM&gt; . This is why you need to (at the beggining of PAI) save value of OK_CODE and then clear it. It can still hold value of previous action and if you later ENTER was pressed, the value would be incorrect. Do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- create a screen, go to &lt;EM&gt;Element list&lt;/EM&gt; tab type &lt;STRONG&gt;OK_CODE&lt;/STRONG&gt; in empty field (column NAME) next to value &lt;STRONG&gt;OK&lt;/STRONG&gt; (column TYPE).&lt;/P&gt;&lt;P&gt;- in program declare corresponding data object with name OK_CODE, so the value will be transported between screen and program&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"in program
data: ok_code like sy-ucomm. "this OK_CODE var will hold function code of triggered action on screen
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;- write PBO and PAI modules in screen flow logic and corresponding ones in ABAP program&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"in screen flow logic
PROCESS BEFORE OUTPUT.
  MODULE PBO. 
 
PROCESS AFTER INPUT.
  MODULE PAI.

"in ABAP program
MODULE PBO OUTPUT.
   "here you can set your GUI status 
   SET PF-STATUS space.  "using  SPACE will set default GUI status
ENDMODULE.

"now in PAI
MODULE PAI INPUT.
   "here you need to capture ok_code value in order to know what was the action
   data: save_ok like sy-ucomm. "our help var 
 
    save_ok = ok_code. "first remeber what was triggered
    clear ok_code.    "now clear the contenet of ok_code to be able to catch ENTER action (as mentioned above) 
  
    "now check if empty
     if save_ok = space.   "ENTER was hit 
        "react here accordingly
     endif.   
ENDMODULE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For more information please refer [Reading Function Codes|http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaa1335c111d1829f0000e829fbfe/frameset.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 07:44:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ok-code-for-enter-and-scroll-key/m-p/5784982#M1308939</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-07-03T07:44:44Z</dc:date>
    </item>
  </channel>
</rss>

