<?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 SAP Code not working in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/SAP-Code-not-working/m-p/86033#M36951</link>
    <description>&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="16040.jpg"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/16196i183ED93F5D6279CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="16040.jpg" alt="16040.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I want to select the "* All Cost Elements" from the "wnd[0]/usr/lbl[xx,xx]" which is a variant ,so i have codes likes below :&lt;BR /&gt;&lt;BR /&gt;dim SapGuiAuto as Object&lt;BR /&gt;dim application as Object&lt;BR /&gt;dim connection as object&lt;BR /&gt;Dim session as object&lt;BR /&gt;&lt;BR /&gt;SapGuiAuto = GetObject("SAPGUI")&lt;BR /&gt;application = SapGuiAuto.GetScriptingEngine&lt;BR /&gt;connection = application.Children(0)&lt;BR /&gt;session = connection.Children(0)&lt;BR /&gt;&lt;BR /&gt;Dim i As Integer = 2&lt;BR /&gt;Dim Found As Boolean = False&lt;BR /&gt;Do while not session.findById("wnd[0]/usr/lbl[5," &amp;amp; i &amp;amp; "]") is Nothing And Not Found&lt;BR /&gt; If session.findById("wnd[0]/usr/lbl[5," &amp;amp; i &amp;amp; "]").text = "* All Cost Elements" Then&lt;BR /&gt; Found = True&lt;BR /&gt;session.findById("wnd[0]/usr/lbl[5," &amp;amp; i &amp;amp; "]").setFocus&lt;BR /&gt;session.findById("wnd[0]/usr/lbl[5," &amp;amp; i &amp;amp; "]").caretPosition = 21&lt;BR /&gt;session.findById("wnd[0]").sendVKey (2)&lt;BR /&gt;Else &lt;BR /&gt; i += 1&lt;BR /&gt;End if&lt;BR /&gt;Loop&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But everytime when i run the code ,it will report me "The control could not be found by id." .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV style="position: absolute; display: none; z-index: 16777271;"&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Hao Lu&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Thu, 09 Apr 2020 15:07:00 GMT</pubDate>
    <dc:creator>HaoLu</dc:creator>
    <dc:date>2020-04-09T15:07:00Z</dc:date>
    <item>
      <title>SAP Code not working</title>
      <link>https://community.blueprism.com/t5/Product-Forum/SAP-Code-not-working/m-p/86033#M36951</link>
      <description>&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="16040.jpg"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/16196i183ED93F5D6279CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="16040.jpg" alt="16040.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I want to select the "* All Cost Elements" from the "wnd[0]/usr/lbl[xx,xx]" which is a variant ,so i have codes likes below :&lt;BR /&gt;&lt;BR /&gt;dim SapGuiAuto as Object&lt;BR /&gt;dim application as Object&lt;BR /&gt;dim connection as object&lt;BR /&gt;Dim session as object&lt;BR /&gt;&lt;BR /&gt;SapGuiAuto = GetObject("SAPGUI")&lt;BR /&gt;application = SapGuiAuto.GetScriptingEngine&lt;BR /&gt;connection = application.Children(0)&lt;BR /&gt;session = connection.Children(0)&lt;BR /&gt;&lt;BR /&gt;Dim i As Integer = 2&lt;BR /&gt;Dim Found As Boolean = False&lt;BR /&gt;Do while not session.findById("wnd[0]/usr/lbl[5," &amp;amp; i &amp;amp; "]") is Nothing And Not Found&lt;BR /&gt; If session.findById("wnd[0]/usr/lbl[5," &amp;amp; i &amp;amp; "]").text = "* All Cost Elements" Then&lt;BR /&gt; Found = True&lt;BR /&gt;session.findById("wnd[0]/usr/lbl[5," &amp;amp; i &amp;amp; "]").setFocus&lt;BR /&gt;session.findById("wnd[0]/usr/lbl[5," &amp;amp; i &amp;amp; "]").caretPosition = 21&lt;BR /&gt;session.findById("wnd[0]").sendVKey (2)&lt;BR /&gt;Else &lt;BR /&gt; i += 1&lt;BR /&gt;End if&lt;BR /&gt;Loop&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But everytime when i run the code ,it will report me "The control could not be found by id." .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV style="position: absolute; display: none; z-index: 16777271;"&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Hao Lu&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Apr 2020 15:07:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/SAP-Code-not-working/m-p/86033#M36951</guid>
      <dc:creator>HaoLu</dc:creator>
      <dc:date>2020-04-09T15:07:00Z</dc:date>
    </item>
  </channel>
</rss>

