<?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: Regarding Ok Code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749111#M1113894</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;First give a name to the ok_code field in the elements list of the screen, then declare a variable in the program with the same name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in PAI write as;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;clear copy_ok_code.
copy_ok_code = ok_code.
clear ok_code.

case copy_ok_code.
when 'CREATE'.
call screen 9010.
....
...
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this and revert back.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Oct 2008 11:41:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-31T11:41:19Z</dc:date>
    <item>
      <title>Regarding Ok Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749109#M1113892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to dialog programming. I have created a dialog program which is having a screen with two radiobuttons and one push button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Push button is having fun code name- Create&lt;/P&gt;&lt;P&gt;and OK which has name OK_CODE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written following code on PAI MODULE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM  Z82426_DP_ASSIGN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data  ok_code      TYPE sy-ucomm.        " command field&lt;/P&gt;&lt;P&gt;data  copy_ok_code LIKE ok_code.        " copy of ok_code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  USER_COMMAND_9000  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module USER_COMMAND_9000 input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; copy_ok_code = OK_CODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR OK_CODE.&lt;/P&gt;&lt;P&gt;  OK_CODE = sy-ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CASE  copy_ok_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHEN 'CREATE' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL SCREEN 9010.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmodule.                 " USER_COMMAND_9000  INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but still pushing the button is not calling any screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Smita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 11:22:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749109#M1113892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T11:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Ok Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749110#M1113893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The OK_CODE should be defined in the Element list of the screen 9000, only then the OK_CODE will have the value 'CREATE', or any other function code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 11:26:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749110#M1113893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T11:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Ok Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749111#M1113894</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;First give a name to the ok_code field in the elements list of the screen, then declare a variable in the program with the same name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in PAI write as;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;clear copy_ok_code.
copy_ok_code = ok_code.
clear ok_code.

case copy_ok_code.
when 'CREATE'.
call screen 9010.
....
...
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this and revert back.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 11:41:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749111#M1113894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T11:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Ok Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749112#M1113895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Smita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any reason to write the code as below&lt;/P&gt;&lt;P&gt;copy_ok_code = OK_CODE.&lt;/P&gt;&lt;P&gt;CLEAR OK_CODE.&lt;/P&gt;&lt;P&gt;OK_CODE = sy-ucomm.&lt;/P&gt;&lt;P&gt;CASE copy_ok_code. ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write like this &lt;/P&gt;&lt;P&gt;Data: ok_code like sy-ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case ok_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When ' create'.&lt;/P&gt;&lt;P&gt;call screen 9010.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!&lt;/P&gt;&lt;P&gt;VEnk@&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 12:12:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749112#M1113895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T12:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Ok Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749113#M1113896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But sap recommends to use an intermediate variable to store and branch user commands. Also it will avoid unnecessary retention of  a Function code in the ok_code variable. &lt;/P&gt;&lt;P&gt;For example in some cases after pressing a button and then when you press Enter or do any other action the Fcode of the button will be passed, so the above code will avoid that situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can verify the same in all the example code given in &lt;STRONG&gt;ABAPDOCU&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 12:36:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749113#M1113896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T12:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Ok Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749114#M1113897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Karthik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the information. I am accepting your suggestion.&lt;/P&gt;&lt;P&gt;And i will try to implement the concept when i am in use of the discussed concept.&lt;/P&gt;&lt;P&gt;Thanks once again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!&lt;/P&gt;&lt;P&gt;VEnk@&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2008 13:57:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749114#M1113897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-31T13:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Ok Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749115#M1113898</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;If you got the solution please mark the question as answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 11:32:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749115#M1113898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T11:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Ok Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749116#M1113899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Smita, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you declared the OK_CODE field in the screen 9000? The rest of the code seemed fine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just put a debug point and see what exactly is going on. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also have a look at the following demo ABAP reports which is handling the same Function Code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DEMO_DYNPRO_PUSH_BUTTON.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Search SE38 with &lt;STRONG&gt;DYNPRO&lt;/STRONG&gt; and you will get all the example code for the dynpro  programing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Samantak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Nov 2008 09:01:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ok-code/m-p/4749116#M1113899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-05T09:01:43Z</dc:date>
    </item>
  </channel>
</rss>

