<?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: Running VB Scripts with SAP GUI from Citrix in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/running-vb-scripts-with-sap-gui-from-citrix/qaa-p/443243#M64521</link>
    <description>&lt;P&gt;Did you start the script on the same Citrix-Server as SAP GUI? Otherwise both will not "see" each other.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rüdiger&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2017 12:20:29 GMT</pubDate>
    <dc:creator>rspecht</dc:creator>
    <dc:date>2017-03-23T12:20:29Z</dc:date>
    <item>
      <title>Running VB Scripts with SAP GUI from Citrix</title>
      <link>https://community.sap.com/t5/technology-q-a/running-vb-scripts-with-sap-gui-from-citrix/qaq-p/443242</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;We are trying to execute a custom made VB Script to perform some actions in SAP after logging in the GUI.&lt;/P&gt;&lt;P&gt;The script works fine when we access SAP from locally installed SAP GUI software. But when we try using the same script on a session of SAP from Citrix server, it does not work.&lt;/P&gt;&lt;P&gt;Sample Script is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start Notepad document. 
Paste content below.  Save as “CoolScript.vbs”&lt;/P&gt;&lt;P&gt;Then once you have that log on
to SAP and leave it with only one session open on the session manager home
screen.&lt;/P&gt;&lt;P&gt;Double click the vbs file to
execute.  It should find your SAP GUI session and open the Project Builder
transaction, then stop.&lt;/P&gt;&lt;P&gt;I would run scripts like this
from our Access DB. For example, the user
would navigate to the specific project and open the study characteristics page
then activate the script.&lt;/P&gt;&lt;P&gt;The script would verify it was
the right project, verify it was on the right screen, then copy the project
legacy number from our system, enter it into the appropriate field in SAP and
also open a new email to client services containing the number.  This
would tie everything together and ensure a perfect match for this very
important reference number.&lt;/P&gt;&lt;P&gt;You should find that when
running GUI locally it connects with no problem (or perhaps a security warning
if set that way).  When using streaming GUI through citrix the scripting
engine cannot find the SAP instance to connect.  There is no “SAPGUI”
object in the registry.&lt;/P&gt;&lt;P&gt;If Not IsObject(application) Then&lt;/P&gt;&lt;P&gt;  Set SapGuiAuto  =
GetObject("SAPGUI")&lt;/P&gt;&lt;P&gt;  Set application = SapGuiAuto.GetScriptingEngine&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(connection) Then&lt;/P&gt;&lt;P&gt;  Set connection = application.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(session) Then&lt;/P&gt;&lt;P&gt;  Set session  =
connection.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If IsObject(WScript) Then&lt;/P&gt;&lt;P&gt;  WScript.ConnectObject session, 
"on"&lt;/P&gt;&lt;P&gt;  WScript.ConnectObject application,
"on"&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").maximize&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]/tbar[0]/okcd").text =
"cj20n"&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey
0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;Jigar Dedhia&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2024 22:02:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/running-vb-scripts-with-sap-gui-from-citrix/qaq-p/443242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2024-02-03T22:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Running VB Scripts with SAP GUI from Citrix</title>
      <link>https://community.sap.com/t5/technology-q-a/running-vb-scripts-with-sap-gui-from-citrix/qaa-p/443243#M64521</link>
      <description>&lt;P&gt;Did you start the script on the same Citrix-Server as SAP GUI? Otherwise both will not "see" each other.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rüdiger&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 12:20:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/running-vb-scripts-with-sap-gui-from-citrix/qaa-p/443243#M64521</guid>
      <dc:creator>rspecht</dc:creator>
      <dc:date>2017-03-23T12:20:29Z</dc:date>
    </item>
  </channel>
</rss>

