<?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: Value of OK-CODE outside the TCode in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150357#M992504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that depends on the memory u use.&lt;/P&gt;&lt;P&gt;if u use SAP memory then per user&lt;/P&gt;&lt;P&gt;if ABAP memory then per internal session &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with call transaction u have one more internal session, so u can use abap memory with out any prob.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Amar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jul 2008 15:15:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-17T15:15:45Z</dc:date>
    <item>
      <title>Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150353#M992500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to call a transaction from within a function module.&lt;/P&gt;&lt;P&gt;When the user finishes with the Transaction, control returns to the function. At this point of time I need to know the last button pressed (OK-CODE) in the transaction screen, (Save, Exit, Back, Quit, Enter or something else)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to code this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Fred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 00:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150353#M992500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T00:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150354#M992501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fred,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that transaction you call is a Z program, so you can add some code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can save OK-CODE value to memory. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add this code at your User_Command:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
export OK_CODE TO MEMORY ID 'OK_CODE_ZXX'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add this code at your FM to get ok_code value:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
import OK_CODE from memory id 'OK_CODE_ZXX'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: &lt;/P&gt;&lt;P&gt;ZXX is your tcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 00:56:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150354#M992501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T00:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150355#M992502</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;You can use either ABAP memory or SAP memory for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ABAP MEMORY&lt;/STRONG&gt;:  EXPORT OK_CODE TO MEMORY ID 'XYZ'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SAP   MEMORY&lt;/STRONG&gt;:  SET PARAMETER ID 'XYZ' FIELD &amp;lt;field_name&amp;gt;&lt;/P&gt;&lt;P&gt;                            GET PARAMETER ID 'XYZ' FIELD &amp;lt;field_name&amp;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;&lt;P&gt;Hope this would help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Murthy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 03:48:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150355#M992502</guid>
      <dc:creator>former_member787646</dc:creator>
      <dc:date>2008-07-17T03:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150356#M992503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jatra, Murthy. (Yes, it is a Z transaction)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering if using a memory id is the best/only way to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How consistent can the memory ids be? Supposing there are multiple users looking at the same transaction, will there be separate and independent memory ids? Are the memory ids created per session, per user?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Fred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 14:02:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150356#M992503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T14:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150357#M992504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that depends on the memory u use.&lt;/P&gt;&lt;P&gt;if u use SAP memory then per user&lt;/P&gt;&lt;P&gt;if ABAP memory then per internal session &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with call transaction u have one more internal session, so u can use abap memory with out any prob.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Amar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 15:15:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150357#M992504</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T15:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150358#M992505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you absolutely will not use ABAP memory, you may encapsulate your inner z transaction in a Function Module that has a return code [1], [2], [3] etc according as what OK_code was pressed. I, probably would not sweat it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 17:37:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150358#M992505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T17:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150359#M992506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Amar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Friends, I need some more help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based upon our higher-up instructions, we need to accomplish this (info transfer in-out of dialog programs) using messages (like in BAPIs) rather than memory ids.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have pasted a sample code from SAPs BAPI.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL TRANSACTION 'PR05' 
     USING  BDCDATA
     OPTIONS FROM OPTIONS.
IF SY-MSGTY IS INITIAL.
*   execution was canceled by the user
    PERFORM SET_RETURN USING 'S' '00' 359
                             SPACE SPACE SPACE SPACE
                             RETURN.
  ELSE.
 IF ( SY-MSGTY EQ 'S' )
       AND ( SY-MSGID EQ '56' )
       AND ( SY-MSGNO EQ 185 ).
* trip sucessful created, tripnumber is in sy-msgv1
      TRIPNUMBER = SY-MSGV1.
    ELSE.
      CLEAR TRIPNUMBER.
    ENDIF. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As you can notice, the BAPI accesses the message created in the TCode PR05 thro SYST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried very similar, called a (Z)Tcode from a (Z)function and tried to access the messages from the transaction in the function module thro SYST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MSGTY, MSGID, MSGNO have values but MSGV1-&amp;gt;4 values get cleared out in the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong or missing? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Fred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 18:04:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150359#M992506</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T18:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150360#M992507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

CALL TRANSACTION 'PR05' USING BDCDATA 
                                       OPTIONS FROM OPTIONS
                                        MESSAGES INTO MESSTAB.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 18:21:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150360#M992507</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-07-17T18:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150361#M992508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, duh!  Thanks a®s pointing that for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After checking some more I realize that the MSGV1-&amp;gt;4 variables were missing bocs the first variable was initial while rest had values. If the first message variable wasnt empty SYST gets filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Fred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 22:07:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150361#M992508</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T22:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Value of OK-CODE outside the TCode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150362#M992509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to hear more reg the last reply I have posted&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 22:09:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/value-of-ok-code-outside-the-tcode/m-p/4150362#M992509</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T22:09:21Z</dc:date>
    </item>
  </channel>
</rss>

