<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: How to deal with multiple SAP logons?	</title>
	<atom:link href="https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/feed/" rel="self" type="application/rss+xml" />
	<link>https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/</link>
	<description>Make your office life easier with simple and fast Excel VBA solutions.</description>
	<lastBuildDate>Wed, 12 Jul 2023 12:59:43 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Tomasz Płociński		</title>
		<link>https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26755</link>

		<dc:creator><![CDATA[Tomasz Płociński]]></dc:creator>
		<pubDate>Wed, 12 Jul 2023 12:59:43 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=884#comment-26755</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26749&quot;&gt;Aman&lt;/a&gt;.

Hello
You need to try to create another session and do what You want to do parallelly there.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26749">Aman</a>.</p>
<p>Hello<br />
You need to try to create another session and do what You want to do parallelly there.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aman		</title>
		<link>https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26749</link>

		<dc:creator><![CDATA[Aman]]></dc:creator>
		<pubDate>Wed, 05 Jul 2023 14:36:24 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=884#comment-26749</guid>

					<description><![CDATA[Hi Tomasz,

I wrote a code for generating report from sap. all the reports work fine when the different vba code is run separately. how can I modify the code to just create a new GUI window and run the transaction normally.

for example
I run a macro, it logs into sap and generates a report. 

what I want to implement is ----

Now I dont want to log out from that session. i want to create a new window and run a different t-code in sap. 

please tell me how can implement that.


Dim SapGuiAuto As Object, Application As Object, Connection As Object, session As Object

   Set SapGuiAuto = GetObject(&quot;SAPGUI&quot;)
   Set Application = SapGuiAuto.GetScriptingEngine
   Set Connection = Application.Children(0)
   Set session = Connection.Children(0)
   
   
session.findById(&quot;wnd[0]&quot;).maximize
session.findById(&quot;wnd[0]/usr/txtRSYST-BNAME&quot;).Text = &#039;I enter login id here
session.findById(&quot;wnd[0]/usr/pwdRSYST-BCODE&quot;).Text = &#039;I enter password here
session.findById(&quot;wnd[0]/usr/pwdRSYST-BCODE&quot;).SetFocus
session.findById(&quot;wnd[0]/usr/pwdRSYST-BCODE&quot;).caretPosition = 11
session.findById(&quot;wnd[0]&quot;).sendVKey 0
session.findById(&quot;wnd[1]/usr/btnBUTTON_1&quot;).press
session.findById(&quot;wnd[0]/tbar[0]/okcd&quot;).Text = &#039;I enter t-code here
session.findById(&quot;wnd[0]&quot;).sendVKey 0


and then the vba code enters the details of that particular sap t-code.]]></description>
			<content:encoded><![CDATA[<p>Hi Tomasz,</p>
<p>I wrote a code for generating report from sap. all the reports work fine when the different vba code is run separately. how can I modify the code to just create a new GUI window and run the transaction normally.</p>
<p>for example<br />
I run a macro, it logs into sap and generates a report. </p>
<p>what I want to implement is &#8212;-</p>
<p>Now I dont want to log out from that session. i want to create a new window and run a different t-code in sap. </p>
<p>please tell me how can implement that.</p>
<p>Dim SapGuiAuto As Object, Application As Object, Connection As Object, session As Object</p>
<p>   Set SapGuiAuto = GetObject(&#8220;SAPGUI&#8221;)<br />
   Set Application = SapGuiAuto.GetScriptingEngine<br />
   Set Connection = Application.Children(0)<br />
   Set session = Connection.Children(0)</p>
<p>session.findById(&#8220;wnd[0]&#8221;).maximize<br />
session.findById(&#8220;wnd[0]/usr/txtRSYST-BNAME&#8221;).Text = &#8216;I enter login id here<br />
session.findById(&#8220;wnd[0]/usr/pwdRSYST-BCODE&#8221;).Text = &#8216;I enter password here<br />
session.findById(&#8220;wnd[0]/usr/pwdRSYST-BCODE&#8221;).SetFocus<br />
session.findById(&#8220;wnd[0]/usr/pwdRSYST-BCODE&#8221;).caretPosition = 11<br />
session.findById(&#8220;wnd[0]&#8221;).sendVKey 0<br />
session.findById(&#8220;wnd[1]/usr/btnBUTTON_1&#8221;).press<br />
session.findById(&#8220;wnd[0]/tbar[0]/okcd&#8221;).Text = &#8216;I enter t-code here<br />
session.findById(&#8220;wnd[0]&#8221;).sendVKey 0</p>
<p>and then the vba code enters the details of that particular sap t-code.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tomasz Płociński		</title>
		<link>https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26698</link>

		<dc:creator><![CDATA[Tomasz Płociński]]></dc:creator>
		<pubDate>Fri, 07 Apr 2023 06:22:40 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=884#comment-26698</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26697&quot;&gt;kamton&lt;/a&gt;.

Thank You :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26697">kamton</a>.</p>
<p>Thank You 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: kamton		</title>
		<link>https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26697</link>

		<dc:creator><![CDATA[kamton]]></dc:creator>
		<pubDate>Fri, 07 Apr 2023 03:17:24 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=884#comment-26697</guid>

					<description><![CDATA[thank for good article]]></description>
			<content:encoded><![CDATA[<p>thank for good article</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tomasz Płociński		</title>
		<link>https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26685</link>

		<dc:creator><![CDATA[Tomasz Płociński]]></dc:creator>
		<pubDate>Fri, 24 Mar 2023 21:29:36 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=884#comment-26685</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26683&quot;&gt;Berkan&lt;/a&gt;.

Hello
I can&#039;t see anything in your code, which is mentioned in article about multilogons.
That should be the reason.
Try to implement any example, eg check number of sessions, check if any additional window pop up etc.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26683">Berkan</a>.</p>
<p>Hello<br />
I can&#8217;t see anything in your code, which is mentioned in article about multilogons.<br />
That should be the reason.<br />
Try to implement any example, eg check number of sessions, check if any additional window pop up etc.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Berkan		</title>
		<link>https://simpleexcelvba.com/how-to-deal-with-multiple-sap-logons/#comment-26683</link>

		<dc:creator><![CDATA[Berkan]]></dc:creator>
		<pubDate>Fri, 24 Mar 2023 15:09:41 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=884#comment-26683</guid>

					<description><![CDATA[Hi,
here is a piece of my code,
it works fine when i am logged in, in one session.
if i run the script again while being logged in,  the window to enter the name and password will pop up, but throw a 619 not found by id error afterwards (error is thrown at the sessionFindById line).
so i cant even get to the multilogon part.
Can you think of any reason for this?

thanks in advance



Sub SAPlogin()

Dim SapGUI As Object
Dim appl As SAPFEWSELib.GuiApplication
Dim session As SAPFEWSELib.GuiSession
Dim WshShell As Object
Dim Conn As SAPFEWSELib.GuiConnection

Shell &quot;C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe&quot;, 4
Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
    WshShell.AppActivate (&quot;SAP Logon&quot;)
    Application.Wait Now + TimeValue(&quot;00:00:08&quot;)
Set WshShell = Nothing



Set SapGUI = GetObject(&quot;SAPGUI&quot;)
Set appl = SapGUI.GetScriptingEngine



Set Conn = appl.OpenConnection(&quot;fullpathname&quot;)

Set Conn = appl.Children(0)
Set session = Conn.Children(0)


session.FindById(&quot;wnd[0]/usr/txtRSYST-BNAME&quot;).Text = &quot;name&quot;
etc...]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
here is a piece of my code,<br />
it works fine when i am logged in, in one session.<br />
if i run the script again while being logged in,  the window to enter the name and password will pop up, but throw a 619 not found by id error afterwards (error is thrown at the sessionFindById line).<br />
so i cant even get to the multilogon part.<br />
Can you think of any reason for this?</p>
<p>thanks in advance</p>
<p>Sub SAPlogin()</p>
<p>Dim SapGUI As Object<br />
Dim appl As SAPFEWSELib.GuiApplication<br />
Dim session As SAPFEWSELib.GuiSession<br />
Dim WshShell As Object<br />
Dim Conn As SAPFEWSELib.GuiConnection</p>
<p>Shell &#8220;C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe&#8221;, 4<br />
Set WshShell = CreateObject(&#8220;WScript.Shell&#8221;)<br />
    WshShell.AppActivate (&#8220;SAP Logon&#8221;)<br />
    Application.Wait Now + TimeValue(&#8220;00:00:08&#8221;)<br />
Set WshShell = Nothing</p>
<p>Set SapGUI = GetObject(&#8220;SAPGUI&#8221;)<br />
Set appl = SapGUI.GetScriptingEngine</p>
<p>Set Conn = appl.OpenConnection(&#8220;fullpathname&#8221;)</p>
<p>Set Conn = appl.Children(0)<br />
Set session = Conn.Children(0)</p>
<p>session.FindById(&#8220;wnd[0]/usr/txtRSYST-BNAME&#8221;).Text = &#8220;name&#8221;<br />
etc&#8230;</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
