I just started learning SAP GUI Scripting and cannot figure out why my macro is not recorded properly.
-
I tried to record all the steps for a transaction at once. But every time I do it, a script contains only the part up until the line where a transaction is run. The rest of the steps are not recorded.
-
I decided to record two parts separately and combine them manually. But it still does not work.
The macro only runs «/oCS15» transaction, it then stops and returns the error message:
the control could not be found by id. Line 20, Char 1
Can anyone advise how to fix a problem? I really hope to move on with this part of the project and assume it is just a minor issue. Please help!
I have the following script:
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.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 = "/oCS15"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/chkRC29L-DIRKT").selected = true
session.findById("wnd[0]/usr/ctxtRC29L-MATNR").text = "EDG001001008"
session.findById("wnd[0]/usr/chkRC29L-DIRKT").setFocus
session.findById("wnd[0]").sendVKey 5
session.findById("wnd[0]/usr/ctxtRC29L-WERKS").text = "0600"
session.findById("wnd[0]/usr/ctxtRC29L-WERKS").setFocus
session.findById("wnd[0]/usr/ctxtRC29L-WERKS").caretPosition = 4
session.findById("wnd[0]").sendVKey 8
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").currentCellColumn = "DOBJT"
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").selectedRows = "0"
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").doubleClickCurrentCell
session.findById("wnd[0]/usr/tabsTS_ITEM/tabpPHPT/ssubSUBPAGE:SAPLCSDI:0830/btnP_BEZIEHUNG").press
session.findById("wnd[0]/usr/cntlSOURCE/shellcont/shell").setSelectionIndexes 0,28
Sandra Rossi
11.7k4 gold badges22 silver badges47 bronze badges
asked Aug 21, 2018 at 17:41
5
I suspect that the issue lies in starting a transaction. The command «/o» before the transaction opens a new session at the same time.
Set session = connection.Children(0) => It does not apply anymore.
Set session = connection.Children(1) => If only one session was active before, this is the new session.
But you do not necessarily have to create a new session when starting a transaction. Run the new transaction as follows:
...
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "/nCS15"
session.findById("wnd[0]").sendVKey 0
...
The script recorder records only commands within a session. If you leave them (see «/o»), the recording stops at this point.
Regards,
ScriptMan
answered Aug 22, 2018 at 6:24
ScriptManScriptMan
1,5701 gold badge9 silver badges9 bronze badges
1
*in SAP Solution Manager 7.1 and 7.2
—-
Content
Design Time
Symptom
*Post parameters of a http message are duplicate.
Reason
The client plugin (EEM recorder) has a defect.
Solution
Manually eliminate the duplication as long as no official fix is available.
Example:
New imported SAPGUI script fails in EEM Editor during replay
Symtom
You imported a SAPGUI recording into EEM Editor and provided correct logon credentials. A script execution in EEM Editor fails and you get error messages like: «The control could not be found by id. (SAP Frontend Server ):619: wnd1/usr/ctxt2.text»
Reason
There might be several reasons for this behaviour and a step by step analysis is required.
Procedure
- Re-record the script in SAPGUI and ensure that you do not use value history function of SAPGUI to provide values to textfields even if they are provided. Type it character by character again.
- Stop the recorder and try to execute the created VBS file directly in the SAPGUI.
- If the VBS file shows a execptional behavior by showing control errors the issue is related to your SApGUI installation not to EEMon
- In this case provide the version/buildnumber of your SAPGUI to support together with the recorded file.
- In most cases a different version of SAPGUI solves the issue.
- If the script was executed succesfully in SAPGUI alone but fails after import to EEM Editor please check the User credentials again.
- Execute the script step by step to identify the EEM message which causes the issue by adressing an unknown UI element.
- Execute the script again till the point where the script would during next action. Use the mouse to click on the UI element which should be adressed during a correct execution. The red square helps you to navigate in the UI components. For example
- Proceed with script execution to exit the script. The selection of the correct UI elemet with the mouse has created an availability check for this element. We do not need this check but it shows the component ID of the important UI element that is not pressed or activated during the exeptional scipt runs.
- Compare the component ID from check with the component ID mentioned in the next message. In some cases the IDs differ. Try to execute the script with a corrected component ID in the message.
- Run the script again with hardcopy and component trace options:
- Go to script configuration, SAPGUI settings.
- Activate «hardcopy» and «Component Trace» and hit «Apply».
- Perform another replay of the script. During the replay the editor now captures screenshots for every message and in addition a dump of the UI element hierarchy.
- You can review this by clicking at single messages in the replay result.
- If it is still not working prepare a WTS connection to the recording PC to an account where the SAP support can use the EEM Editor and execute and analyse the script in detail.
Unable to render {include} The included page could not be found.
Symptom:
Editor finished execution half way of a replay without any error infomation. Go to workspace.metadata.log,
there is some OOM identified.
Solution:
Open EemEditor.ini file and add the following parameters to increase the Java heap size: -XX:MaxPermSize=64m, -Xmx128m
Symptom
You are recording SAPGUI Script under usage of a F4 help dialog and action dumps with
«Runtime error MESSAGE_TYPE_X has occurred occurs»
Solution
Open the SAPGUI menu HELP => SETTINGS => tab F4 Help
Set Display radio button to «Dialog(modal)»
Symptom
When executing an http script in EEM Editor some requests fail with error message
Variable inplaceEditForm:reference:c0-e6, inplaceEditForm_accordionMenu_expanded_state:reference:c0-e7 is not defined, e.g., because a preceding request did not deliver the expected result.
Reason
The string is a JSON object but handled as a variable. This might happen for example when creating a script for Successfactor.
Solution
Create a variable with exactly the same name and value.
Example:
inplaceEditForm:reference:c0-e6, inplaceEditForm_accordionMenu_expanded_state:reference:c0-e7
{inplaceEditForm:reference:c0-e6, inplaceEditForm_accordionMenu_expanded_state:reference:c0-e7}
EEM Editor Crash with Java 7
Symtom
The EEM Editor might crash with an EXCEPTION_ACCESS_VIOLATION when executing an RFC script.
Reason
The problem is located in the JCO native libraries.
Solution
Configure the EemEditor explicitly to launch with a specified 32bit JDK. For this purpose, add this parameter to EemEditor.ini
:
-vm c:/full/path/to/javaw.exe
RFC ContentCheck in Export Parameters cantaining <item> elements*
Symtome
Your RFC content check fails even if you have correctly mapped the XML structure shown under tab Export Parameters in a Content Check path.
<OUTPUT> <SCRIPTS> <item> <SCENARIO_ID>2</SCENARIO_ID> </item> </SCRIPTS> </OUTPUT>
The current implementation of EEM is not operating on the displayed XML structure which is only dumped out for the end-user in the EEMEditor. During runtime it is operating on predefined classes for RFC handling with a different hierarchy:
Be Careful
Wrong path, but what you would expect from XML: EXPORT.OUTPUT.SCRIPTS.item.Scenario_ID
Correct Path
To get a correct path generally ignore OUTPUT and metatag item, which just represents an ABAP table unknown to java.:
Correct path: EXPORT.SCRIPTS.Scenario_ID
—-
Configuration Time
Symptom
The SOLMAN_SETUP task ‘Create Endpoints for communication’ fails with message Error during End Point creation.
Reason
The configuration For service definition AI_EEM_LIST_ALL_SCENARIOS could not be generated. There was a problem in after import method when applying the SP.
Solution
Execute the report REPAIR_AFTER_IMPORT to solve the issue and execute the task again.
Symptom
Error Message after trying to deploy scripts to robots:
Resources cannot be uploaded: Script= ... SoapFaultCode 4: Deserialization fails: Nested Message: XML Deserialization Error. XML Parser has thrown exception while parsing input
Resources cannot be uploaded.;Script= ... SoapFaultCode:5 Reader is not positioned on start element.Probably incorrect usage of stream parsing methods.
ICF Error when receiving the response: HTTPIO_PLG_CANCELED
Resolution
This is a known bug in the http service of the SAP J2EE server. SAP Note 1638655 lists the patch levels for J2EE software components that fix the problem.
Work-around: Point the consumer proxy directly to the J2EE dispatcher instead of pointing to the ICM. Procedure:
- Start SOAMANAGER in SAPGUI via transaction
/nSOAMANAGER
- Select Web Service Configuration
- Search by Consumer Proxy, search pattern *EemAdmin*. Select CO_EEM_EEM_ADMIN_VI_DOCUMENT and click Apply Selection.
- Select tab Configurations in the lower pane.
- Select the logical port SMD and click Edit.
- Select tab Transport Settings
- Update the field Port Number of Access URL to contain the J2EE dispatch port (e.g. 50000).
- Select tab Messaging
- for Message ID (Synchronous), select _Suppress ID Transfer
- Click Save
Symptom
When deploying or uploading a script that cannot be started on the robot because of missing properties or an error the deployment throws the exception
SOAP:1.001 CX_SY_CONVERSION_OVERFLOW:.An error occurred when deserializing in the simple transformation program /1SAI/….Overflow converting from <java timestamp>.
Reason
The long value of the java timestamp is mapped to an INT4 data element.
Solution
Check in transaction SRT_UTIL in the paylaod for the real error (e.g. property not found in SecureStore:…) correct it and deploy the script again. The mapping is corrected with 7.1 SP08.
Symptom
In the SOLMAN_SETUP step ‘Configure EEM Robots’ terminates with the error Operation «getMatchingAgentInfo{urn:EemAdminWsd/EemAdminVi/document}» not supported (interface: «CO_EEM_EEM_ADMIN_VI_DOCUMENT» …} when clicking on button ‘Check Agents’.
Reason
The web service in Java has been enhanced to provide a filter option when searching for robot candidates.
Solution
Execute in SOLMAN_SETUP the activity Create Logical Ports in step Configure Automatically:
—-
Run Time
Known problems
Known problems in Solution Manager 7.1 SP03
- Each second http script execution fails with status 504 (server not responding).
This problem is solved with LMSERVICE patch 2 for SP03 - System data of SAPGUI scripts are not displayed in monitoring UI because trace collector aborted during trace collection. In default trace of J2EE engine you can find the exception:
ABAP SysLog collection was aborted: For input string: «.
This problem is solved with LMSERVICE patch 2 for SP03.
Known problems in Solution Manager 7.1 SP04
- After upgrade to SP04 scripts are not executed anymore or are executed with wrong configuration (e.g. wrong schedule period)
Check if correction note 1651279 has been applied and if SOLMAN_SETUP step 2.4(Configure Automatically) and activity ‘Perform tasks after upgrade’ has been executed. - Each second http script execution fails with status 504 (server not responding).
This problem is solved with LMSERVICE patch 1 for SP04 - Starting a script in the editor will fail if no Solution Manager connection is maintained. Error message:
com.sap.smd.eem.executor.ExecutorException: Failed initiate executor
…Caused by: java.lang.NumberFormatException: For input string: ""
Work-around: In the status bar (bottom right) click «Solution Manager Connection not Configured» and maintain the connection data. After this scripts can be executed. - System data of SAPGUI scripts are not displayed in monitoring UI because trace collector aborted during trace collection. In default trace of J2EE engine you can find the exception:
ABAP SysLog collection was aborted: For input string: «.
This problem is solved with LMSERVICE patch 1 for SP04.
—-
EEM Robot
Symptom:
EEM Robot does not show sapgui as supported protocol
Solution:
The EEM robot tries to access the SAPGUI scripting object as test whether SAPGUI scripts can be supported on the robot. Possible reasons for not supporting SAPGUI scripts:
- SAPGUI is not installed on the robot PC: SAPGUI for Windows must be installed
- The scripting functionality of sapgui is not installed. Open SAPlogon -> options -> Scripting. There must be a message like «Scripting is installed».
- EEM Robot fails to execute SAPGUI script due to missing privileges of MS Windows service-user «SAPService<DASID>».
Add the «SAPService<DASID>» to group Administrators and restart the EEM Robot
Symptom
java.lang.RuntimeException: No implementation for SHA or MD5:
java.security.NoSuchProviderException: no such provider: IAIK
#at
com.sap.smd.eem.wsnotify.bulk.AI_EEM_BULK_NOTIFICATION_Stub
Solution
Follow the description to enable SSL for WSnotify.
Workaround
Revert to http.
Symptom
Sending a notification fails with the following error message:
com.sap.smd.eem.executor.wsnotify.WsNotifier — doNotification: notification call failed for URL http://../sap/bc/srt/scs/sap/ai_eem_bulk_notification?
EXCEPTION
javax.xml.rpc.soap.SOAPFaultException: Processing Error. More details in WS Error Log (transaction SRT_UTIL) by selection with UTC timestamp
at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.buildFaultException(MimeHttpBinding.java:747)
In SRT_UTIL you see this error message:
<EXCEPTION_INFO>
<TYPE>CX_INVALID_TRANSFORMATION</TYPE>
<ERROR_TEXT>The transformation /1BCDWB/WSSBED2302F1E3963004DA could not be executed</ERROR_TEXT>
<CX_SOAP_CORE>
<E_LOCATION>
<CLASS>CL_SXMLP_DATA_ST==============CP</CLASS>
<METHOD>CL_SXMLP_DATA_ST==============CM004</METHOD>
</E_LOCATION>
<E_TEXT>CX_INVALID_TRANSFORMATION:An exception with the type CX_INVALID_TRANSFORMATION occurred, but was neither handled locally, nor declared in a RAISING clause.The transformation /1BCDWB/WSS<…> could not be executed
</E_TEXT>
Background
It can happen that, e.g. after an upgrade, some transformations seem to have disappeared:
Meta data still exists (and the contents of the transformation can be displayed in Transaction STRANS) but the TRDIR entry is missing.
Solution
Apply note 1390832. The note contains report RS_RETRIEVE_XSLT which must be run afterwards in order to re-create some missing transformation programs.
Symptom
After upgrading to Solution Manager 7.20 sending a notification fails with the following error message:
[Thread[EEM WsNotifyQueue,5,main]] Error
com.sap.smd.eem.executor.wsnotify.WsNotifierST.doNotification notification call failed for URL https://<solman_host>:<port>/sap/bc/srt/scs/sap/ai_eem_bulk_notification_st?sap-client=XXX (user: SM_EXTERN_WS)
[EXCEPTION]
com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.sap.smd.eem.wsnotifyst.soapfunctions.mc_style.AiEemBulkNotificationSt is not found. Have you run APT to generate them?
Background
The JVM version of the SMD Agent might be too old.
Solution
Check the JVM version of the SMD Agents a version like 6.1.010 is too old. Apply a newer JVM version (e.g. 6.1.076 ) as described in note 1774669 (Diagnostics Agent — How To Switch or Update SAP JVM) or in the wiki page Diagnostics Agent Maintenance Procedures.
Unable to render {include} The included page could not be found.
Executor
Symptom
SAPGUI script aborts at step 3 with exception The control could not be found by id
Background
The issue is caused by the configuration of the backend ABAP system in respect to multiple user logons.
A SAPGUI script is recorded after the login procedure; the login procedure is not part of the recording. To handle the logon the EEM Editor automatically adds the necessary steps. During the import it inserts 4 specific steps bevor the “main” the script logic.
From those 4 the steps 1 and 2 handle the regular login. The step 3 and 4 are conditional steps which are automatically inserted by the EEM Editor to confirm the multi login pop-up. That is, to handle the situation, when an active user session already exists and the backend system prompts the user on which actions he wants to take: “terminate the current logon”, “terminate other logons” or the “continue with this logon, without ending any other logon”. The steps 3 and 4 will attempt to select the “continue with this logon” checkbox in the corresponding pop-up window and press the “login”.
However, in some systems multiple login is not allowed (setting profile parameter login/disable_multi_gui_login). In this case the step 3 will always fail. It will try to find that “continue with this logon” checkbox which simple won’t be presented in the backend system. If the system does not allow multiple logons this pop-up has only two checkboxes, and the login will not succeed. All further steps of the script will probably fail either. The error message “FAILED: control could not be found by id” means that the particular “third” checkbox could not be found.
The issue may not occur in the EEM editor and the SAPGUI script work fine. The situation is typically different in the Solution Manager system, if multiple robots are login on the ABAP system with the same user credentials and if by chance two robots/executions happen to run in parallel or shortly one after another.
Solution
To get the script running successfully you have the following options:
- Configure different users per robot. Use for each script execution another user. This can be reached by setting the properties sapgui.user and sapgui.password in scope script_on_robot (different for each script instance on the robots).
- Change the type of the user to SERVICE. This will prevent the pop-up for this user and as the advantage that the password will not expire.
- Allow multiple logons with same user in the backend systems. Add the user to the profile parameter login/multi_login_users
- Avoid parallel executions of the script. Synchronize executions in a way that a robot always logs out before another one tries a logon. See also Script Synchronization and Serialization
SAPGUI script fails on robots
Symtom You created a SAPGUI script which is running sorrectly in the editor and uploaded it to an EEM Robot where it fails. There might be different kind of errors like:
- RESULT_FAILED Message ... Current window id is wnd[0] while expected window id is wnd[1], please check for popups
Reason SAPGUI scripts are executed in background on the robot with operating user SAPSERVICE<SID> which cannot interact with desktop. There might be several reasons for an error and a step by step analysis is required.
Procedure
You can change temporally the seetings of the service to interact with desktop. Every SAPGUI script execution is then visible when you logon to the robot with the SAPService user.
- Start services.exe
- Select the service e.g SAPDAA_96 and open the properties.
- Open tab ‘Log On’ and select ‘Local System Account’ and ‘Allow service to interact with desktop’ as shown on the screen shot below:
- Wait until the script will be executed and display the result.
After the analysis you should change the setting back to its original value.
Symptome:
When executing a https script you get the exception»java.lang.NoClassDefFoundError: javax/crypto/SunJCE_b»
Background:
Jce-policy file is not extracted to the libsecurity folder of the SAP JVM during the installation of agent 7.11 (SAP Note 1234387), which makes the https doesn’t work for EEM.
Solution:
- Download the JCE jurisdiction policy files as described in SAP Note 1240081.
- Unzip it and copy the two JAR files, local_policy.jar and US_export_policy.jar, in the following folder:
/usr/sap/<DASID>/SYS/exe/jvm/<PLATFORM>/sapjvm_<xxx>/sapjvm_5/jre/lib/security - On Unix platform do not forget to set the owner of the files to the Diagnostics Agent user (<dasid>adm:sapsys) and to set the permissions mode to 777.
- Restart the agent.
- Goto the folder usrsap<AGENT_SID><AGENT_INSTANCE>exesapjvmjrelibsecurity and check if the local_policy.jar and US_export_policy.jar exist. If not, please also copy the local_policy.jar and US_export_policy.jar to this folder.
Symptom
You are running a script which aborts with «java.net.ConnectException: Connection timed out: connect»
Solution
Check if a proxy is required to reach the url.
Set the properties http.proxy.host and http.proxy.port to the corresponding values and set http.proxy.enable to true.
Depending of the called system it might be required to set properties in different scopes:
Symptom
You are running a https script which aborts with «javax.net.ssl.SSLException: java.lang.UnsupportedOperationException»
Solution
Check if the script has a valid truststore or if the password for the global password is set.
When the password for the global truststore is not set you can add in eem_admin for the scope global the property
global.trustore.password and set it to eemstore.
Symptome:
When executing a script the following exception is thrown:
EXCEPTION
com.sap.smd.eem.executor.MessageException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target[
LinkedList0:
Issuer: CN=Company CA 5, OU=Trust Center Company, O=Company Services GmbH, C=DE
Subject: CN=selfservice-test.portal.Company.de, C=DE, ST=NRW, L=Anywhere, Company GmbH
SerialNum: 8166
Expires: Thu Nov 25 08:25:04 CET 2010
….
Index: 1
LinkedList1:
Issuer: C=BE, O=GlobalSign nv-sa, OU=RootSign Partners CA, CN=GlobalSign RootSign Partners CA
Subject: CN=CompanyCA 5, OU=Trust Center Company, O=Company Services GmbH, C=DE
SerialNum: 40000000001094550f4da
Expires: Thu Feb 07 12:00:00 CET 2013
…
Exception: null
Index: 2
LinkedList2:
Issuer: CN=GlobalSign Root CA, OU=Root CA, O=GlobalSign nv-sa, C=BE
Subject: C=BE, O=GlobalSign nv-sa, OU=RootSign Partners CA, CN=GlobalSign RootSign Partners CA
Solution:
At least one of the bold written certificates above must be entered to the truststore (either global trustore or script specific truststore).
Please check ‘How to Import HTTP Trust Certificate’ to import the certificate.
How to identify which truststores are used and what is contained?
To get information which certificates are already part of which truststores you have to increase tht log level of SMDAgentApplication.log of an SMD Agent to Debug and then stop and start the script. This is an extract of the output:
Info com.sap.smd.eem.executor.http.CertificateContext — loadKeyStore: Return the cached key store for file <Agent_path>exesapjvm_5jrelibsecurity/cacerts
Debug com.sap.smd.eem.executor.http.CertificateContext — dumpKeys: TrustedCertificateEntry Subject:CN=VeriSign Class 1 Public Primary Certification Authority …
Debug com.sap.smd.eem.executor.http.CertificateContext — dumpKeys: TrustedCertificateEntry Subject:CN=Entrust.net…
Info com.sap.smd.eem.executor.http.CertificateContext — loadKeyStore: Return the cached key store for file <Agent_path>SMDAgentapplications.configcom.sap.smd.agent.application.eemscripts/<Script_Name>/trustStore.jks
Debug com.sap.smd.eem.executor.http.CertificateContext — dumpKeys: TrustedCertificateEntry Subject:CN=portal-qas.company.de,C=DE,ST=…
Info com.sap.smd.eem.executor.http.CertificateContext — loadKeyStore: Return the cached key store for file <Agent_path>SMDAgentapplications.configcom.sap.smd.agent.application.eem/trustStore.jks
Debug com.sap.smd.eem.executor.http.CertificateContext — dumpKeys: TrustedCertificateEntry Subject:CN=portal-qas.company.de,C=DE,ST=…
Symptom:
Http script runs in error (Editor or Robot) because of an ssl handshake failure
Message in the Editor:
SSL handshake failed, probably due to timeout, please restart the script: Received fatal alert: handshake_failure
In the Log you will see:
handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
Solution:
The SSL handshake failure is typically caused because client side (EEM) and web server could not agree on a common https protocol (e.g. SSL3, TLSV1, TLSV1.1, TLSV1.2) or on a cipher suite. There are multiple possible reasons for this:
There was some kind of timeout
Just try again …
The Java VM running the EEM script (in the editor / on the robot) misses the «unlimited strength jurisdiction policy» files.
Please install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. Information on where to get these files can be found in SAP Note 1240081.
- JDK used by the Editor
- JDK used by the robots (Sample path: …usrsap<Agent-SID>SMDA97exesapjvm_6jrelibsecurity)
The Java VM running the EEM script does not support the SSL protocol implementation / cipher suite at all
Java 6 has only limited support for crypto algorithms, whereas Java 8 comes with a more complete choice. Example: Java 6 does not support TLSV1.1 or TLSV1.2, while Java 8 does. So if the web server requires to use TLSV1.2, the EEM script will fail to execute running on Java 6. Since January 2018 Diagnostics Agents connecting against SAP Solution Manager 7.2 are also supported on SAP JVM 8.1.
As a cross check try if it makes a difference to run the EEM editor with Java 8. See Configure the Java VM for the Editor.
You can also activate a detailed SSL trace by setting the Java VM parameter -Djavax.net.debug=all (in EemEditor.ini). Output will be sent to the console. To make the console visible run the editor with java.exe (instead of the default javaw.exe). See again Configure the Java VM for the Editor.
For Diagnostics Agent communication issues having to do with TLS V1.2 please see the SAP Note 2463712.
Monitoring UI:
There might be several reasons why the monitoring UI does not start.
You get error messages like ‘Cannot retrieve language bundle’ or ‘Cannot retrieve severtiy rules’.
- Endpoints were not generated succesfully
The endpoinpts the monitoring UI is calling are created in SOLMAN_SETUP for EEM in step 2.4 (Configure Automatically)
When the WSDL has ben loaded succesfully but further WS calls are failing like in the screen shot then the following points could be the reason:
- Missing authoriation.
The user does not have the correct role and authorization for this WS is missing. To verify this an authorization trace for the user in ST01 can be recorded when calling the monitoring UI. - Wrong WS configuration
During SOLMAN_SETUP you explicitly allow in
-> System Preparation -> Step 5.2 Web Service infrastructure Configuration
which authentication types all web services can use:
— Basic Authentication
— X.509 Certificate Authentication
— Ticket Authentication
If you don’t allow for example Ticket Authentication it is not possible to logon first via SAPGUI to SAP Solution Manager and start from there in the workcenter the EEM Monitoring UI. The following screen shot shows the required settings when all authentication types should be used:
Symptom
The Monitoring UI does not display any script executions. You just see the deployed scripts with grey icons and status 509 or 109.
Solution
The system does not get any notifications from the robots. There could be several reasons:
- The user for sending the notifications is locked
The user for sending the notifications is stored on each robot. If the password is changed in user master record (SU01) and not in the setup application the robots use still the old password. But even if the password is changed in the the setup application it might happen that there is a small overlap when robots still using the old password until they receive the new password. The user can be unlocked in SU01. The name of the user is specified with parameter wsnotify.user . - Accepting notifications is disabled
For 7.1 in the setup application (SOLMAN_SETUP) and for 7.01 in eem_admin accepting notifications can be disabled globally. - Robots are not available
If robots are not reachable they are usually displayed at disconnected and they cannot send any notification. - URL for sending the notification has been changed or is not correct
The URL (including protocol, host and port) has been changed or is not correct. This might happen if the URL is using a host name and port for the message server that is not reachable from the robot location. The URL can be adapted by adjusting the parameter wsnotify.url . - Notification is using https but iaik files are not installed. In SMDAgentApplication.log you can find this exception
java.lang.Exception: Could not create https handler:java.lang.ClassNotFoundException iaik.protocol.https.Handler
See also http://wiki.sdn.sap.com/wiki/display/EEM/SSL+For+Wsnotify - After upgrading to Solution Manager 7.20 some robots cannot send notifications.
See also AiEemBulkNotificationSt is not found
In general you should check the SMDAgentApplication.log of the robot if there is an error when sending the notification.
Symptom
You cannot see any system data in the Monitoring UI or jump-in to E2E Trace is not available.
Background
Executions (Timestamp and steps below) are written with bold letters if system data or a trace is available. If the execution is triggered with a trace level > 0 the text is written in italic letters.
Currently there are 3 types of scripts where system data or traces can be collected/displayed:
1. HTTP Script for SAP J2EE based applications
System data/traces are only available if tracing has been enabled (Run Script with trace or Set temporary configuration). It is possible to configure so that HTTP log and DSR records are always written. See also Trace Enabling for EEM
2. HTTP Script for ABAP based application
System data/statistical records are always available. Detail traces (SQL, ABAP Trace,..) are only available when tracing has been enabled.
3. SAPGUI Script
System data/statistical records are not for all steps available. Detail traces (SQL, ABAP Trace,..) are not possible at the moment.
Solution
When system data/traces are missing (see description above) you can check the following steps:
1 . The parameter «Expire in seconds» of temporary configuration should have a value higher than 60 seconds (default 1800)
2. Is the script assigned to a technical scenario? In setup step 3.3. check that a technical scenario is filled in for the script.
3. Is the extractor running?
Go to work center SAP Solution Manager Administration, in Infrastructure launch the Extractor Framework view. For each technical scenario there is an extractor EEM system data of TechScen ...
. See screen shot:
4. Check the log of the extractor.
If there is an error message like
Current SMD Upgrade status does not allow trace collection
the SMD Upgrader must be executed after applying an LM-Service patch.
This can be done in SOLMAN_SETUP -> Basic Configuration -> Step 2.4 (Solution Manager Internal Connectivity) -> Activity: Run Java Upgrader
If there is an error message like
Trace collection failed: 1/0 exceptions occurred during synchronous/asynchronous trace collection.
an error occurred during trace collection in Solution Manager J2EE and you need to check the log viewer of the Solution Manager Java Stack.
— Start the NWA log viewer ( /NWA -> Monitoring -> Logs and Traces -> Show Default trace.
— open the filter and enter: location contains com.sap.sup.admin.e2e.trace and click on ‘Apply filter ‘
From the screen shot above it is clear why the trace collection aborted (SMD Agent cannot be reached at this time) but in other cases when the BusinessTransaction*.xml could be retrieved it makes sense to start a single analysis just with one file that is uploaded in the E2E Trace application for the system. Proceed as follows:
Manual Trace Collection
— Get the BusinessTransaction.xml from robot (click the link if you want to analyze the BusinessTransaction.xml within the EEM Editor)
- Select the interesting execution in the EEM Monitoring UI
- Right-click with mouse and select «Copy Transaction ID to clipboard»:
— Open the E2E Trace application from the RootCause Analysis work center for the Technical System(s)/Scenario you want to collect the trace and paste this id there:
— Trigger the server-side trace collection and check the progress and in parallel the default.trc as mentioned above.
Known Problems
1. HTTP Script for SAP J2EE based applications
-HTTP log or DSR records could not be found.
2. HTTP Script for ABAP based application
-ICM HTTP log does not have the correct format.
3. SAPGUI Script
-ABAP Statistic records could not be found because the time difference of Robot and called system is too high.
4. In SAP Solution Manager 7.1 SP03 and SP04
— No system data can be found if the Technical Scenario name has been created including lower case characters. Because of a data element change it is possible to create Technical Scenarios with lower case but internally another data element was used which translates them to upper case. The problem is solved with SP05. As a workaround in SP03 and SP04 you need to create the Technical Scenario name only in upper case.
5. In SAP Solution Manager 7.1 SP03 and SP04
— System data of SAPGUI scripts are not displayed in monitoring UI because trace collector aborted during trace collection. In default trace of J2EE engine you can find the exception:
ABAP SysLog collection was aborted: For input string: «.
This problem is solved with LMSERVICE patch 2 for SP03 or LMSERVICE patch 1 for SP04.
6. In SAP Solution Manager 7.1 SP05
The user SM_EXTERN_WS does not have the authorization to collect automatically traces and system data. Upload the role SAP_SM_EXTERN_WS attached to note 1703150 in PFCG, go to SOLMAN_SETUP ‘System Preparation’ step 1 and update authorization of user SM_EXTERN_WS.
7. Extractor fails with exception Overflow when converting from » «
There might also a dump CX_SY_CONVERSION_OVERFLOW created for program CL_E2E_TA=====================CP.
The reason is a bug in statistic recrods in managed system leading to extremly high numbers which is solved with note 2071875 (Incorrect Average RFC Interface Time («CPIC/RFC»)).
Apply in the managed system the Kernel patch mentioned in note 2071875.
The context menu in the monitoring UI can contain the following entries:
- Go to E2E Trace Analysis
This entry is only selectable if system data or traces have been collected and if user has the authority to jump to the E2E Trace. - View Collector Log
This entry provides a jump-in to ABAP application log (SLG1) to display the result of the extractor collecting the system data or traces of the script executions. This entry is only selectable if the system data is not available. - Copy TransactionID to Clipboard
The entry is only selectable for a script execution (time stamp). It provides the possibility to collect the logs from the robot and analyze it it tne eem editor. See also - Run Script with Trace
This entry is only possible for a selected script and robot combination. It triggers immediately an additional execution with provided trace level. - Set Temporary Configuration
The selected script on the selected robot is executed for the configured time frame with the specified trace level. - Filter to
Opens a new tab with just the selected script. - Assign Steps Filter
Opens configuration menu to assign a filter on step level. - Jump to Alert Inbox
Provides jump in to Unified Alert Inbox. - Collect Trace
Triggers a trace collection immediately for the selected script execution.
Alerting
Missing alerts in Alert Inbox
Even there are red executions in the monitoring UI there are no alerts in the Alert Inbox.
There might be several reasons for this behaviour.
- During configuration an error occured and the script is not known to Monitoring and Alerting Infrastructure (MAI).
Check the status of the script in SOLMAN_SETUP step 5 on tab Scripts. If the Alerting Status icon is green the script is at least available in MAI directory
The script can also be configured from here. - The script or the steps of the scripts are not alerting relevant
Check in SOLMAN_SETUP step 5 on tab Steps if the flags for the Script/steps are set.
- Workmode settings supress the triggering of alerts.
Check in SOLMAN_SETUP step 2.7 if Monitoring is enabled for workmode type ‘No workmode configured’. If this flag is not set the default behaviour for DPC/MAI is to supress alerting. - During alerting configuration of a script an exception occured.
Check the application log (SLG1) for error messages of object E2E_ALERTING. - Alerts are not triggered for each ‘red’ execution.
Check the event propagation rule (Bestcase, Worstcase) for this category (Performance,Availability). See also FAQ Alert Progagation for more explanations
Check that the ACE job (SAP_ALERT_CALCULATION_ENGINE) is running regularly (usually every minute) without delay.
Known problems in MAI
Known problems in Solution Manager 7.1 SP03
- No alerts are available in Alert Inbox even there are red executions in Monitoring.
When a script is configured for alerting (during deployment or explicit action) this exception is written in application log for object E2E_ALERTING:
Source type CLASS=CL_AC_METRIC is not compatible, for the purposes of assignment, with target type INTERFACE=IF_ATW_EVENT
An exception with the type CX_SY_MOVE_CAST_ERROR occurred, but was neither handled locally, nor declared in a RAISING clause
This problem is solved with note 1648119. - Event Rule is not getting saved.
When changing an event rule in SAP Solution Manager Configuration workcenter -> Technical Monitoring -> End User Experience Monitoring -> step ‘Alerting’ it is changed back to the original value after saving the step.
This problem is solved with note 1720528.
Known problems in Solution Manager 7.1 SP04
- Event Rule is not getting saved.
When changing an event rule in SAP Solution Manager Configuration workcenter -> Technical Monitoring -> End User Experience Monitoring -> step ‘Alerting’ it is changed back to the original value after saving the step.
This problem is solved with note 1720528.
Known problems in Solution Manager 7.1 SP05
- No alerts are available in Alert Inbox even there are red executions in Monitoring.
There are no alerts for EEM available in the Alertinbox even the script and its steps are marked as alert relevant in SAP Solution Manager Configuration workcenter -> Technical Monitoring -> End User Experience Monitoring -> step ‘Alerting’.
This problem is solved with note 1739161. - No metrics (EEM step names) are displayed in the analysis report atached to an email notification. The problem is solved with note 1752164.
Known problems in Solution Manager 7.1 SP06
- No alerts are available in Alert Inbox even there are red executions in Monitoring.
There are no alerts for EEM available in the Alertinbox even the script and its steps are marked as alert relevant in SAP Solution Manager Configuration workcenter -> Technical Monitoring -> End User Experience Monitoring -> step ‘Alerting’.
This problem is solved with note 1748968. - No metrics (EEM step names) are displayed in the analysis report atached to an email notification. The problem is solved with note 1752164.
Known problems in Solution Manager 7.1 SP08
- No alerts are available in Alert Inbox even there are red executions in Monitoring.
The alert inbox is completely empty and there are no alerts displayed neither on other tabs.
This problem is caused by POWL change and can be solved with note 1736533. - There are no alerts availabe in Alert Inbox for new configured EEM scripts.
In directory browser one can see that the alert consumer flags are not set for the metrics on step level.
This problem is caused by a repository change and is solved with note 1924786 (Metric Consumers are not defaulted while creating new metric).
Reporting
Спасибо большое за ссылку. Так и есть – ошибка 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
Спасибо большое за ссылку. Так и есть – ошибка 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
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using Telerik.Web.UI; using System.Data.SqlClient; using System.Configuration; using System.Text; public partial class Portal : System.Web.UI.Page { private SqlConnection _conn = new SqlConnection(ConfigurationManager.ConnectionStrings[«DockConnectionString»].ConnectionString); private int _count = 0; bool LoadDefaults = true; protected void Page_Init(object sender, EventArgs e) { LoadDefaults=true; if (LoadDefaults) LoadDefaultsFromSharePoint(); else LoadFromDatabase(); } private void LoadDefaultsFromSharePoint() { string[] WidgetTitles = { «ECAMPAIGNS»,»NEWS»,»MY LISTINGS»,»MY CALENDAR»}; string[] WidgetControls = { «HP_eCampaign.ascx», «HP_News.ascx», «HP_Listings.ascx», «HP_Calendar.ascx»}; //Recreate the docks in order to ensure their proper operation bool isZoneOne=true; int i = 0; foreach (string widget in WidgetTitles) { RadDock dock = CreateRadDock(widget, WidgetControls[i]); //We will just add the RadDock control to the RadDockLayout. // You could use any other control for that purpose, just ensure // that it is inside the RadDockLayout control. // The RadDockLayout control will automatically move the RadDock // controls to their corresponding zone in the LoadDockLayout // event (see below). if (isZoneOne) { isZoneOne=false; RadDockZone1.Docks.Add(dock); } else { isZoneOne=true; RadDockZone2.Docks.Add(dock); } //We want to save the dock state every time a dock is moved. CreateSaveStateTrigger(dock); i++; } } private void LoadFromDatabase() { string dockState = «»; try { _conn.Open(); SqlCommand command = new SqlCommand(«select State from States where id=1«, _conn); dockState = command.ExecuteScalar().ToString(); _conn.Close(); } catch { } string[] currentDockStates = dockState.Split(‘|’); _count = currentDockStates.Length; //Recreate the docks in order to ensure their proper operation for (int i = 0; i < _count; i++) { if (currentDockStates[i].Trim() != string.Empty) { RadDock dock = CreateRadDockFromState(currentDockStates[i]); //We will just add the RadDock control to the RadDockLayout. // You could use any other control for that purpose, just ensure // that it is inside the RadDockLayout control. // The RadDockLayout control will automatically move the RadDock // controls to their corresponding zone in the LoadDockLayout // event (see below). RadDockLayout1.Controls.Add(dock); //We want to save the dock state every time a dock is moved. CreateSaveStateTrigger(dock); } } } protected void Page_Load(object sender, EventArgs e) { } private RadDock CreateRadDockFromState(string stringState) { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); DockState state = serializer.Deserialize<DockState>(stringState); RadDock dock = new RadDock(); dock.ID = string.Format(«RadDock{0}», state.UniqueName); dock.ApplyState(state); return dock; } private RadDock CreateRadDock(string WidgetTitle, string WidgetControlName) { RadDock dock = new RadDock(); dock.UniqueName = Guid.NewGuid().ToString(); dock.ID = string.Format(«RadDock{0}», dock.UniqueName); dock.Title = WidgetTitle; dock.Width = Unit.Pixel(330); dock.Height = Unit.Pixel(243); try { Control widget = LoadControl(WidgetControlName); } catch (Exception ex) { dock.Text = string.Format(«Error in Widget: {0}», ex.Message); } //dock.DefaultCommands= return dock; } private void CreateSaveStateTrigger(RadDock dock) { //Ensure that the RadDock control will initiate postback // when its position changes on the client or any of the commands is clicked. //Using the trigger we will «ajaxify» that postback. dock.AutoPostBack = true; dock.CommandsAutoPostBack = true; AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger(); saveStateTrigger.ControlID = dock.ID; saveStateTrigger.EventName = «DockPositionChanged»; UpdatePanel1.Triggers.Add(saveStateTrigger); } protected void RadDockLayout1_SaveDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e) { string dockState; System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState(); StringBuilder serializedList = new StringBuilder(); int i = 0; while (i < stateList.Count) { serializedList.Append(serializer.Serialize(stateList[i])); serializedList.Append(«|»); i++; } dockState = serializedList.ToString(); if (dockState.Trim() != String.Empty) { try { _conn.Open(); SqlCommand command = new SqlCommand(String.Format(«update States set State=‘{0}’ where id=1«, dockState), _conn); command.ExecuteNonQuery(); _conn.Close(); } catch { } } //Save the dockState string into DB } protected void RadDockLayout1_LoadDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e) { if (!LoadDefaults) // Perform this task only when not loading defaults,I.E when reading from database { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); //Get saved state string from the database — set it to dockState variable for example string dockState = «»; try { _conn.Open(); SqlCommand command = new SqlCommand(«select State from States where id=1«, _conn); dockState = command.ExecuteScalar().ToString(); _conn.Close(); } catch { } string[] currentDockStates = dockState.Split(‘|’); foreach (string stringState in currentDockStates) { if (stringState.Trim() != string.Empty) { DockState state = serializer.Deserialize<DockState>(stringState); e.Positions[state.UniqueName] = state.DockZoneID; e.Indices[state.UniqueName] = state.Index; } } } } }
Я установил веб-приложение 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
Не знаю, что делать дальше. Благодарю за небольшую помощь. Если у вас есть дополнительная информация, спросите меня.
Scripting Error: Control could not be found by ID
I’ve created a script (from excel VBA) to pull data from an ABAP report. I’m running it in batches due to the amount of data, time-out errors, etc. My problem is that the first 1-3 passes of my script work flawlessly and then i run the following error:
Run-time error '619': The control could not be found by id.
The particular step where the script is failing is below:
session.findById("wnd[0]/usr/cntlCONTAINER/shellcont/shell").pressToolbarContextButton "&MB_EXPORT"
This is the standard toolbar button for exporting to spreadsheet. If i accept that the script failed and attempt to record a new script at the same point after data has been pulled, SAP will give me the exact same code. When i encounter the error the button also appears shaded, almost as if it has been depressed but no secondary window pops up. I’ve tried to google the error and get mixed results in my searches. I do not have access to the debugging utility but i cant imagine it would give me much different data from what the script recorder provides. I also have a bit of code just before the export that changes the layout using a toolbar button which works fine.
Things i’ve tried, resetting the connection (set app=…), making the next batch begin at a new transaction (/n…), different paths to the spreadsheet.. but none have resolved. The script will eventually fail whether the batch size is 5 or 5000.