Спасибо большое за ссылку. Так и есть – ошибка GUI Scripting «Control ID not found«.
Относительные/полные-тех имена полей оказвается зависят от настройки подключения Low/High Speed Connection соответсвенно.
И, как вишенка на торт, «изящное решение» (спойлер — его нет):
Code:
To ensure that you do not get this error, record the script in a system that has the same connection speed setting as the system where the script will be run. To view the connection speed settings, right-click the system name in the SAP Logon Pad, click Properties, and then click Network. The connection speeds are listed under Network Settings.
Руки бы вынуть разработчикам этого «подукта».
Еще немного текста из ссылки.
Code:
Depending on the SAP system connection speed, the field names are represented differently in the recorded GUI Scripting script. If Low Speed Connection is selected, the fields will be represented using relative naming. If High Speed Connection is selected, the fields will be represented with their full technical names.
A script that is recorded in a Low Speed Connection system will fail when it is executed in a High Speed Connection system. When the script reaches the screen that contains the first field, it will likely return a «Control ID not found» error in the log for the first field.
In the example below, rows 6 and 7 (customer and company code) are represented differently in the recordings carried out in different SAP clients:
Relative field names (Low Speed Connection)
Full technical field names (High Speed Connection)
For more information, refer to the following SAP Notes:
— 587202 Restrictions when using SAP GUI scripting
— 161053 Using SAP GUI in WAN
Hello everyone, I need help in vbs code below, I am trying to run but always have problems in bold line and the message in SAP is «The control could not be found by id», I count on your help to solve this problem. Thank you!
Sub Consumo_SAP()
If Not IsObject(Applicationa) Then
Set SapGuiAuto = GetObject(«SAPGUI»)
Set Applicationa = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(Connection) Then
Set Connection = Applicationa.Children(0)
End If
If Not IsObject(session) Then
Set session = Connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, «on»
WScript.ConnectObject Application, «on»
End If
session.findById(«wnd[0]»).maximize
session.findById(«wnd[0]/tbar[0]/okcd»).Text = «mb51»
session.findById(«wnd[0]»).sendVKey 0
session.findById(«wnd[0]/tbar[1]/btn[17]»).press
session.findById(«wnd[1]/usr/txtV-LOW»).Text = «DISPINSUMOS»
session.findById(«wnd[1]/usr/txtENAME-LOW»).SetFocus
session.findById(«wnd[1]/usr/txtENAME-LOW»).caretPosition = 8
session.findById(«wnd[1]»).sendVKey 8
session.findById(«wnd[0]/usr/ctxtBUDAT-LOW»).Text = «01.09.2013»
session.findById(«wnd[0]/usr/ctxtBUDAT-HIGH»).Text = «02.09.2013»
session.findById(«wnd[0]/usr/ctxtBUDAT-HIGH»).SetFocus
session.findById(«wnd[0]/usr/ctxtBUDAT-HIGH»).caretPosition = 10
session.findById(«wnd[0]/tbar[1]/btn[8]»).press
session.findById(«wnd[0]/tbar[1]/btn[48]»).press
session.findById(«wnd[0]»).sendVKey 33
session.findById(«wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cmbG51_USPEC_LBOX»).SetFocus
session.findById(«wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell»).currentCellRow = 142
session.findById(«wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell»).firstVisibleRow = 133
session.findById(«wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell»).selectedRows = «142»
session.findById(«wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell»).clickCurrentCell
session.findById(«wnd[0]/mbar/menu[0]/menu[1]/menu[2]»).Select
session.findById(«wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]»).Select
session.findById(«wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]»).SetFocus
session.findById(«wnd[1]/tbar[0]/btn[0]»).press
session.findById(«wnd[1]/usr/ctxtDY_PATH»).SetFocus
session.findById(«wnd[1]/usr/ctxtDY_PATH»).caretPosition = 0
session.findById(«wnd[1]»).sendVKey 4
session.findById(«wnd[1]/tbar[0]/btn[0]»).press
session.findById(«wnd[0]/tbar[0]/btn[3]»).press
session.findById(«wnd[0]/tbar[0]/btn[3]»).press
session.findById(«wnd[0]/tbar[0]/btn[3]»).press
- Remove From My Forums
-
Вопрос
-
I create site and for the very first time when I navigate there I got exception:
System.Web.HttpException: The DataSourceID of ‘TopNavigationMenuV4’ must be the ID of a control of type IHierarchicalDataSource. A control with ID ‘topSiteMap’ could not be found.
Second load and other are without any problems.
Martin —————————————————- Martin Pawlas, MCTS, MCP
Ответы
-
Hi Martin,
I came across the same error in my development server, the issue got resolved by removing Unwanted solution packages deployed to my SSP web application. Not sure if the same can help you but i would suggest you can give a try.
Regards,
Paramesh.
-
Помечено в качестве ответа
28 ноября 2011 г. 1:40
-
Помечено в качестве ответа
-
#1
Hello there,
We’ve been running this VBA Macro for a while then it suddenly stopped working. I tried to specify the ‘session.StartTransaction’ window again, but it still doesn’t work as it runs into ‘Error 619: Control could not be found by ID.
Here’s the script:
The debug stops at this line when the error message occurs:
session.findById(«wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT1/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/subSUBSCREEN_BUTTONS:SAPMV45A:4050/btnBT_MKAL»).press Set SapGuiAuto = GetObject(«SAPGUI»)
Set App = SapGuiAuto.GetScriptingEngine
Set Connection = App.Children(0)
Set session = Connection.Children(0)
lr
= Cells(Rows.Count, «A»).End(xlUp).Row
For i = 2 To lr
session
.findById(«wnd[0]»).maximize
session.startTransaction «/nVA02»
session.findById(«wnd[0]/usr/ctxtVBAK-VBELN»).Text = Cells(i, 1)
session.findById(«wnd[0]»).sendVKey 0
session.findById(«wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT1/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/subSUBSCREEN_BUTTONS:SAPMV45A:4050/btnBT_MKAL»).press
session.findById(«wnd[0]/mbar/menu[1]/menu[1]/menu[0]»).Select session.findById(«wnd[1]/usr/cmbRV45A-S_ABGRU»).Key = «11»
session.findById(«wnd[1]/tbar[0]/btn[7]»).press If session.ActiveWindow.Name = «wnd[2]» Then
session.findById(«wnd[2]/tbar[0]/btn[0]»).press
End If
session
.findById(«wnd[0]/tbar[0]/btn[11]»).press
Cells(i, 2) = session.findById(«wnd[0]/sbar»).Text
Next i End Sub
- Remove From My Forums
-
Question
-
User-1033120923 posted
Hi All,
I’ve got a page with an update panel and a place holder where I load a web user control. Inside of the web user control is a checkbox that I want to trigger the CheckChanged event for. I’ve been trying to solve the problem of triggering
this event and this is the closest solution I’ve come up with (this is inside of a for loop adding multiple instances of oLine):Page.Form.FindControl(«phDetail»).Controls.Add(oLine)
Dim t As New AsyncPostBackTrigger()
t.ControlID = oLine.AppCheckBox.ClientID
t.EventName = «CheckedChanged»
Me.udpDetails.Triggers.Add(t)Me.ScriptManager1.RegisterAsyncPostBackControl(oLine.AppCheckBox)
In the above, oLine is the web user control and AppCheckBox is a property that returns the checkbox in the control that I want to work with. The problem I am getting when the above code runs is the error «A control with ID ‘ctl06_cbApprove’ could not
be found for the trigger in UpdatePanel ‘udpDetails'»udpDetails is on the main page, so I am thinking it can’t find it because the checkbox is a child control of the user control, but I can’t seem to figure out how else I can get the CheckChanged event to trigger when it is clicked. Does anyone
know how I can fix what I am attempting above, or another way around the problem I am having of triggering event controls inside of user controls that are in an update panel on a page?
Answers
-
User1335925338 posted
Hi EnterTheUser,
One posible cause maybe the AutoPostBack of the CheckBox inside the UC has not been set with true.
To achieve this goal, you can declear a public event of the UserControl and raise this event in the CheckBox’s checkedchange event. Then, in the page’s Init function, add this event to the AsyncPostBackTrigger of the UpdatePanel.
Here is my sample code:
.aspx file
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestUCEvent.aspx.vb" Inherits="SoluTest_GetValueFromUserControl.TestUCEvent" %> <%@ Register src="CheckBoxChange.ascx" TagName="CheckBoxChange" TagPrefix="uc1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False"> <ContentTemplate> <%=DateTime.Now.ToString()%> <hr /> <asp:Button ID="Button1" runat="server" Text="Button" /> <uc1:CheckBoxChange ID="CheckBoxChange1" runat="server" /> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html>
.aspx.vb file
Partial Public Class TestUCEvent Inherits System.Web.UI.Page Private Sub TestUCEvent_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init Dim t As New AsyncPostBackTrigger() t.ControlID = CheckBoxChange1.ID t.EventName = "ucEvent" Me.UpdatePanel1.Triggers.Add(t) End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Private Sub CheckBoxChange1_ucEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBoxChange1.ucEvent End Sub End Class
.ascx file
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="CheckBoxChange.ascx.vb" Inherits="SoluTest_GetValueFromUserControl.CheckBoxChange" %> <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" />
.ascx.vb file
Public Partial Class CheckBoxChange Inherits System.Web.UI.UserControl Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Public Event ucEvent(ByVal sender As Object, ByVal e As EventArgs) Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CheckBox1.CheckedChanged RaiseEvent ucEvent(sender, e) End Sub End Class
Have my suggestion helped?
Best regards,
Zhi-Qiang Ni
-
Marked as answer by
Thursday, October 7, 2021 12:00 AM
-
Marked as answer by
When You learn to record script in SAP, your report work become a lot easier and faster. But what do these recorded, SAP secret code lines after session.findbyid mean?

I already posted about How to connect to SAP via Excel VBA, where I present my approach to SAP connection with Excel VBA. So now let’s go to the meaning of some ID’s, which can help You to modify or repair your recorded script.
When I first saw recorded SAP code I felt like in Matrix. Tons of lines, where I only recognize what I was manually filling in SAP during recording.
But after some time I realized what some of that secret code lines mean. Thanks to that I could modify my code without re-recording. It allows me to shortage my code erasing unnecessary lines or putting my own variables into SAP code.
I would like to cut that whole, long journey experience and speed it up for You. For better understanding what hides behind SAP session.findbyid.
SAP code lines and their descriptions
1. SAP main window.
session.findById("wnd[0]")
You may notice that the abbreviation wnd comes from word window. Number zero starts numbering SAP windows and not only them. You’ll find out more windows in your code like wnd[1] or wnd[2].
2.Minimize and maximize the SAP window.
session.findById("wnd[0]").iconify
session.findById("wnd[0]").maximize
You can hide SAP window (.iconify) not to see any action on main stage wnd[0] or maximize (.maximize) to fullscreen.
3.Confirmation
session.findById("wnd[0]").sendVKey 0
Above line stands for confirmation. In other words it is classic ENTER button. So every time You click it during recording You’ll get this line.
4.Transaction name
session.findById("wnd[0]/tbar[0]/okcd").Text = "transaction name"
This time let’s take a look at the structure. Firstly comes window and its index – wnd[0], then toolbar – tbar[0] and transaction/ commands window on it – okcd. There is also .Text, which means that You are filling this textbox. Here You can pass transaction name or string variable.
5.Buttons
session.findById("wnd[0]/usr/btn[1]").press
Here You can see in structure as second item – usr. I’m not sure about that, but it rather stands for userform. Next to it is button nr 1 – btn[1]. Every time You click button, that action will be recorded as .press.
6.Cursor position
session.findById("wnd[0]/usr/ctxt[73]").caretPosition = 4
If You have ever seen .caretPosition it means that your cursor is in position, in our case it is after 4th sign in that text container – ctxt. In most cases it is completely unnecessary line, so You can delete it to make your SAP code more transparent.
7.Focused
session.findById("wnd[0]/usr/ctxt[73]").SetFocus
This is the second unnecessary SAP code line in my opinion. It is responsible for selecting window or text. Also feel free to delete it and it won’t affect on anything.
8.Check box
session.findById("wnd[0]/usr/chk[2]").Selected = True
If You have any checkbox in your transaction, it will appear in code as chk and its .Selected status – in our case it is True.
9.”Red cross”
session.findById("wnd[0]/tbar[0]/btn[12]").press
I think You know what I mean by saying “Red cross” on your main toolbar. After couple of recordings I realized that code line stands for cancel button. Use it to go back in SAP.
10.Closing
session.findById("wnd[0]").Close
session.findById("wnd[1]/usr/btn[0]").press
In the end I got for you code line for closing SAP. With closing line comes also confirmation pop up, which is next window wnd[1] with yes button btn[0].
And this was it!
That was my 10 code lines, which often follow session.findbyid in SAP. Realizing what they mean and what they stands for allowed me to have better control over the code and to optimize it. I hope it will help as well.
I’m very advanced in VBA, Excel, also easily linking VBA with other Office applications (e.g. PowerPoint) and external applications (e.g. SAP). I take part also in RPA processes (WebQuery, DataCache, IBM Access Client Solutions) where I can also use my SQL basic skillset. I’m trying now to widen my knowledge into TypeScript/JavaScript direction.
View all posts by Tomasz Płociński
Я установил веб-приложение Redmine на CentOs 7 с postgresql 9.1 и с помощью пассажира. Когда я открываю приложение Redmine, появляется следующая ошибка:
We're sorry, but something went wrong.
The issue has been logged for investigation. Please try again later.
Error ID: f4adae6a Details:
Web application could not be started by the Phusion Passenger
application server.Please read the Passenger log file (search for the Error ID) to find
the details of the error.
Когда я обращаюсь к файлу erro_log в / var / log / httpd /, это выглядит так:
[ E 2018-05-25 16:28:01.7581 24316/Td age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /opt/redmine: An operating system error occurred while preparing to spawn an application process: Cannot create FIFO file /tmp/passenger.spawn.XXXXCTqsz4/response/finish: Permission denied (errno=13)
Error ID: f4adae6a
Error details saved to: /tmp/passenger-error-H1zmwo.html
[ E 2018-05-25 16:28:01.7609 24316/T6 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-2] Cannot checkout session because a spawning error occurred. The identifier of the error is f4adae6a. Please see earlier logs for details about the error.
Похоже, что, во-первых, apache не регистрирует ошибку в /tmp/passenger-error-H1zmwo.html, как предполагалось.
Я уже пытался потерять разрешения на / opt / redmine, используя следующее руководство ЗДЕСЬ
Я на redmine 3.4.3, ruby 2.3.1 и rails 4.2.8. Пассажир 5.3.1
Не знаю, что делать дальше. Благодарю за небольшую помощь. Если у вас есть дополнительная информация, спросите меня.