<?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>Question Re: VBA Scripting - How to script SAPGUI logon WITHOUT SSO? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/vba-scripting-how-to-script-sapgui-logon-without-sso/qaa-p/12455108#M4664868</link>
    <description>&lt;P&gt;Thank you for
visiting SAP Community to get answers to your questions. Since this is your
first question, I recommend that you familiarize yourself with our Q&amp;amp;A
Tutorial: &lt;A href="https://developers.sap.com/tutorials/community-qa.html"&gt;https://developers.sap.com/tutorials/community-qa.html&lt;/A&gt;,
as it provides tips for preparing questions that draw responses from our
members. Should you wish, you can revise your question by selecting Actions,
then Edit.&lt;/P&gt;&lt;P&gt;By adding a picture
to your profile you encourage readers to respond: &lt;A href="https://www.youtube.com/watch?v=46bt1juWUUM"&gt;https://www.youtube.com/watch?v=46bt1juWUUM&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jun 2021 16:42:46 GMT</pubDate>
    <dc:creator>former_member34</dc:creator>
    <dc:date>2021-06-08T16:42:46Z</dc:date>
    <item>
      <title>VBA Scripting - How to script SAPGUI logon WITHOUT SSO?</title>
      <link>https://community.sap.com/t5/technology-q-a/vba-scripting-how-to-script-sapgui-logon-without-sso/qaq-p/12455107</link>
      <description>&lt;P&gt;Hello-&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;&lt;STRONG&gt;Root Cause:&lt;/STRONG&gt; Our unit has transitioned to mandatory Single Sign-On (SSO) and deactivated/deleted the non-SSO connection.&lt;/LI&gt;
   &lt;LI&gt;&lt;STRONG&gt;What I know:&lt;/STRONG&gt; I can manually right click (or Shift+Enter) to get to the Context Menu of the SSO connection in order to "SNC Logon without Single Sign-On". &lt;/LI&gt;
   &lt;LI&gt;&lt;STRONG&gt;What I need:&lt;/STRONG&gt; I have a script that uses a protected ID/pw to run a transaction that I don't want all 200 people to have full access to so I need to be able to have the code open the non-SSO connection on any user's computer.&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;&lt;STRONG&gt;My question: How can I script the right-click action on the SAPGUI logon pad?&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1946617-sso-right-click.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;My code is here:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;"PAG - North American AG Production (006)" = &lt;STRONG&gt;non-SSO&lt;/STRONG&gt; connection (&lt;EM&gt;this was deactivated&lt;/EM&gt;)&lt;/LI&gt;
   &lt;LI&gt;"PAG - North American AG Production (SSO)" = SSO connection Dim SapGui&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;PRE&gt;&lt;CODE&gt;    Dim Applic
    Dim Connection
    Dim Session
    Dim WSHShell

    Shell "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe", vbNormalFocus

    Set WSHShell = CreateObject("WScript.Shell")

    Do Until WSHShell.AppActivate("SAP Logon ")
        DoEvents
        Application.Wait Now + TimeValue("0:00:01")
    Loop
    
    Set WSHShell = Nothing
    Set SapGui = GetObject("SAPGUI")
    Set Applic = SapGui.GetScriptingEngine
    Set Connection = Applic.OpenConnection("PAG - North American AG Production (006)", True)
    Set Session = Connection.Children(0)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Jun 2021 16:42:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/vba-scripting-how-to-script-sapgui-logon-without-sso/qaq-p/12455107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2021-06-08T16:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Scripting - How to script SAPGUI logon WITHOUT SSO?</title>
      <link>https://community.sap.com/t5/technology-q-a/vba-scripting-how-to-script-sapgui-logon-without-sso/qaa-p/12455108#M4664868</link>
      <description>&lt;P&gt;Thank you for
visiting SAP Community to get answers to your questions. Since this is your
first question, I recommend that you familiarize yourself with our Q&amp;amp;A
Tutorial: &lt;A href="https://developers.sap.com/tutorials/community-qa.html"&gt;https://developers.sap.com/tutorials/community-qa.html&lt;/A&gt;,
as it provides tips for preparing questions that draw responses from our
members. Should you wish, you can revise your question by selecting Actions,
then Edit.&lt;/P&gt;&lt;P&gt;By adding a picture
to your profile you encourage readers to respond: &lt;A href="https://www.youtube.com/watch?v=46bt1juWUUM"&gt;https://www.youtube.com/watch?v=46bt1juWUUM&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 16:42:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/vba-scripting-how-to-script-sapgui-logon-without-sso/qaa-p/12455108#M4664868</guid>
      <dc:creator>former_member34</dc:creator>
      <dc:date>2021-06-08T16:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Scripting - How to script SAPGUI logon WITHOUT SSO?</title>
      <link>https://community.sap.com/t5/technology-q-a/vba-scripting-how-to-script-sapgui-logon-without-sso/qaa-p/12455109#M4664869</link>
      <description>&lt;P&gt;Hi Grace,&lt;/P&gt;&lt;P&gt;many years ago I solved a similar requirement with a workaround, which I will present here now:&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    Dim Applic
    Dim Connection
    Dim Session
    Dim WSHShell

    Shell "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe", vbNormalFocus

    Set WSHShell = CreateObject("WScript.Shell")

    Do Until WSHShell.AppActivate("SAP Logon ")
        DoEvents
        Application.Wait Now + TimeValue("0:00:01")
    Loop
   
    WSHShell.sendkeys "^{HOME}"  
    Application.Wait Now + TimeValue("0:00:01")
    WSHShell.sendkeys "+{ENTER}"
    Application.Wait Now + TimeValue("0:00:04")
    
    Set WSHShell = Nothing
    Set SapGui = GetObject("SAPGUI")
    Set Applic = SapGui.GetScriptingEngine
    'Set Connection = Applic.OpenConnection("PAG - North American AG Production (006)", True)
    Set connection = Applic.Children(0)
    Set Session = Connection.Children(0)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards, ScriptMan&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 08:06:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/vba-scripting-how-to-script-sapgui-logon-without-sso/qaa-p/12455109#M4664869</guid>
      <dc:creator>script_man</dc:creator>
      <dc:date>2021-06-14T08:06:23Z</dc:date>
    </item>
  </channel>
</rss>

