<?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: Why the OKCODE is set automatically? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113445#M1510069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI, &lt;/P&gt;&lt;P&gt;I think wen u select the row ur cursor might be on the button of table control , so wen u press enter the okcode = msg is triggered&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Jul 2010 08:31:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-03T08:31:53Z</dc:date>
    <item>
      <title>Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113439#M1510063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table control in the screen and I set the select column for the table control.The first column of the table control is a button(OKCODE is MSGI)  column , we use this button to generate a screen(we call it messages screen) to display the error messages of the corresponding  line item in the table control. Actually the program works well as far as I had countered below problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is:&lt;/P&gt;&lt;P&gt;when I entry the data in the table control, and then I select one row and the selected row in table control is highlighted(become yellow). And then I press the ENTER key in keyboard, but It is strange that the message screen is displayed. I debug the program and I found that the OK CODE is automatically set to the message button(OKCODE MSGI). But in the whole process I had not click this button. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was confused by this problem. Please any friends had countered this problem and you can give me some idea to solved this problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: I clear the okcode and sy-ucomm at last the PAI process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gangrong Chen on Jul 2, 2010 1:59 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jul 2010 05:59:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113439#M1510063</guid>
      <dc:creator>former_member249594</dc:creator>
      <dc:date>2010-07-02T05:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113440#M1510064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please try with the below logic,&lt;/P&gt;&lt;P&gt; In the PAI module user_command:&lt;/P&gt;&lt;P&gt;    Data: g_save_ok_code type sy-ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	G_save_ok_code = ok_code.&lt;/P&gt;&lt;P&gt;	Clear 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;/P&gt;&lt;P&gt;Then check the variable g_save_ok_code instead of ok_code in the block.&lt;/P&gt;&lt;P&gt;I had the same issue and it got solved once I did like above. Hope, your problem is also the similar one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Selva K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jul 2010 09:32:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113440#M1510064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-02T09:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113441#M1510065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to clear your ok code while PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;rea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jul 2010 10:27:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113441#M1510065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-02T10:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113442#M1510066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to GUI status -&amp;gt; Function keys -&amp;gt; Give function code 'ENTER' for first button (previous to SAVE button)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now execute your program and press ENTER button, henceforth OKCODE will always have function code 'ENTER' so it will never affect your logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Amol&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jul 2010 10:55:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113442#M1510066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-02T10:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113443#M1510067</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;  Thanks very much for your kindly response. I had tried your idea but I am sorry that my issue is still not solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am afraid that I should give up handling this issue, because I found that the standard SAP program have this problem as well. For example, we change the purchase odrder item through ME22N,  if the PO items have error mesage then the Status button column of the table control will show a led-red icon to indicate the status of the line item. Now if you select this line item and press ENTER, the message screen will be shown out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jul 2010 05:50:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113443#M1510067</guid>
      <dc:creator>former_member249594</dc:creator>
      <dc:date>2010-07-03T05:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113444#M1510068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if I follow, but basically pressing ENTER key triggers &lt;STRONG&gt;empty&lt;/STRONG&gt; function code. This means that if there was previous function code value in OK_CODE you would be getting the same value each time after you press ENTER. So I think this is a matter of clearing the OK_CODE each time at the end of PAI and evaluate real function code value in some addtional SAVE_OK data object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer &lt;A href="http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaa1335c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaa1335c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;.&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>Sat, 03 Jul 2010 07:25:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113444#M1510068</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-07-03T07:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113445#M1510069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI, &lt;/P&gt;&lt;P&gt;I think wen u select the row ur cursor might be on the button of table control , so wen u press enter the okcode = msg is triggered&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jul 2010 08:31:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113445#M1510069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-03T08:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113446#M1510070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its not automatically set, after previous assignment of ok code its not cleared.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jul 2010 17:11:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113446#M1510070</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-07-03T17:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113447#M1510071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am afraid that I have to agree with Madhukar Shetty 's idea.&lt;/P&gt;&lt;P&gt;Below is my code of user-command modue in PAI.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*PAI*
PROCESS AFTER INPUT.
  CALL SUBSCREEN : left_sel,
                   right_sel,
                   window .
  MODULE user_command_2000.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE user_command_2000 INPUT.
  save_ok_code = ok_code.
  CLEAR ok_code.
  PERFORM user_command_2000.
  CLEAR save_ok_code.
ENDMODULE.                 " USER_COMMAND_2000  INPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM user_command_2000.
  CASE save_ok_code.
    WHEN zfisc_s_okcode-is_execute OR zfisc_s_okcode-is_re_execute.
      PERFORM select_data.
    WHEN zfisc_s_okcode-is_back OR
         zfisc_s_okcode-is_up   OR
         zfisc_s_okcode-is_cancel.
      PERFORM leave_program.
    WHEN zfisc_s_okcode-is_save.
      PERFORM save_entry.
    WHEN zfisc_s_okcode-is_dbclick.
    WHEN zfisc_s_okcode-is_change_display_shift.
      PERFORM shift_display_change_mode.
    WHEN zfisc_s_okcode-is_check.
      PERFORM check_all_entries.
    WHEN zfisc_s_okcode-is_check_item          OR
         zfisc_s_okcode-is_wbs_range               OR
         zfisc_s_okcode-is_display_item_msg     OR
         zfisc_s_okcode-is_delete_single_item    OR
         zfisc_s_okcode-is_release_single_item.
      PERFORM handle_single_entry.
  ENDCASE.
ENDFORM.                    " USER_COMMAND_2000
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first column in table control is a message button and the function code is &lt;STRONG&gt;&lt;EM&gt;zfisc_s_okcode-is_display_item_msg&lt;/EM&gt;&lt;/STRONG&gt;(a constant defined in type-pool &lt;STRONG&gt;&lt;EM&gt;ZFISC&lt;/EM&gt;&lt;/STRONG&gt; ). If the item is selected in table control and then you press ENTER in keyboard, the subroutine &lt;STRONG&gt;&lt;EM&gt;PERFORM handle_single_entry&lt;/EM&gt;&lt;/STRONG&gt; is triggered. The &lt;STRONG&gt;&lt;EM&gt;ok_code&lt;/EM&gt;&lt;/STRONG&gt; is cleared in PAI, so I do not think it is a metter of clearing ok_code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 18:12:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113447#M1510071</guid>
      <dc:creator>former_member249594</dc:creator>
      <dc:date>2010-07-07T18:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why the OKCODE is set automatically?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113448#M1510072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;JUST CLOSE THE THREAD&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 08:12:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-the-okcode-is-set-automatically/m-p/7113448#M1510072</guid>
      <dc:creator>former_member249594</dc:creator>
      <dc:date>2010-07-08T08:12:34Z</dc:date>
    </item>
  </channel>
</rss>

