<?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: Starting a new session programatically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093346#M1182253</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[new session using program|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23658609]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Feb 2009 11:50:04 GMT</pubDate>
    <dc:creator>GauthamV</dc:creator>
    <dc:date>2009-02-03T11:50:04Z</dc:date>
    <item>
      <title>Starting a new session programatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093343#M1182250</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;What is the best way to start a new session programatically?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I have my logic inside a method (I could also include the logic inside a function). I have a button in my dynpro, and when I click this button, I want that a new session is opened. I think that it is possible to start a new transaction into a new session, but in my case I see it very unnecessary to create a new transaction for something that doesn't really require a transaction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Karri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional requirement: I was wondering that is it also possible to close the session programatically. So when the user has completed his task in the new opened session, the session would close automatically. I think that a bit similar thing happens in SU01 when you go to see the user's authorisations (new session is opened), and if you click "back" after you have checked the authorisations, the session will be closed automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Karri Kemppi on Feb 3, 2009 12:47 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 10:46:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093343#M1182250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T10:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Starting a new session programatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093344#M1182251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create a new session programmatically, call the function &lt;STRONG&gt;TH_CREATE_FOREIGN_MODE&lt;/STRONG&gt; with tcode &lt;STRONG&gt;SESSION_MANAGER&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shailaja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 11:17:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093344#M1182251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T11:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Starting a new session programatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093345#M1182252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an example of starting and ending a session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
START-OF-SELECTION.

  CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
        STARTING NEW TASK 'NewTask'
        DESTINATION 'NONE'
  EXPORTING
    tcode = 'ZLEADS'
    "skip_screen = 'X'
    "mode_val = 'E'
    "update_val = 'A'
*  TABLES
*    using_tab = bdcdata_tab
  EXCEPTIONS
    call_transaction_denied = 1
  OTHERS = 2.


*  additional processing here *

** closes the current session.
  CALL FUNCTION 'TH_DELETE_MODE'
** EXPORTING
**   MODE          = -1
            .


  LEAVE PROGRAM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 11:23:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093345#M1182252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T11:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Starting a new session programatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093346#M1182253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[new session using program|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23658609]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 11:50:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093346#M1182253</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2009-02-03T11:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Starting a new session programatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093347#M1182254</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;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'TH_CREATE_MODE'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this&lt;/P&gt;&lt;P&gt;                                                                                &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'TH_CREATE_MODE'
    EXPORTING
      TRANSAKTION = 'FB03'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 11:57:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093347#M1182254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T11:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Starting a new session programatically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093348#M1182255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, everybody seemed to instruct to use function modules to launch a transaction (which was something I wanted to avoid). Anyhow, I finally included the needed logic into a function module, and used the "NEW TASK" addition when calling the function. This was a perfect solution. Thanks for all answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2009 08:12:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-a-new-session-programatically/m-p/5093348#M1182255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-11T08:12:58Z</dc:date>
    </item>
  </channel>
</rss>

