<?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: Control Cannot be Found by ID - C# SAP GUI SCRIPTING in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/control-cannot-be-found-by-id-c-sap-gui-scripting/qaa-p/11721195#M4385240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case someone encounters this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ID for the tab, returned by the VB Script from the Macro Recorder was "wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01". Even using the Scripting Tracker, I got the same ID. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to navigate successfully to the Overview GuiTabStrip, "wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW". I did a SelectedTab.ID, stored it in a string and noticed that the returned value was "wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\\01"&lt;/P&gt;&lt;P&gt;So there was two "\\" before the "01", instead of just one, like the macro recorder and the Scripting Tracker returned. I added that "\" and now I can access the text field just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why this happens, I have no idea. &lt;SPAN __jive_emoticon_name="shocked" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_macro jive_emote" src="https://community.sap.com/108/images/emoticons/shocked.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:55:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-06-15T17:55:49Z</dc:date>
    <item>
      <title>Control Cannot be Found by ID - C# SAP GUI SCRIPTING</title>
      <link>https://community.sap.com/t5/technology-q-a/control-cannot-be-found-by-id-c-sap-gui-scripting/qaq-p/11721194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having the following issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've was able to link my C# application to an open SAP Session, select the transaction (VA01), and fill some fields - the ones at the beginning of the overview window. But:&lt;/P&gt;&lt;P&gt;the problem occurs in the same overview page, there is a sub-window with different tabs (Sales, Item Overview, etc).&lt;/P&gt;&lt;P&gt;When I run the macro script I get the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;session.findById("wnd[0]").maximize&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/txtVBKD-BSTKD").text = "12345"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/ctxtVBAK-ZZOPRECDATE").text = "15.06.2016"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/ctxtVBAK-ZZOPRECDATE").setFocus&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/ctxtVBAK-ZZOPRECDATE").caretPosition = 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code is translated in my C# code like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;((GuiTextField)GlobalVariables.SAPSession.ActiveWindow.FindById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/txtVBKD-BSTKD")).Text = EmployeeID_VALUE.Text;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((GuiTextField)GlobalVariables.SAPSession.ActiveWindow.FindById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/ctxtVBAK-ZZOPRECDATE")).Text = DateTime.Today.ToString("dd.MM.yyyy");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The first line is a field located at the top of the overview page, the second one is inside the tabbed window. The first line runs fine, an employee ID is entered in the SAP GUI application, but the code fails on the 2nd line, where the field inside the tabbed window is located.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Here's a picture of the window (the one marked red is the one that fails in code):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Any ideas as to what might be wrong in the code or configuration?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/975586" width="450" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 15:23:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/control-cannot-be-found-by-id-c-sap-gui-scripting/qaq-p/11721194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-15T15:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Control Cannot be Found by ID - C# SAP GUI SCRIPTING</title>
      <link>https://community.sap.com/t5/technology-q-a/control-cannot-be-found-by-id-c-sap-gui-scripting/qaa-p/11721195#M4385240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case someone encounters this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ID for the tab, returned by the VB Script from the Macro Recorder was "wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01". Even using the Scripting Tracker, I got the same ID. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to navigate successfully to the Overview GuiTabStrip, "wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW". I did a SelectedTab.ID, stored it in a string and noticed that the returned value was "wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\\01"&lt;/P&gt;&lt;P&gt;So there was two "\\" before the "01", instead of just one, like the macro recorder and the Scripting Tracker returned. I added that "\" and now I can access the text field just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why this happens, I have no idea. &lt;SPAN __jive_emoticon_name="shocked" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_macro jive_emote" src="https://community.sap.com/108/images/emoticons/shocked.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/control-cannot-be-found-by-id-c-sap-gui-scripting/qaa-p/11721195#M4385240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-15T17:55:49Z</dc:date>
    </item>
  </channel>
</rss>

