Getting Started - SAP GUI Scripting API 7.10

SAP GUI Scripting API 7.10 Send comments on this topic.
Introduction

SAP GUI Scripting API

Purpose
Ever since the release of SAP system version 4.6C, there has been only very limited support for emulating user interaction with a SAP system. Existing technologies, such as ITOLE or Guilib, connect to the SAP system at the protocol level and have never been able to emulate the behavior of the compound controls introduced with 4.6C.
For this reason, applications relying on emulating user input worked only on the decreasing number of transactions using only standard dynpro elements.
Examples of affected applications are:

  • Automatic testing of SAP functionality
  • Customized front end applications replacing the SAP GUI
  • Tools to customize applications on the SAP GUI level -> GuiXT
  • E-Learning applications that guide a user through SAP transactions

Integration
Many of the available SAP GUI controls were designed exclusively with user interaction in mind. As their business functionality is closely coupled with the user interface they cannot be instantiated outside the SAP GUI in a batch-like fashion.
We therefore decided not to add the business functionality of the SAP GUI controls to a low-level integration component such as Guilib. Instead the controls run within the SAP GUI, which itself exposes a new interface allowing the automation of tasks.

Features
We developed an object model representing the SAP GUI at runtime as a hierarchy of objects. Most of these expose an interface to an element of the user interface. These interfaces can be used to perform all the actions a user could do with the given element. In addition we offer outgoing interfaces through which an external application can receive notifications about events occurring within the SAP GUI.
Available uses for the scripting component include

  • Listening to the actions a user performs in the SAP GUI and record them as a script
  • Running a script that emulates user interaction
  • Logging the SAP system information, such as response time

Runtime hierarchy overview

Top level administrative objects
All objects defined in the scripting component's object model are available at runtime as members of a hierarchical tree with the root object being GuiApplication.

GuiApplication represents the process in which the SAP system activity takes place. Because of this there should always be only one GuiApplication object within a process. The children of GuiApplication are all the connections of class GuiConnection to the SAP systems available for scripting.

Connections are opened manually from the SAPLogon dialog or using the openConnection and openConnectionByConnectionString methods of GuiApplication from a script. As soon as a connection has been established a first session is created as a child of the connection. Up to 5 additional sessions can be created. Again, this can be done manually using the 'Create Session' menu item or toolbar button, or from a script using the CreateSession method of GuiSession.

While GuiApplication represents the overall SAP GUI application, a GuiSession represents a specific task being performed. For any given session there is exactly one transaction currently executed, and most tasks performed in SAP GUI can be performed within the context of one GuiSession.
These considerations determine the event model of the scripting component. A user's interactions are best recorded or logged in the context of one session, therefore the GuiSession exposes an outgoing interface that allows an application to listen to the user interaction.
On the other hand, the GuiApplication exposes an outgoing interface that raises administrative events, for example when a session is created or destroyed.

Top level user interface objects
A session usually has a GuiMainWindow as its child. This window is the starting point for user interaction with a session.

The children of the GuiMainWindow are easily identified straightforward.

Please note that the availability of some of these objects depends on the design mode used. The titlebar, for example, is available only in New Visual Design, not in classic mode, as can be seen in the following screenshot.

© SAP AG. All Rights Reserved.


Project Overview

Project Overview

Description

SAP GUI Scripting API 7.10

User Controls

Control | Description
GuiApplication | The GuiApplication represents the process in which all SAP GUI activity takes place. If the scripting component is accessed by attaching to a SAPlogon process, then GuiApplication will represent SAPlogon. GuiApplication is a creatable class. However, there must be only one component of this type in any process. GuiApplication extends GuiContainer.

Classes

Class Module | Description
GuiBarChart | The GuiBarChart is a powerful tool to display and modify time scale diagrams. The object is of a very technical nature. It should only be used for recording and playback, as most of the parameters can not be determined in any other way. GuiBarChart extends GuiShell.
GuiBox | A GuiBox is a simple frame with a name. The items inside the frame are not children of the box. GuiBox extends GuiVComponent. The type prefix is box. The name property is the ABAP fieldname.
GuiButton | GuiButton represents all push buttons that are on dynpros, the toolbar or in table controls. GuiButton extends GuiVComponent. The type prefix is btn, the name property is the fieldname taken from the SAP data dictionary There is one exception: for tabstrip buttons, it is the button id set in screen painter that is taken from the SAP data dictionary.
GuiCalendar | The calendar control can be used to select single dates or periods of time. GuiCalendar extends GuiShell.
GuiChart | The GuiChart object is of a very technical nature. It should only be used for recording and playback, as most of the parameters can not be determined in any other way.
GuiCheckBox | GuiCheckBox extends GuiVComponent. The type prefix is chk, the name is the fieldname taken from the SAP data dictionary.
GuiCollection | GuiCollection is similar to GuiComponentCollection, but its members are not necessarily extensions of GuiComponent. It can be used to pass a collection as a parameter to functions of scriptable objects. An object of this class is created by calling the CreateGuiCollection function of the GuiApplication.
GuiColorSelector | GuiColorSelector displays a set of colors for selection. It extends GuiShell.
GuiComboBox | The GuiComboBox looks somewhat similar to GuiCTextField, but has a completely different implementation. While pressing the combo box button of a GuiCTextField will open a new dynpro or control in which a selection can be made, GuiComboBox retrieves all possible choices on initialization from the server, so the selection is done solely on the client. GuiComboBox extends GuiVComponent. The type prefix is cmb, the name is the fieldname taken from the SAP data dictionary.
GuiComboBoxEntry | Members of the Entries collection of a GuiComboBox are of type GuiComBoxEntry
GuiComponent | GuiComponent is the base class for most classes in the Scripting API. It was designed to allow generic programming, meaning you can work with objects without knowing their exact type.
GuiComponentCollection | The GuiComponentCollection is used for collections elements such as the children property of containers. Each element of the collection is an extension of GuiComponent.
GuiConnection | A GuiConnection represents the connection between SAP GUI and an application server. Connections can be opened from SAPlogon or from GuiApplication’s openConnection and openConnectionByConnectionString methods. GuiConnection extends GuiContainer. The type prefix for GuiConnection is con, the name is con plus the connection number in square brackets.
GuiContainer | This interface resembles GuiVContainer. The only difference is that it is not intended for visual objects but rather administrative objects such as connections or sessions. Objects exposing this interface will therefore support GuiComponent but not GuiVComponent. GuiContainer extends GuiComponent.
GuiContainerShell | A GuiContainerShell is a wrapper for a set of GuiShell objects. GuiContainerShell extends GuiVContainer. The type prefix is shellcont, the name is the last part of the id, shellcont[n].
GuiContextMenu | A GuiContextMenu may have other GuiContextMenu objects as children. GuiContextMenu extends GuiMenu. The type is mnu, the name is the function code that is sent to the system when the menu item is selected.
GuiCTextField | If the cursor is set into a text field of type GuiCTextField a combo box button is displayed to the right of the text field. Pressing this button is equivalent to pressing the F4 key. The button is not represented in the scripting object model as a separate object; it is considered to be part of the text field. There are no other differences between GuiTextField and GuiCTextField. GuiCTextField extends GuiTextField. The type prefix is ctxt, the name is the Fieldname taken from the SAP data dictionary.
GuiCustomControl | The GuiCustomControl is a wrapper object that is used to place ActiveX controls onto dynpro screens. While GuiCustomControl is a dynpro element itself, its children are of GuiContainerShell type, which is a container for controls. GuiCustomControl extends GuiVContainer. The type prefix is cntl, the name is the fieldname taken from the SAP data dictionary.
GuiDialogShell | The GuiDialogShell is an external window that is used as a container for other shells, for example a toolbar. GuiDialogShell extends GuiVContainer. The type prefix is shellcont, the name is the last part of the id, shellcont[n].
GuiEAIViewer2D | The GuiEAIViewer2D control is used to view 2-dimensional graphic images in the SAP system. Presently Webviewer2D supports 22 available image types. The user can carry out redlining over the loaded image. The scripting wrapper for this control records all user actions during the redlining process and reproduces the same actions when the recorded script is replayed. GuiEAIViewer2D extends GuiShell.
GuiEAIViewer3D |
GuiFrameWindow | A GuiFrameWindow is a high level visual object in the runtime hierarchy. It can be either the main window or a modal popup window. See the GuiMainWindow and GuiModalWindow sections for examples. GuiFrameWindow itself is an abstract interface. GuiFrameWindow extends GuiVContainer. The type prefix is wnd, the name is wnd plus the window number in square brackets.
GuiGOSShell | The GuiGosShell is only available in New Visual Design mode. GuiGOSShell extends GuiVContainer. The type prefix is shellcont, the name is the last part of the id, shellcont[n].
GuiGraphAdapt | For the graphic adapter control only basic members from GuiShell are available. Recording and playback is not possible.
GuiGridView | The grid view is similar to the dynpro table control, but significantly more powerful. GuiGridView extends GuiShell.
GuiHTMLViewer | The GuiHTMLViewer is used to display an HTML document inside SAP GUI. GuiHTMLViewer extends GuiShell.
GuiLabel | GuiLabel extends GuiVComponent. The type prefix is lbl, the name is the fieldname taken from the SAP data dictionary.
GuiMainWindow | This window represents the main window of a SAP GUI session. GuiMainWindow extends GuiFrameWindow.
GuiMap | For the map control only basic members from GuiShell are available. Recording and playback is not possible.
GuiMenu | A GuiMenu may have other GuiMenu objects as children. GuiMenu extends GuiVContainer. The type prefix is menu, the name is the text of the menu item. If the item does not have a text, which is the case for separators, then the name is the last part of the id, menu[n].
GuiMenubar | Only the main window has a menubar. The children of the menubar are menus. GuiMenubar extends GuiVContainer. The type prefix and name are mbar.
GuiMessageWindow |
GuiModalWindow | A GuiModalWindow is a dialog pop-up. GuiModalWindow extends GuiFrameWindow.
GuiNetChart | The GuiNetChart is a powerful tool to display and modify entity relationship diagrams. It is of a very technical nature and shoud only be used for recording and playback, as most of the parameters can not be determined in any other way.
GuiOfficeIntegration |
GuiOkCodeField | The GuiOkCodeField is placed on the upper toolbar of the main window. It is a combo box into which commands can be entered. Setting the text of GuiOkCodeField will not execute the command until server communication is started, for example by emulating the Enter key (VKey 0). GuiOkCodeField extends GuiVComponent. The type prefix is okcd, the name is empty.
GuiPasswordField | The only difference between GuiTextField and GuiPasswordField is that the Text property can not be read for a password field. The returned text is always empty. GuiPasswordField extends GuiTextField. The type prefix is pwd, the name is the fieldname taken from the SAP data dictionary.
GuiPicture | The picture control displays a picture on a SAP GUI screen. GuiPicture extends GuiShell.
GuiRadioButton | GuiRadioButton extends GuiVComponent. The type prefix is rad, the name is the fieldname taken from the SAP data dictionary.
GuiSapChart | For the SAP chart control only basic members from GuiShell are available. Recording and playback is not possible.
GuiScrollbar | The GuiScrollbar class is a utility class used for example in GuiScrollContainer or GuiTableControl.
GuiScrollContainer | This container represents scrollable subscreens. A subscreen may be scrollable without actually having a scrollbar, because the existence of a scrollbar depends on the amount of data displayed and the size of the GuiUserArea. GuiScrollContainer extends GuiVContainer. The type prefix is ssub, the name is generated from the data dictionary settings.
GuiSession | The GuiSession provides the context in which a user performs a certain task such as working with a transaction. It is therefore the access point for applications which record a user’s actions regarding a specific task or play back those actions. GuiSession extends GuiContainer. The type prefix is ses, the name is ses plus the session number in square brackets.
GuiSessionInfo | GuiSessionInfo is a member of all GuiSession objects. It makes available technical information about the session. Some of its properties are displayed in the right corner of the SAP GUI status line.
GuiShell | GuiShell is an abstract object whose interface is supported by all the controls. GuiShell extends GuiVContainer. The type prefix is shell, the name is is the last part of the id, shell[n].
GuiSimpleContainer | This container represents non-scrollable subscreens. It does not have any functionality apart from to the inherited interfaces. GuiSimpleContainer extends GuiVContainer. The type prefix is sub, the name is is generated from the data dictionary settings.
GuiSplit | GuiSplit extends GuiShell.
GuiSplitterContainer | The GuiSplitterContainer represents the dynpro splitter element, which was introduced in the Web Application Server ABAP in NetWeaver 7.1. The dynpro splitter element is similar to the activeX based splitter control, but it is a plain dynpro element.
GuiStage | For the stage control only basic members from GuiShell are available. Recording and playback is not possible.
GuiStatusbar | GuiStatusbar represents the message displaying part of the statusbar on the bottom of the SAP GUI window. It does not include the system and login information displayed in the rightmost area of the statusbar as these are available from the GuiSessionInfo object. GuiStatusbar extends GuiVComponent. The type prefix is sbar.
GuiStatusPane |
GuiTab | The GuiTab objects are the children of a GuiTabStrip object. GuiTab extends GuiVContainer. The type prefix is tabp, the name is the id of the tab’s button taken from SAP data dictionary.
GuiTableColumn | GuiTableColumn extends GuiComponentCollection.
GuiTableControl | The table control is a standard dynpro element, in contrast to the GuiCtrlGridView, which looks similar. GuiTableControl extends GuiVContainer. The type prefix is tbl, the name is the fieldname taken from the SAP data dictionary.
GuiTableRow | GuiTableRow extends GuiComponentCollection.
GuiTabStrip | A tab strip is a container whose children are of type GuiTab. GuiTabStrip extends GuiVContainer. The type prefix is tabs, the name is the fieldname taken from the SAP data dictionary.
GuiTextedit | The TextEdit control is a multiline edit control offering a number of possible benefits. With regard to scripting, the possibility of protecting text parts against editing by the user is especially useful.
GuiTextField | GuiTextField extends GuiVComponent. The type prefix is txt, the name is the fieldname taken from the SAP data dictionary.
GuiTitlebar | The titlebar is only displayed and exposed as a separate object in New Visual Design mode. GuiTitlebar extends GuiVContainer. The type prefix and name of GuiTitlebar are titl.
GuiToolbar | Every GuiFrameWindow has a GuiToolbar. The GuiMainWindow has two toolbars unless the second has been turned off by the ABAP application. The upper toolbar is the system toolbar, while the second toolbar is the application toolbar. The children of a GuiToolbar are buttons. The indexes for toolbar buttons are determined by the virtual key values defined for the button. GuiToolbar extends GuiVContainer. The type prefix and name are tbar.
GuiToolbarControl | GuiToolbarControl extends GuiShell.
GuiTree |
GuiUserArea | The GuiUserArea comprises the area between the toolbar and statusbar for windows of GuiMainWindow type and the area between the titlebar and toolbar for modal windows, and may also be limited by docker controls. The standard dynpro elements can be found only in this area, with the exception of buttons, which are also found in the toolbars. GuiUserArea extends GuiVContainer. The type prefix and name are usr.
GuiUtils |
GuiVComponent | The GuiVComponent interface is exposed by all visual objects, such as windows, buttons or text fields. Like GuiComponent, it is an abstract interface. Any object supporting the GuiVComponent interface also exposes the GuiComponent interface. GuiVComponent extends GuiComponent.
GuiVContainer | An object exposes the GuiVContainer interface if it is both visible and can have children. It will then also expose GuiComponent and GuiVComponent. Examples of this interface are windows and subscreens, toolbars or controls having children, such as the splitter control. GuiVContainer extends GuiContainer and GuiVComponent.

Public Enumerations

Enumeration | Description
GuiComponentType |
GuiErrorType |
GuiEventType |
GuiImageType | SAP GUI Image types
GuiMessageBoxOption | SAP GUI Message Box Options
GuiMessageBoxResult | SAP GUI Message Box Results
GuiMessageBoxType | SAP GUI Message Box Types
GuiScrollbarType |
GuiTableSelectionType |

Remarks

SAP OSS Notes on SAP GUI Scripting

  • 480149: Describes the ABAP and kernel patch level requirements
  • 587202: Limitations of SAP GUI Scripting
  • 548788: Creating trace files of SAP GUI Scripting problems to be send to SAP
  • 527737: Composite SAP note on SAP GUI Scripting
  • 612454: SAP GUI Scripting: Status and Lifetime
  • 619459: SAP GUI Scripting support of SAP applications
  • 692245 Additional server based security options for Scripting

SAP OSS Queue for SAP GUI Scripting

  • BC-FES-SCR


Getting Started - SAP GUI Scripting API 7.10

Getting Started

Requirements

SAP System
Scripting support is available for the 3.1I, 4.0B, 4.5B, 4.6B, 4.6C, 4.6D, 6.10, and 6.20 releases and all subsequent releases.
For the releases 3.1I to 6.10 ABAP support packages and the SAP kernel patches are available to add the support, while they are already part of 6.20 and later releases. Note 480149 lists the required patch levels.

SAP GUI
The scripting interface can be installed with the SAP GUI release 6.20 and later releases. This document is based on SAP GUI 7.10 patch 2. Some of the functionality described here may be missing from older versions of SAP GUI.


GuiApplication Control

GuiApplication Control
See Also Members

Description

The GuiApplication represents the process in which all SAP GUI activity takes place. If the scripting component is accessed by attaching to a SAPlogon process, then GuiApplication will represent SAPlogon. GuiApplication is a creatable class. However, there must be only one component of this type in any process. GuiApplication extends GuiContainer.

Object Model

Remarks

The type prefix and the value of the name property are 'app'.

When running a recorded script in Excel you may receive an error message 'Invalid use of property'. This may be caused by a name collision for the 'application' object. In Excel this name is predefined, and it will collide with the code generated by the SAP GUI Scripting recorder. To fix the problem, rename the SAP GUI application object.

Example

Using CreateObject | Using GetObject

See Also

GuiApplication Members


GuiApplication Control Members

GuiApplication Control Members
See Also Overview

Public Methods

Public Method AddHistoryEntry | SAP GUI for Windows has an input history functionality, which displays for text fields the entries made in the past as a suggestion. With this function, an entry can be added to the history database so that it will be available the next time the end user accesses the text field with the given field name.
Public Method CreateGuiCollection | Some functions accept collections as parameters. This function creates a collection object that is independent of the scripting language used, such as VBScript or JavaScript.
Public Method DropHistory | Calling this function will delete all entries from the input history. The function returns True if the history data have been deleted successfully.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method Ignore | eCATT uses this function to prevent scripts from accessing the session in which eCATT itself runs. Otherwise the the token handling would cause a dead lock.
Public Method OpenConnection | The parameter connectString should contain one of the descriptions displayed in SAPlogon, for example "XYZ [PUBLIC]". If you want to create a new SAP GUI instance and place it within your application you may add the suffix “/INPLACE”. This function will raise the exception E_ACCESSDENIED if the scripting support has been disabled by the administrator or the user.
Public Method OpenConnectionByConnectionString | The parameter connectionData is the connection string for the SAP server, for example “/R/ALR/G/SPACE”. See the description of the openConnection method for a discussion of the sync and raise parameters.
Public Method RegisterROT | Accessing the SAPGUI entry in the Running Object Table from a C++ application may fail unless the interface is registered with a strong reference. This is not required when using Visual Basic or scripting languages. The reference must be released using revokeRot before shutting down the Scripting component. Failing to do so will lead to undefined behaviour. Most applications do not need to use this method, and shouldn’t call it.
Public Method RevokeROT | This method must be called before shutting down the Scripting component if registerROT was used.

Public Properties

Public Property ActiveSession | Returns the Session that the user is currently working with, which will be the topmost window.
Public Property AllowSystemMessages | System messages are displayed when an administrator invokes them on the server to send a notification to users currently logged in. This may happen at any time and interfere with the recording or playback of a script. Setting this property to FALSE will prevent system messages from being displayed.
Public Property ButtonbarVisible | Setting this property to FALSE hides the application toolbar of the main window.
Public Property Children | This collection contains all direct children of the object.
Public Property ConnectionErrorText | This property contains the text of a connection error message. If openConnection fails you can retrieve information about the cause of the failure from this property.
Public Property Connections | This property is another name for the Children property. It has been added for better readability as all the children of GuiApplication are connections.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property HistoryEnabled | The local history function can be enabled or disabled using this property. Disabling it will significantly improve the performance of SAP GUI, which may be crucial during load tests, for example.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property MajorVersion | Version of the SAP GUI release, for example ‘6.20’.
Public Property MinorVersion | Build number of the scripting component.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property NewVisualDesign | Returns whether New Visual Design or Classic mode are used for the user interface.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property Patchlevel | Patchlevel of SAP GUI.
Public Property Revision | Revision of the SAP GUI release. In SAP GUI for Windows this is the compilation number.
Public Property StatusbarVisible | Setting this property to FALSE hides the statusbar of the main window.
Public Property TitlebarVisible | Setting this property to FALSE hides the titlebar of the main window.
Public Property ToolbarVisible | Setting this property to FALSE hides the system toolbar of the main window.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Utils | This property returns a global GuiUtils object.

Events

Public Event CreateSession | This event is raised whenever a new session is created, irrespective of whether of the session being created manually, from ABAP or by a script. The event is only raised for a session if the scripting support has been enabled for the corresponding backend.
Public Event DestroySession | This event is raised before a session is destroyed . This can be done either by closing the main window manually, or by calling the closeSession method of GuiConnection.
Public Event Error | An error event is currently only raised, if the wrapper library required to access a SAP GUI ActiveX control from a script is not available. This event is also available on the GuiSession in which the error occurred.
Public Event IgnoreSession | The event is fired when a session is set to ‘Ignored’ using IgnoreSession function. This event is only fired when using SAP GUI Scripting while running eCATT in parallel.

See Also

GuiApplication Overview


AddHistoryEntry Method

AddHistoryEntry Method
See Also
Fieldname
Value

Description

SAP GUI for Windows has an input history functionality, which displays for text fields the entries made in the past as a suggestion. With this function, an entry can be added to the history database so that it will be available the next time the end user accesses the text field with the given field name.

Syntax

Visual Basic
Public Function AddHistoryEntry( _
   ByVal Fieldname As String, _
   ByVal Value As String _
) As Byte

Parameters

Fieldname
Value

Remarks

For a given text field, the field name can be determined by positioning the cursor on the field and pressing F1. A new window is then opened for the Performance Assistant, which has a Technical Information button. Using this will display the dialog below. The field name is displayed at the bottom of the dialog as ‘Screen field’. The functions returns True if the entry was added successfully.

See Also

GuiApplication Control


CreateGuiCollection Method

CreateGuiCollection Method

Description

Some functions accept collections as parameters. This function creates a collection object that is independent of the scripting language used, such as VBScript or JavaScript.

Syntax

Visual Basic
Public Function CreateGuiCollection() As Object

See Also

GuiApplication Control


DropHistory Method

DropHistory Method

Description

Calling this function will delete all entries from the input history. The function returns True if the history data have been deleted successfully.

Syntax

Visual Basic
Public Function DropHistory() As Byte

See Also

GuiApplication Control


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiApplication Control


Ignore Method

Ignore Method
WindowHandle

Description

eCATT uses this function to prevent scripts from accessing the session in which eCATT itself runs. Otherwise the the token handling would cause a dead lock.

Syntax

Visual Basic
Public Sub Ignore( _
   ByVal WindowHandle As Integer _
)

Parameters

WindowHandle

See Also

GuiApplication Control


OpenConnection Method

OpenConnection Method
Description
Sync
Raise

Description

The parameter connectString should contain one of the descriptions displayed in SAPlogon, for example "XYZ [PUBLIC]". If you want to create a new SAP GUI instance and place it within your application you may add the suffix “/INPLACE”.

This function will raise the exception E_ACCESSDENIED if the scripting support has been disabled by the administrator or the user.

Syntax

Visual Basic
Public Function OpenConnection( _
   ByVal Description As String, _
   Optional ByVal Sync As Variant, _
   Optional ByVal Raise As Variant _
) As GuiConnection

Parameters

Description
Sync
Raise

Remarks

When opening connections manually SAP GUI executes the request asynchronously, so that the SAPLogon dialog remains responsive after requesting a new connection. This behaviour is also the default for SAP GUI Scripting.

In the Scripting context it means that the call to openConnection may return before the new connection has been opened. A side effect of this is that when opening a connection fails SAP GUI displays an error popup that can not be handled from the script. This problem can be solved by setting the sync parameter to True. Then the call to openConnection will not return until a connection has been established, or an error has been detected. If sync is set to True and an error occurs an exception is raised, unless the parameter raise is set to False.

Example

In the following example the scripting component has been placed on an HTML page and the connection was opened in the pageLoad event handler using the “/INPLACE” switch.

See Also

GuiApplication Control


OpenConnectionByConnectionString Method

OpenConnectionByConnectionString Method
ConnectString
Sync
Raise

Description

The parameter connectionData is the connection string for the SAP server, for example “/R/ALR/G/SPACE”. See the description of the openConnection method for a discussion of the sync and raise parameters.

Syntax

Visual Basic
Public Function OpenConnectionByConnectionString( _
   ByVal ConnectString As String, _
   Optional ByVal Sync As Variant, _
   Optional ByVal Raise As Variant _
) As GuiConnection

Parameters

ConnectString
Sync
Raise

Remarks

Connection Strings

Connection String is a technical term used within SAP GUI. A connection string describes a connection address for a destination, e.g. an SAP system's application server, similar to an Internet URL describes a location for a web page.

Simple Connection Strings
In its simplest form, a connection string contains an IP address and a port number. This information is sufficient for SAP GUI to open a direct TCP connection to a destination, e.g. an application server. IP address and port number are marked with the prefixes '/H/' (for host) and '/S/' (for service). Note that the port number for an SAP application server is by convention 3200 plus the two-digit SAP system number.

Example for a simple connection string with an application server's IP address (172.16.64.17) and port number (3200):
/H/172.16.64.17/S/3200

If your network environment supports DNS (Domain Name Services), a hostname can be used instead of the IP address in all kinds of connection strings. (This requires a correct DNS configuration on the client, e.g. via the hosts file).

Example with an application server's hostname (iwdf8997.wdf.sap-ag.de) and port number (3200):
/H/iwdf8997.wdf.sap-ag.de/S/3200

If your network environment supports symbolic service names for well-known ports, the symbolic service name can be used instead of the port number in all kinds of connection strings. (This requires a correct service configuration on the client, e.g. in the services file). Note that SAP application server ports are by convention named 'sapdp<SID>', where <SID> is the SAP system id.

Example with host name (iwdf8997.wdf.sap-ag.de) and symbolic service name (sapdpIWD):
/H/iwdf8997.wdf.sap-ag.de/S/sapdpIWD

Simple connection strings need not be resolved by the SAP GUI application. Resolution of host names and symbolic service names is done by the operating system's network layer.

SAP Routers

In a WAN (Wide Area Network) environment, SAP routers are used to make connections to remote SAP systems that cannot be reached with a direct TCP connection. Passwords may be used for each SAP router to control access.

In order to make a connection, the client is responsible for providing the complete route to the destination, possibly including a chain of several SAP routers. Path information is not provided by the routers. (Strictly speaking, a SAP router is actually better described as an application level proxy with password capabilities and strict source routing).

The address for each router is specified by a simple connection string (with the router's host name and port number), optionally followed by '/P/' and the router password. The path from the current location to the destination is described by concatenating all router addresses, followed by the address of the destination SAP system. Thus, a connection string with SAP routers generally has the form <router 1><router 2>...<router n><destination>.

Example with two routers (gate.acme.com, port 3299, and gate.sap.com, port 3298), the first using a password (secret), for a connection to the application server iwdf8997.sap.com, port 3200):
/H/gate.acme.com/S/3299/P/secret/H/gate.sap.com/S/3298/H/iwdf8997.sap.com/S/3200
<-------- 1st router ----------><---- 2nd router ----><------ app_server ------>

Connection strings including SAP routers are passed to SAP GUI's communication layer and resolved step by step by the routers on the path. If host names and symbolic service names are used, each router must have access to correct network configuration information to resolve them.

Message Servers and Logon Groups

For load balancing purposes, application servers from one SAP system are usually configured in logon groups, where each group serves a particular kind of user. The application servers in each group are assigned to users by a least-heavily-loaded strategy. This load balancing is done by message servers. Each SAP system has exactly one message server, which can be reached via TCP on a specific message server port.

Care should be taken that the application server's port number is not confused with the message server's port number. Although the message server's host name may in small installations often be identical to the hostname of an application server, the port number is always different. Symbolic service names for message servers by convention have the form 'sapms<SID>', where <SID> is the SAP system id.

Message server and group information can be used to address a SAP system in a connection string. The address of the message server is specified as a combination of message server host name, message server port and group name. This information is marked with the prefixes '/M/' (message server host name), '/S/' (message server port) and '/G/' (logon group).

Example with message server (hostname alrmain, port number 4253) and logon group (SPACE):
/M/alrmain.wdf.sap-ag.de/S/4253/G/SPACE

Connection strings with message servers are resolved by SAP GUI by contacting the message server and retrieving the (simple) connection string of an application server for the specified group. This requires network access to the message server at the time the address is resolved.

SAP router connection strings may be used in combination with message server connection strings simply by specifying the router address before the message server address. The router is then used for contacting the message server as well as for contacting the resolved application server.

Symbolic System Names

The most user-friendly form of connection string addresses an SAP system only by its symbolic name (per convention, the system id) and the logon group name. These information are marked with the prefixes '/R/' (for the symbolic SAP system name) and '/G/' (for the logon group name).

Example with SAP system (ALR) and logon group (SPACE):
/R/ALR/G/SPACE

Connection strings with symbolic system names are resolved by SAP GUI by looking up the symbolic SAP system name in the Message Server List (a text file containing a mapping between symbolic system names and message server addresses) and replacing the /R/ part of the connection string with the resulting message server address. The result is a complete message server connection string which is then further resolved as explained above.

Formal syntax

For the technically interested reader, the following BNF grammar formally describes the syntax of connection strings:
<connection string> := [<router prefix>]<local>
<local> := <simple>|<message server>|<symbolic>
<simple> := "/H/"<host>"/S/"<service>
<host> := <hostname>|<ipaddr>
<hostname> := (any DNS hostname)
<ipaddr> := (any IP address, in dotted decimal form)
<service> := <servicename>|<port number>
<servicename> := (any IP service name)
<port number> := (any decimal number)
<messageserver> := "/M/"<host>"/S/"<service>"/G/"<group>
<group> := (any ASCII string not containing '/')
<symbolic> := "/R/"<system>"/G/"<group>
<system> := (any ASCII string not containing '/')
<router prefix> := <router>*
<router> := "/H/"<host>"/S/"<service>["/P/"<password>]
<password> := (any ASCII string not containing '/')

See Also

GuiApplication Control


RegisterROT Method

RegisterROT Method

Description

Accessing the SAPGUI entry in the Running Object Table from a C++ application may fail unless the interface is registered with a strong reference. This is not required when using Visual Basic or scripting languages.
The reference must be released using revokeRot before shutting down the Scripting component. Failing to do so will lead to undefined behaviour.
Most applications do not need to use this method, and shouldn’t call it.

Syntax

Visual Basic
Public Function RegisterROT() As Byte

See Also

GuiApplication Control


RevokeROT Method

RevokeROT Method

Description

This method must be called before shutting down the Scripting component if registerROT was used.

Syntax

Visual Basic
Public Sub RevokeROT()

See Also

GuiApplication Control


ActiveSession Property

ActiveSession Property

Description

Returns the Session that the user is currently working with, which will be the topmost window.

Property type

Read-only property

Syntax

Visual Basic
Public Property ActiveSession() As Object

See Also

GuiApplication Control


AllowSystemMessages Property

AllowSystemMessages Property

Description

System messages are displayed when an administrator invokes them on the server to send a notification to users currently logged in. This may happen at any time and interfere with the recording or playback of a script. Setting this property to FALSE will prevent system messages from being displayed.

Property type

Read-write property

Syntax

Visual Basic
Public Property AllowSystemMessages() As Byte

See Also

GuiApplication Control


ButtonbarVisible Property

ButtonbarVisible Property

Description

Setting this property to FALSE hides the application toolbar of the main window.

Property type

Read-write property

Syntax

Visual Basic
Public Property ButtonbarVisible() As Byte

Remarks

Hiding the application toolbar may be useful if SAP GUI is displayed inplace, for example in a web page. The property should not be used when displaying SAP GUI as a standalone application.

See Also

GuiApplication Control


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiApplication Control


ConnectionErrorText Property

ConnectionErrorText Property

Description

This property contains the text of a connection error message. If openConnection fails you can retrieve information about the cause of the failure from this property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ConnectionErrorText() As String

See Also

GuiApplication Control


Connections Property

Connections Property

Description

This property is another name for the Children property. It has been added for better readability as all the children of GuiApplication are connections.

Property type

Read-only property

Syntax

Visual Basic
Public Property Connections() As GuiComponentCollection

See Also

GuiApplication Control


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiApplication Control


HistoryEnabled Property

HistoryEnabled Property

Description

The local history function can be enabled or disabled using this property. Disabling it will significantly improve the performance of SAP GUI, which may be crucial during load tests, for example.

Property type

Read-write property

Syntax

Visual Basic
Public Property HistoryEnabled() As Byte

See Also

GuiApplication Control


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiApplication Control


MajorVersion Property

MajorVersion Property

Description

Version of the SAP GUI release, for example ‘6.20’.

Property type

Read-only property

Syntax

Visual Basic
Public Property MajorVersion() As Long

See Also

GuiApplication Control


MinorVersion Property

MinorVersion Property

Description

Build number of the scripting component.

Property type

Read-only property

Syntax

Visual Basic
Public Property MinorVersion() As Long

See Also

GuiApplication Control


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiApplication Control


NewVisualDesign Property

NewVisualDesign Property

Description

Returns whether New Visual Design or Classic mode are used for the user interface.

Property type

Read-only property

Syntax

Visual Basic
Public Property NewVisualDesign() As Byte

Example

False: Classic mode

True: New Visual Design

See Also

GuiApplication Control


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiApplication Control


Patchlevel Property

Patchlevel Property

Description

Patchlevel of SAP GUI.

Property type

Read-only property

Syntax

Visual Basic
Public Property Patchlevel() As Long

See Also

GuiApplication Control


Revision Property

Revision Property

Description

Revision of the SAP GUI release. In SAP GUI for Windows this is the compilation number.

Property type

Read-only property

Syntax

Visual Basic
Public Property Revision() As Long

See Also

GuiApplication Control


StatusbarVisible Property

StatusbarVisible Property

Description

Setting this property to FALSE hides the statusbar of the main window.

Property type

Read-write property

Syntax

Visual Basic
Public Property StatusbarVisible() As Byte

Remarks

Hiding the statusbar may be useful if SAP GUI is displayed inplace, for example in a web page. The property should not be used when displaying SAP GUI as a standalone application.

See Also

GuiApplication Control


TitlebarVisible Property

TitlebarVisible Property

Description

Setting this property to FALSE hides the titlebar of the main window.

Property type

Read-write property

Syntax

Visual Basic
Public Property TitlebarVisible() As Byte

Remarks

The titlebar is only available when SAP GUI is displayed in New Visual Design.

Hiding the titlebar may be useful if SAP GUI is displayed inplace, for example in a web page. The property should not be used when displaying SAP GUI as a standalone application.

See Also

GuiApplication Control


ToolbarVisible Property

ToolbarVisible Property

Description

Setting this property to FALSE hides the system toolbar of the main window.

Property type

Read-write property

Syntax

Visual Basic
Public Property ToolbarVisible() As Byte

Return Type

Hiding the system toolbar may be useful if SAP GUI is displayed inplace, for example in a web page. The property should not be used when displaying SAP GUI as a standalone application.

See Also

GuiApplication Control


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiApplication Control


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiApplication Control


Utils Property

Utils Property

Description

This property returns a global GuiUtils object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Utils() As GuiUtils

See Also

GuiApplication Control


CreateSession Event

CreateSession Event
Session

Description

This event is raised whenever a new session is created, irrespective of whether of the session being created manually, from ABAP or by a script. The event is only raised for a session if the scripting support has been enabled for the corresponding backend.

Syntax

Visual Basic
Public Event CreateSession( _
   ByVal Session As GuiSession _
)

Parameters

Session

Example

The following script attaches itself to the SAPlogon process and displays a pop-up whenever a new session is created.

Dim objSapGui
Set objSapGui = GetObject("SAPGUI")

Dim objScriptingEngine
Set objScriptingEngine = objSapGui.GetScriptingEngine
WScript.ConnectObject objScriptingEngine, "Engine_"

Dim Waiting
Waiting = 1

Do While (Waiting = 1)
WScript.Sleep(100)
Loop

Set objScriptingEngine = Nothing
Set objSapGui = Nothing

Sub Engine_CreateSession(ByVal Session)
Dim result
result = MsgBox("Session created", vbOKCancel)
If result = vbCancel then
Waiting = 0
End If
End Sub

See Also

GuiApplication Control


DestroySession Event

DestroySession Event
Session

Description

This event is raised before a session is destroyed . This can be done either by closing the main window manually, or by calling the closeSession method of GuiConnection.

Syntax

Visual Basic
Public Event DestroySession( _
   ByVal Session As GuiSession _
)

Parameters

Session

Example

You can handle this event from VBScript by adding the following procedure to the sample script on previous page:
Sub Engine_DestroySession(ByVal Session)
Dim result
result = MsgBox("Session destroyed",vbOKCancel)
If result = vbCancel then
Waiting = 0
End If
End Sub

See Also

GuiApplication Control


Error Event

Error Event
ErrorId
Desc1
Desc2
Desc3
Desc4

Description

An error event is currently only raised, if the wrapper library required to access a SAP GUI ActiveX control from a script is not available. This event is also available on the GuiSession in which the error occurred.

Syntax

Visual Basic
Public Event Error( _
   ByVal ErrorId As Long, _
   ByVal Desc1 As String, _
   ByVal Desc2 As String, _
   ByVal Desc3 As String, _
   ByVal Desc4 As String _
)

Parameters

ErrorId
Desc1
Desc2
Desc3
Desc4

See Also

GuiApplication Control


IgnoreSession Event

IgnoreSession Event
SessionMainWindowHandle

Description

The event is fired when a session is set to ‘Ignored’ using IgnoreSession function. This event is only fired when using SAP GUI Scripting while running eCATT in parallel.

Syntax

Visual Basic
Public Event IgnoreSession( _
   ByVal SessionMainWindowHandle As Integer _
)

Parameters

SessionMainWindowHandle

See Also

GuiApplication Control


GuiBarChart Object

GuiBarChart Object
See Also Members

Description

The GuiBarChart is a powerful tool to display and modify time scale diagrams.

The object is of a very technical nature. It should only be used for recording and playback, as most of the parameters can not be determined in any other way. GuiBarChart extends GuiShell.

Object Model

Example

See Also

GuiBarChart Members


GuiBarChart Object Members

GuiBarChart Object Members
See Also Overview

Public Methods

Public Method BarCount | Returns the number of bars in the given chart.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method GetBarContent | Returns the content of the bar.
Public Method GetGridLineContent | Returns the content of the grid line.
Public Method GridCount | Returns the number of grids within the chart.
Public Method LinkCount | Returns the number of links within the given chart.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SendData | Send data to the server.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property ChartCount | Number of charts.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “sapbarc”.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiBarChart Overview


BarCount Method

BarCount Method
chartId
Index of the chart

Description

Returns the number of bars in the given chart.

Syntax

Visual Basic
Public Function BarCount( _
   ByVal chartId As Long _
) As Long

Parameters

chartId
Index of the chart

See Also

GuiBarChart Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiBarChart Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiBarChart Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiBarChart Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiBarChart Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiBarChart Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiBarChart Object


GetBarContent Method

GetBarContent Method
chartId
Index of the chart
barId

Index of the bar within the given chart.

textId
Internal value, do be determined during recording.

Description

Returns the content of the bar.

Syntax

Visual Basic
Public Function GetBarContent( _
   ByVal chartId As Long, _
   ByVal barId As Long, _
   ByVal textId As Long _
) As String

Parameters

chartId
Index of the chart
barId

Index of the bar within the given chart.

textId
Internal value, do be determined during recording.

See Also

GuiBarChart Object


GetGridLineContent Method

GetGridLineContent Method
chartId
Index of the chart
gridlineId
Index of the grid line within the given chart.
textId
Internal value, do be determined during recording.

Description

Returns the content of the grid line.

Syntax

Visual Basic
Public Function GetGridLineContent( _
   ByVal chartId As Long, _
   ByVal gridlineId As Long, _
   ByVal textId As Long _
) As String

Parameters

chartId
Index of the chart
gridlineId
Index of the grid line within the given chart.
textId
Internal value, do be determined during recording.

See Also

GuiBarChart Object


GridCount Method

GridCount Method
chartId
Index of the chart

Description

Returns the number of grids within the chart.

Syntax

Visual Basic
Public Function GridCount( _
   ByVal chartId As Long _
) As Long

Parameters

chartId
Index of the chart

See Also

GuiBarChart Object


LinkCount Method

LinkCount Method
chartId
Index of the chart

Description

Returns the number of links within the given chart.

Syntax

Visual Basic
Public Function LinkCount( _
   ByVal chartId As Long _
) As Long

Parameters

chartId
Index of the chart

See Also

GuiBarChart Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiBarChart Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiBarChart Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiBarChart Object


SendData Method

SendData Method
Data
Internal data stream. To be determined during recording.

Description

Send data to the server.

Syntax

Visual Basic
Public Sub SendData( _
   ByVal Data As String _
)

Parameters

Data
Internal data stream. To be determined during recording.

See Also

GuiBarChart Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiBarChart Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiBarChart Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiBarChart Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiBarChart Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiBarChart Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiBarChart Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiBarChart Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiBarChart Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiBarChart Object


ChartCount Property

ChartCount Property

Description

Number of charts.

Property type

Read-only property

Syntax

Visual Basic
Public Property ChartCount() As Long

See Also

GuiBarChart Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiBarChart Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiBarChart Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiBarChart Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiBarChart Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiBarChart Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiBarChart Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiBarChart Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiBarChart Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiBarChart Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiBarChart Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiBarChart Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiBarChart Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiBarChart Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiBarChart Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiBarChart Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiBarChart Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiBarChart Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiBarChart Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “sapbarc”.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiBarChart Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiBarChart Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiBarChart Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiBarChart Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiBarChart Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiBarChart Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiBarChart Object


GuiBox Object

GuiBox Object
See Also Members

Description

A GuiBox is a simple frame with a name. The items inside the frame are not children of the box. GuiBox extends GuiVComponent. The type prefix is box. The name property is the ABAP fieldname.

Object Model

See Also

GuiBox Members


GuiBox Object Members

GuiBox Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiBox Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiBox Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiBox Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiBox Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiBox Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiBox Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiBox Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiBox Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiBox Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiBox Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiBox Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiBox Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiBox Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiBox Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiBox Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiBox Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiBox Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiBox Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiBox Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiBox Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiBox Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiBox Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiBox Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiBox Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiBox Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiBox Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiBox Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiBox Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiBox Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiBox Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiBox Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiBox Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiBox Object


GuiButton Object

GuiButton Object
See Also Members

Description

GuiButton represents all push buttons that are on dynpros, the toolbar or in table controls. GuiButton extends GuiVComponent. The type prefix is btn, the name property is the fieldname taken from the SAP data dictionary There is one exception: for tabstrip buttons, it is the button id set in screen painter that is taken from the SAP data dictionary.

Object Model

See Also

GuiButton Members


GuiButton Object Members

GuiButton Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method Press This emulates manually pressing a button. Pressing a button will always cause server communication to occur, rendering all references to elements below the window level invalid. The following code will therefore fail:

Set TextField = session.findById(".../txtF1")
session.findById(".../btnPB5").press
TextField.text = "Hello"

Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property LeftLabel | Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property RightLabel | Right label of the component. This property is set in screenpainter using the 'assign right' flag.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiButton Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiButton Object


Press Method

Press Method

Description

This emulates manually pressing a button. Pressing a button will always cause server communication to occur, rendering all references to elements below the window level invalid. The following code will therefore fail:

Set TextField = session.findById(".../txtF1")
session.findById(".../btnPB5").press
TextField.text = "Hello"

Syntax

Visual Basic
Public Sub Press()

See Also

GuiButton Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiButton Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiButton Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiButton Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiButton Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiButton Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiButton Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiButton Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiButton Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiButton Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiButton Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiButton Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiButton Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiButton Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiButton Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiButton Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiButton Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiButton Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiButton Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiButton Object


LeftLabel Property

LeftLabel Property

Description

Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.

Property type

Read-only property

Syntax

Visual Basic
Public Property LeftLabel() As GuiVComponent

See Also

GuiButton Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiButton Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiButton Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiButton Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiButton Object


RightLabel Property

RightLabel Property

Description

Right label of the component. This property is set in screenpainter using the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property RightLabel() As GuiVComponent

See Also

GuiButton Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiButton Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiButton Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiButton Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiButton Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiButton Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiButton Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiButton Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiButton Object


GuiCalendar Object

GuiCalendar Object
See Also Members

Description

The calendar control can be used to select single dates or periods of time. GuiCalendar extends GuiShell.

Object Model

Example

See Also

GuiCalendar Members


GuiCalendar Object Members

GuiCalendar Object Members
See Also Overview

Public Methods

Public Method ContextMenu | Calling this function opens a context menu.
Public Method CreateDate |
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method GetColor |
Public Method GetColorInfo |
Public Method GetDateTooltip |
Public Method GetDay |
Public Method GetMonth |
Public Method GetWeekday |
Public Method GetWeekNumber |
Public Method GetYear |
Public Method IsWeekend |
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SelectMonth |
Public Method SelectRange |
Public Method SelectWeek |
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property endSelection |
Public Property FirstVisibleDate | This is the earliest date visible in the calendar control. In the example above the value would be “20020228”.
Public Property FocusDate | The currently focussed date (identified by the focus border; see picture above) in the calendar control is available in the format “YYYYMMDD”. In this example it is “20020320”
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property horizontal |
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property LastVisibleDate |
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SelectionInterval | The interval is represented by two concatenated date strings separated by a comma.
Public Property startSelection |
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Calendar”.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Today |
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiCalendar Overview


ContextMenu Method

ContextMenu Method
CtxMenuId

Indicates the cell type of the cell in which the context menu was opened:

Value | Cell Type | Description
0 | Date | Invocation on a cell with a single date
1 | Weekday | Weekday Invocation on a button for a certain day of the week.
2 | Week | Invocation on a button for a specific week.

CtxMenuCellRow
CtxMenuCellCol
DateBegin
DateEnd

Description

Calling this function opens a context menu.

Syntax

Visual Basic
Public Sub ContextMenu( _
   ByVal CtxMenuId As Long, _
   ByVal CtxMenuCellRow As Long, _
   ByVal CtxMenuCellCol As Long, _
   ByVal DateBegin As String, _
   ByVal DateEnd As String _
)

Parameters

CtxMenuId

Indicates the cell type of the cell in which the context menu was opened:

Value | Cell Type | Description
0 | Date | Invocation on a cell with a single date
1 | Weekday | Weekday Invocation on a button for a certain day of the week.
2 | Week | Invocation on a button for a specific week.

CtxMenuCellRow
CtxMenuCellCol
DateBegin
DateEnd

See Also

GuiCalendar Object


CreateDate Method

CreateDate Method
day
month
year

Syntax

Visual Basic
Public Function CreateDate( _
   ByVal day As Long, _
   ByVal month As Long, _
   ByVal year As Long _
) As String

Parameters

day
month
year

See Also

GuiCalendar Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiCalendar Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiCalendar Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiCalendar Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiCalendar Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiCalendar Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiCalendar Object


GetColor Method

GetColor Method
from

Syntax

Visual Basic
Public Function GetColor( _
   ByVal from As String _
) As Long

Parameters

from

See Also

GuiCalendar Object


GetColorInfo Method

GetColorInfo Method
Color

Syntax

Visual Basic
Public Function GetColorInfo( _
   ByVal Color As Long _
) As String

Parameters

Color

See Also

GuiCalendar Object


GetDateTooltip Method

GetDateTooltip Method
date

Syntax

Visual Basic
Public Function GetDateTooltip( _
   ByVal date As String _
) As String

Parameters

date

See Also

GuiCalendar Object


GetDay Method

GetDay Method
date

Syntax

Visual Basic
Public Function GetDay( _
   ByVal date As String _
) As Long

Parameters

date

See Also

GuiCalendar Object


GetMonth Method

GetMonth Method
date

Syntax

Visual Basic
Public Function GetMonth( _
   ByVal date As String _
) As Long

Parameters

date

See Also

GuiCalendar Object


GetWeekday Method

GetWeekday Method
date

Syntax

Visual Basic
Public Function GetWeekday( _
   ByVal date As String _
) As String

Parameters

date

See Also

GuiCalendar Object


GetWeekNumber Method

GetWeekNumber Method
date

Syntax

Visual Basic
Public Function GetWeekNumber( _
   ByVal date As String _
) As Long

Parameters

date

See Also

GuiCalendar Object


GetYear Method

GetYear Method
date

Syntax

Visual Basic
Public Function GetYear( _
   ByVal date As String _
) As Long

Parameters

date

See Also

GuiCalendar Object


IsWeekend Method

IsWeekend Method
date

Syntax

Visual Basic
Public Function IsWeekend( _
   ByVal date As String _
) As Long

Parameters

date

See Also

GuiCalendar Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiCalendar Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiCalendar Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiCalendar Object


SelectMonth Method

SelectMonth Method
month
year

Syntax

Visual Basic
Public Sub SelectMonth( _
   ByVal month As Long, _
   ByVal year As Long _
)

Parameters

month
year

See Also

GuiCalendar Object


SelectRange Method

SelectRange Method
from
to

Syntax

Visual Basic
Public Sub SelectRange( _
   ByVal from As String, _
   ByVal to As String _
)

Parameters

from
to

See Also

GuiCalendar Object


SelectWeek Method

SelectWeek Method
week
year

Syntax

Visual Basic
Public Sub SelectWeek( _
   ByVal week As Long, _
   ByVal year As Long _
)

Parameters

week
year

See Also

GuiCalendar Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiCalendar Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiCalendar Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiCalendar Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiCalendar Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiCalendar Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiCalendar Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiCalendar Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiCalendar Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiCalendar Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiCalendar Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiCalendar Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiCalendar Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiCalendar Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiCalendar Object


endSelection Property

endSelection Property

Property type

Read-only property

Syntax

Visual Basic
Public Property endSelection() As String

See Also

GuiCalendar Object


FirstVisibleDate Property

FirstVisibleDate Property

Description

This is the earliest date visible in the calendar control. In the example above the value would be “20020228”.

Property type

Read-write property

Syntax

Visual Basic
Public Property FirstVisibleDate() As String

See Also

GuiCalendar Object


FocusDate Property

FocusDate Property

Description

The currently focussed date (identified by the focus border; see picture above) in the calendar control is available in the format “YYYYMMDD”. In this example it is “20020320”

Property type

Read-write property

Syntax

Visual Basic
Public Property FocusDate() As String

See Also

GuiCalendar Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiCalendar Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiCalendar Object


horizontal Property

horizontal Property

Property type

Read-only property

Syntax

Visual Basic
Public Property horizontal() As Long

See Also

GuiCalendar Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiCalendar Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiCalendar Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiCalendar Object


LastVisibleDate Property

LastVisibleDate Property

Property type

Read-only property

Syntax

Visual Basic
Public Property LastVisibleDate() As String

See Also

GuiCalendar Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiCalendar Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiCalendar Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiCalendar Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiCalendar Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiCalendar Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiCalendar Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiCalendar Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiCalendar Object


SelectionInterval Property

SelectionInterval Property

Description

The interval is represented by two concatenated date strings separated by a comma.

Property type

Read-write property

Syntax

Visual Basic
Public Property SelectionInterval() As String

Example

Depending on the order in which the user has selected the dates, the value of selectionInterval is either “20020318,20020322” or ““20020322,20020318”.

See Also

GuiCalendar Object


startSelection Property

startSelection Property

Property type

Read-only property

Syntax

Visual Basic
Public Property startSelection() As String

See Also

GuiCalendar Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Calendar”.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiCalendar Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiCalendar Object


Today Property

Today Property

Property type

Read-only property

Syntax

Visual Basic
Public Property Today() As String

See Also

GuiCalendar Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiCalendar Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiCalendar Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiCalendar Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiCalendar Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiCalendar Object


GuiChart Object

GuiChart Object
See Also Members

Description

The GuiChart object is of a very technical nature. It should only be used for recording and playback, as most of the parameters can not be determined in any other way.

Object Model

Example

See Also

GuiChart Members


GuiChart Object Members

GuiChart Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method ValueChange |
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Chart”.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiChart Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiChart Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiChart Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiChart Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiChart Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiChart Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiChart Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiChart Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiChart Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiChart Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiChart Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiChart Object


ValueChange Method

ValueChange Method
Series
Number of the data set within the row that should be changed.
Point
Number of the data point within the row that should be changed.
XValue
New x value.
YValue
New y value.
DataChange

Setting this parameter to True means the value was not changed interactively within the graphic but rather by entering the new value on the DataPoint property page.

Id
GFW data container id of the changed point. May be used instead of the pair series/point.
ZValue
New z value.
ChangeFlag

Notify which value was changed or if it was a time value. The value is set as a bit array, using the lower 5 bits.

1 | x
2 | y
4 | x is time value
8 | y is time value
16 | z

If the new value is a point in time, it should be set using a string of the format â€œmm/dd/yyyy hh:mm:ssâ€.

Syntax

Visual Basic
Public Sub ValueChange( _
   ByVal Series As Long, _
   ByVal Point As Long, _
   ByVal XValue As String, _
   ByVal YValue As String, _
   ByVal DataChange As Byte, _
   ByVal Id As String, _
   ByVal ZValue As String, _
   ByVal ChangeFlag As Long _
)

Parameters

Series
Number of the data set within the row that should be changed.
Point
Number of the data point within the row that should be changed.
XValue
New x value.
YValue
New y value.
DataChange

Setting this parameter to True means the value was not changed interactively within the graphic but rather by entering the new value on the DataPoint property page.

Id
GFW data container id of the changed point. May be used instead of the pair series/point.
ZValue
New z value.
ChangeFlag

Notify which value was changed or if it was a time value. The value is set as a bit array, using the lower 5 bits.

1 | x
2 | y
4 | x is time value
8 | y is time value
16 | z

If the new value is a point in time, it should be set using a string of the format â€œmm/dd/yyyy hh:mm:ssâ€.

See Also

GuiChart Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiChart Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiChart Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiChart Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiChart Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiChart Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiChart Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiChart Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiChart Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiChart Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiChart Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiChart Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiChart Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiChart Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiChart Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiChart Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiChart Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiChart Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiChart Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiChart Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiChart Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiChart Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiChart Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiChart Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiChart Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiChart Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Chart”.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiChart Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiChart Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiChart Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiChart Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiChart Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiChart Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiChart Object


GuiCheckBox Object

GuiCheckBox Object
See Also Members

Description

GuiCheckBox extends GuiVComponent. The type prefix is chk, the name is the fieldname taken from the SAP data dictionary.

Object Model

See Also

GuiCheckBox Members


GuiCheckBox Object Members

GuiCheckBox Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method GetListProperty | This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes.
Public Method GetListPropertyNonRec | This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes. In contrast to the method GetListProperty, GetListPropertyNonRec will only return information that is set for the specific element, and ignore list properties set for parent elements.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property ColorIndex | This number defines the index of the list color of this element.
Public Property ColorIntensified | This property is True if the Intensified flag is set in screen painter for this dynpro element.
Public Property ColorInverse | This property is True if the inverse color style is set in screen painter for the element.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Flushing | Some components such as radio buttons or check boxes may cause a round trip when their value is changed. If this is the case, the Flushing property is True.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsLeftLabel | This property is True if the component has the 'assign left' flag.
Public Property IsListElement | This property is True if the element is on an ABAP list, not a dynpro screen.
Public Property IsRightLabel | This property is True if the component has the 'assign right' flag.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property LeftLabel | Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property RightLabel | Right label of the component. This property is set in screenpainter using the 'assign right' flag.
Public Property RowText | This property is only available in ABAP list screens. It returns the text of the while line containing the current component.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Selected | Like radio buttons, checking a checkbox can cause server communication, depending on the ABAP screen painter definition.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiCheckBox Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiCheckBox Object


GetListProperty Method

GetListProperty Method
Property

Description

This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes.

Syntax

Visual Basic
Public Function GetListProperty( _
   ByVal Property As String _
) As String

Parameters

Property

See Also

GuiCheckBox Object


GetListPropertyNonRec Method

GetListPropertyNonRec Method
Property

Description

This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes. In contrast to the method GetListProperty, GetListPropertyNonRec will only return information that is set for the specific element, and ignore list properties set for parent elements.

Syntax

Visual Basic
Public Function GetListPropertyNonRec( _
   ByVal Property As String _
) As String

Parameters

Property

See Also

GuiCheckBox Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiCheckBox Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiCheckBox Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiCheckBox Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiCheckBox Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiCheckBox Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiCheckBox Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiCheckBox Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiCheckBox Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiCheckBox Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiCheckBox Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiCheckBox Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiCheckBox Object


ColorIndex Property

ColorIndex Property

Description

This number defines the index of the list color of this element.

Property type

Read-only property

Syntax

Visual Basic
Public Property ColorIndex() As Long

See Also

GuiCheckBox Object


ColorIntensified Property

ColorIntensified Property

Description

This property is True if the Intensified flag is set in screen painter for this dynpro element.

Property type

Read-only property

Syntax

Visual Basic
Public Property ColorIntensified() As Byte

See Also

GuiCheckBox Object


ColorInverse Property

ColorInverse Property

Description

This property is True if the inverse color style is set in screen painter for the element.

Property type

Read-only property

Syntax

Visual Basic
Public Property ColorInverse() As Byte

See Also

GuiCheckBox Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiCheckBox Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiCheckBox Object


Flushing Property

Flushing Property

Description

Some components such as radio buttons or check boxes may cause a round trip when their value is changed. If this is the case, the Flushing property is True.

Property type

Read-only property

Syntax

Visual Basic
Public Property Flushing() As Byte

See Also

GuiCheckBox Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiCheckBox Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiCheckBox Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiCheckBox Object


IsLeftLabel Property

IsLeftLabel Property

Description

This property is True if the component has the 'assign left' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsLeftLabel() As Byte

See Also

GuiCheckBox Object


IsListElement Property

IsListElement Property

Description

This property is True if the element is on an ABAP list, not a dynpro screen.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsListElement() As Byte

See Also

GuiCheckBox Object


IsRightLabel Property

IsRightLabel Property

Description

This property is True if the component has the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsRightLabel() As Byte

See Also

GuiCheckBox Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiCheckBox Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiCheckBox Object


LeftLabel Property

LeftLabel Property

Description

Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.

Property type

Read-only property

Syntax

Visual Basic
Public Property LeftLabel() As GuiVComponent

See Also

GuiCheckBox Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiCheckBox Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiCheckBox Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiCheckBox Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiCheckBox Object


RightLabel Property

RightLabel Property

Description

Right label of the component. This property is set in screenpainter using the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property RightLabel() As GuiVComponent

See Also

GuiCheckBox Object


RowText Property

RowText Property

Description

This property is only available in ABAP list screens. It returns the text of the while line containing the current component.

Property type

Read-only property

Syntax

Visual Basic
Public Property RowText() As String

See Also

GuiCheckBox Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiCheckBox Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiCheckBox Object


Selected Property

Selected Property

Description

Like radio buttons, checking a checkbox can cause server communication, depending on the ABAP screen painter definition.

Property type

Read-write property

Syntax

Visual Basic
Public Property Selected() As Byte

See Also

GuiCheckBox Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiCheckBox Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiCheckBox Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiCheckBox Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiCheckBox Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiCheckBox Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiCheckBox Object


GuiCollection Collection

GuiCollection Collection
See Also Members

Description

GuiCollection is similar to GuiComponentCollection, but its members are not necessarily extensions of GuiComponent. It can be used to pass a collection as a parameter to functions of scriptable objects. An object of this class is created by calling the CreateGuiCollection function of the GuiApplication.

See Also

GuiCollection Members


GuiCollection Collection Members

GuiCollection Collection Members
See Also Overview

Public Methods

Public Method Add | After a GuiCollection has been created, items can be added by calling the add function.
Public Method ElementAt | This function returns the member in the collection at position index, where index may range from 0 to count-1. If no member can be found for the given index, an exception is raised.
Public Method Item | This function returns the member in the collection at position index, where index may range from 0 to count-1. It has been added for compatibility with Microsoft Visual Basic collections. If no member can be found for the given index, an exception is raised.

Public Properties

Public Property Count | The number of elements in the collection. This property has been added for compatibility with Microsoft Visual Basic collections.
Public Property Length | The number of elements in the collection.
Public Property NewEnum | It has been added for compatibility with Microsoft Visual Basic collections.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation. The value is ‘GuiCollection’.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration. The value is 120.

See Also

GuiCollection Overview


Add Method

Add Method
Item

Description

After a GuiCollection has been created, items can be added by calling the add function.

Syntax

Visual Basic
Public Sub Add( _
   ByVal Item As Variant _
)

Parameters

Item

See Also

GuiCollection Collection


ElementAt Method

ElementAt Method
Index

Description

This function returns the member in the collection at position index, where index may range from 0 to count-1. If no member can be found for the given index, an exception is raised.

Syntax

Visual Basic
Public Function ElementAt( _
   ByVal Index As Long _
) As Variant

Parameters

Index

See Also

GuiCollection Collection


Item Method

Item Method
Index

Description

This function returns the member in the collection at position index, where index may range from 0 to count-1. It has been added for compatibility with Microsoft Visual Basic collections. If no member can be found for the given index, an exception is raised.

Syntax

Visual Basic
Public Function Item( _
   ByVal Index As Variant _
) As Variant

Parameters

Index

See Also

GuiCollection Collection


Count Property

Count Property

Description

The number of elements in the collection. This property has been added for compatibility with Microsoft Visual Basic collections.

Property type

Read-only property

Syntax

Visual Basic
Public Property Count() As Long

See Also

GuiCollection Collection


Length Property

Length Property

Description

The number of elements in the collection.

Property type

Read-only property

Syntax

Visual Basic
Public Property Length() As Long

See Also

GuiCollection Collection


NewEnum Property

NewEnum Property

Description

It has been added for compatibility with Microsoft Visual Basic collections.

Property type

Read-only property

Syntax

Visual Basic
Public Property NewEnum() As Unknown

See Also

GuiCollection Collection


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation. The value is ‘GuiCollection’.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiCollection Collection


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration. The value is 120.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiCollection Collection


GuiColorSelector Object

GuiColorSelector Object
See Also Members

Description

GuiColorSelector displays a set of colors for selection. It extends GuiShell.

Object Model

Example

See Also

GuiColorSelector Members


GuiColorSelector Object Members

GuiColorSelector Object Members
See Also Overview

Public Methods

Public Method ChangeSelection | This function emulates the user’s selection of the color at the given index position.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “ColorSelector”
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiColorSelector Overview


ChangeSelection Method

ChangeSelection Method
i

Description

This function emulates the user’s selection of the color at the given index position.

Syntax

Visual Basic
Public Sub ChangeSelection( _
   ByVal i As Integer _
)

Parameters

i

See Also

GuiColorSelector Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiColorSelector Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiColorSelector Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiColorSelector Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiColorSelector Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiColorSelector Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiColorSelector Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiColorSelector Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiColorSelector Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiColorSelector Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiColorSelector Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiColorSelector Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiColorSelector Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiColorSelector Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiColorSelector Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiColorSelector Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiColorSelector Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiColorSelector Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiColorSelector Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiColorSelector Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiColorSelector Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiColorSelector Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiColorSelector Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiColorSelector Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiColorSelector Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiColorSelector Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiColorSelector Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiColorSelector Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiColorSelector Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiColorSelector Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiColorSelector Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiColorSelector Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiColorSelector Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiColorSelector Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiColorSelector Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiColorSelector Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiColorSelector Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “ColorSelector”

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiColorSelector Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiColorSelector Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiColorSelector Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiColorSelector Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiColorSelector Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiColorSelector Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiColorSelector Object


GuiComboBox Object

GuiComboBox Object
See Also Members

Description

The GuiComboBox looks somewhat similar to GuiCTextField, but has a completely different implementation. While pressing the combo box button of a GuiCTextField will open a new dynpro or control in which a selection can be made, GuiComboBox retrieves all possible choices on initialization from the server, so the selection is done solely on the client. GuiComboBox extends GuiVComponent. The type prefix is cmb, the name is the fieldname taken from the SAP data dictionary.

Object Model

Remarks

A combo box can be configured to send a function code to the server when the selection changes, which will invalidate references to all visible elements below the window level.

See Also

GuiComboBox Members


GuiComboBox Object Members

GuiComboBox Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method SetKeySpace | This function sets the key property of the combo box to the space character. It was introduced for eCATT.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurListBoxEntry | The currently focussed entry of the dropdown list.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Entries | All members of this collection are of GuiComboBoxEntry type and have just two properties, key and value, both of type String. The key data can be displayed in SAP GUI by setting the ‘Show keys…’ check box on the option dialog’s expert page.
Public Property Flushing | Some components such as radio buttons or check boxes may cause a round trip when their value is changed. If this is the case, the Flushing property is True.
Public Property Height | Height of the component in pixels.
Public Property Highlighted | This property is True if the Highlighted flag is set in the screen painter for the dynpro element.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsLeftLabel | This property is True if the component has the 'assign left' flag.
Public Property IsListBoxActive | This property is True if the list box of the the combo box is currently open.
Public Property IsRightLabel | This property is True if the component has the 'assign right' flag.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Key | This is the key of the currently selected item. You can change this item by setting the key property to a new value.
Public Property Left | Left position of the element in screen coordinates
Public Property LeftLabel | Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'. This label has been defined in ABAP Screen Painter to be the left label of the control.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property Required | This property is True if the component is a required value for the screen. If the required flag is set for a combo box then the empty entry is not selectable from the list.
Public Property RightLabel | Right label of the component. This property is set in screenpainter using the 'assign right' flag. This label has been defined in ABAP Screen Painter to be the right label of the control.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Value | This is the value of the currently selected item. You can change this item by setting the value property to a new value.
Public Property Width | Width of the component in pixels.

See Also

GuiComboBox Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiComboBox Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiComboBox Object


SetKeySpace Method

SetKeySpace Method

Description

This function sets the key property of the combo box to the space character. It was introduced for eCATT.

Syntax

Visual Basic
Public Sub SetKeySpace()

See Also

GuiComboBox Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiComboBox Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiComboBox Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiComboBox Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiComboBox Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiComboBox Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiComboBox Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiComboBox Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiComboBox Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiComboBox Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiComboBox Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiComboBox Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiComboBox Object


CurListBoxEntry Property

CurListBoxEntry Property

Description

The currently focussed entry of the dropdown list.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurListBoxEntry() As GuiComboBoxEntry

See Also

GuiComboBox Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiComboBox Object


Entries Property

Entries Property

Description

All members of this collection are of GuiComboBoxEntry type and have just two properties, key and value, both of type String. The key data can be displayed in SAP GUI by setting the ‘Show keys…’ check box on the option dialog’s expert page.

Property type

Read-only property

Syntax

Visual Basic
Public Property Entries() As GuiCollection

Example

In this example the first column contains the key property and the second column contains the value property.

See Also

GuiComboBox Object


Flushing Property

Flushing Property

Description

Some components such as radio buttons or check boxes may cause a round trip when their value is changed. If this is the case, the Flushing property is True.

Property type

Read-only property

Syntax

Visual Basic
Public Property Flushing() As Byte

See Also

GuiComboBox Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiComboBox Object


Highlighted Property

Highlighted Property

Description

This property is True if the Highlighted flag is set in the screen painter for the dynpro element.

Property type

Read-only property

Syntax

Visual Basic
Public Property Highlighted() As Byte

See Also

GuiComboBox Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiComboBox Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiComboBox Object


IsLeftLabel Property

IsLeftLabel Property

Description

This property is True if the component has the 'assign left' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsLeftLabel() As Byte

See Also

GuiComboBox Object


IsListBoxActive Property

IsListBoxActive Property

Description

This property is True if the list box of the the combo box is currently open.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsListBoxActive() As Byte

See Also

GuiComboBox Object


IsRightLabel Property

IsRightLabel Property

Description

This property is True if the component has the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsRightLabel() As Byte

See Also

GuiComboBox Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiComboBox Object


Key Property

Key Property

Description

This is the key of the currently selected item. You can change this item by setting the key property to a new value.

Property type

Read-write property

Syntax

Visual Basic
Public Property Key() As String

See Also

GuiComboBox Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiComboBox Object


LeftLabel Property

LeftLabel Property

Description

Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'. This label has been defined in ABAP Screen Painter to be the left label of the control.

Property type

Read-only property

Syntax

Visual Basic
Public Property LeftLabel() As GuiVComponent

See Also

GuiComboBox Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiComboBox Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiComboBox Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiComboBox Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiComboBox Object


Required Property

Required Property

Description

This property is True if the component is a required value for the screen. If the required flag is set for a combo box then the empty entry is not selectable from the list.

Property type

Read-only property

Syntax

Visual Basic
Public Property Required() As Byte

See Also

GuiComboBox Object


RightLabel Property

RightLabel Property

Description

Right label of the component. This property is set in screenpainter using the 'assign right' flag. This label has been defined in ABAP Screen Painter to be the right label of the control.

Property type

Read-only property

Syntax

Visual Basic
Public Property RightLabel() As GuiVComponent

See Also

GuiComboBox Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiComboBox Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiComboBox Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiComboBox Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiComboBox Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiComboBox Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiComboBox Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiComboBox Object


Value Property

Value Property

Description

This is the value of the currently selected item. You can change this item by setting the value property to a new value.

Property type

Read-write property

Syntax

Visual Basic
Public Property Value() As String

See Also

GuiComboBox Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiComboBox Object


GuiComboBoxEntry Object

GuiComboBoxEntry Object
See Also Members

Description

Members of the Entries collection of a GuiComboBox are of type GuiComBoxEntry

See Also

GuiComboBoxEntry Members


GuiComboBoxEntry Object Members

GuiComboBoxEntry Object Members
See Also Overview

Public Properties

Public Property Key | Key value of the combo box entry.
Public Property Pos | Position of the combo box entry.
Public Property Value | Value of the combo box entry.

See Also

GuiComboBoxEntry Overview


Key Property

Key Property

Description

Key value of the combo box entry.

Property type

Read-only property

Syntax

Visual Basic
Public Property Key() As String

See Also

GuiComboBoxEntry Object


Pos Property

Pos Property

Description

Position of the combo box entry.

Property type

Read-only property

Syntax

Visual Basic
Public Property Pos() As Long

See Also

GuiComboBoxEntry Object


Value Property

Value Property

Description

Value of the combo box entry.

Property type

Read-only property

Syntax

Visual Basic
Public Property Value() As String

See Also

GuiComboBoxEntry Object


GuiComponent Object

GuiComponent Object
See Also Members

Description

GuiComponent is the base class for most classes in the Scripting API. It was designed to allow generic programming, meaning you can work with objects without knowing their exact type.

Remarks

GuiComponent is an abstract class.

See Also

GuiComponent Members


GuiComponent Object Members

GuiComponent Object Members
See Also Overview

Public Properties

Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

See Also

GuiComponent Overview


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiComponent Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiComponent Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiComponent Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As Object

See Also

GuiComponent Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiComponent Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiComponent Object


GuiComponentCollection Collection

GuiComponentCollection Collection
See Also Members

Description

The GuiComponentCollection is used for collections elements such as the children property of containers. Each element of the collection is an extension of GuiComponent.

Object Model

See Also

GuiComponentCollection Members


GuiComponentCollection Collection Members

GuiComponentCollection Collection Members
See Also Overview

Public Methods

Public Method ElementAt | This function returns the member in the collection at position index, where index may range from 0 to count-1. If no member can be found for the given index, the exception Gui_Err_Enumerator_Index (614) is raised.
Public Method Item | This function returns the member in the collection at position index, where index may range from 0 to count-1. It has been added for compatibility with Microsoft Visual Basic collections. If no member can be found for the given index the exception Gui_Err_Enumerator_Index (614) is raised.

Public Properties

Public Property Count | The number of elements in the collection. This property is used implicitly from Visual Basic applications.
Public Property Length | The number of elements in the collection.
Public Property NewEnum | This property is used implicitly from Visual Basic applications.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation. The value is ‘GuiCollection’.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration. The value is 120.

See Also

GuiComponentCollection Overview


ElementAt Method

ElementAt Method
Index

Description

This function returns the member in the collection at position index, where index may range from 0 to count-1. If no member can be found for the given index, the exception Gui_Err_Enumerator_Index (614) is raised.

Syntax

Visual Basic
Public Function ElementAt( _
   ByVal Index As Long _
) As GuiComponent

Parameters

Index

See Also

GuiComponentCollection Collection


Item Method

Item Method
Index

Description

This function returns the member in the collection at position index, where index may range from 0 to count-1. It has been added for compatibility with Microsoft Visual Basic collections. If no member can be found for the given index the exception Gui_Err_Enumerator_Index (614) is raised.

Syntax

Visual Basic
Public Function Item( _
   ByVal Index As Variant _
) As GuiComponent

Parameters

Index

See Also

GuiComponentCollection Collection


Count Property

Count Property

Description

The number of elements in the collection. This property is used implicitly from Visual Basic applications.

Property type

Read-only property

Syntax

Visual Basic
Public Property Count() As Long

See Also

GuiComponentCollection Collection


Length Property

Length Property

Description

The number of elements in the collection.

Property type

Read-only property

Syntax

Visual Basic
Public Property Length() As Long

See Also

GuiComponentCollection Collection


NewEnum Property

NewEnum Property

Description

This property is used implicitly from Visual Basic applications.

Property type

Read-only property

Syntax

Visual Basic
Public Property NewEnum() As Unknown

See Also

GuiComponentCollection Collection


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation. The value is ‘GuiCollection’.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiComponentCollection Collection


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration. The value is 120.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiComponentCollection Collection


GuiConnection Object

GuiConnection Object
See Also Members

Description

A GuiConnection represents the connection between SAP GUI and an application server. Connections can be opened from SAPlogon or from GuiApplication’s openConnection and openConnectionByConnectionString methods. GuiConnection extends GuiContainer. The type prefix for GuiConnection is con, the name is con plus the connection number in square brackets.

Object Model

Remarks

It is possible to connect to an application server from ABAP using the following command:
CALL FUNCTION func DESTINATION dest.
However, this connection is implemented as a re-direction between the two application servers involved. There will therefore be no new GuiConnection object available and the existing object will not reflect the server switch.

See Also

GuiConnection Members


GuiConnection Object Members

GuiConnection Object Members
See Also Overview

Public Methods

Public Method CloseSession | A session can be closed by calling this method of the connection. Closing the last session of a connection will close the connection, too.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Public Properties

Public Property Children | This collection contains all direct children of the object.
Public Property ConnectionString | This property contains the connection string defining the backend connection. It is more difficult to read, but it doesn’t rely on the SAPLogon entries.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property Description | This description is only available if the connection was started either from SAPlogon or using GuiApplication.OpenConnection. In both cases the description can then be used when calling the OpenConnection method to play back a script on the same system.
Public Property DisabledByServer | This property is set to True if the scripting support has not been enabled for the application server .
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property Sessions | This property is another name for the children property. It was added for better readability as all the children of GuiConnection are sessions. Accessing either the children property or the sessions property can cause the exception Gui_Err_Scripting_Disabled_Srv (624) to be raised if the respective application server has not enabled the scripting support.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

See Also

GuiConnection Overview


CloseSession Method

CloseSession Method
Id

Description

A session can be closed by calling this method of the connection. Closing the last session of a connection will close the connection, too.

Syntax

Visual Basic
Public Sub CloseSession( _
   ByVal Id As String _
)

Parameters

Id

See Also

GuiConnection Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiConnection Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiConnection Object


ConnectionString Property

ConnectionString Property

Description

This property contains the connection string defining the backend connection. It is more difficult to read, but it doesn’t rely on the SAPLogon entries.

Property type

Read-only property

Syntax

Visual Basic
Public Property ConnectionString() As String

See Also

GuiConnection Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiConnection Object


Description Property

Description Property

Description

This description is only available if the connection was started either from SAPlogon or using GuiApplication.OpenConnection. In both cases the description can then be used when calling the OpenConnection method to play back a script on the same system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Description() As String

See Also

GuiConnection Object


DisabledByServer Property

DisabledByServer Property

Description

This property is set to True if the scripting support has not been enabled for the application server .

Property type

Read-only property

Syntax

Visual Basic
Public Property DisabledByServer() As Byte

See Also

GuiConnection Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiConnection Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiConnection Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiConnection Object


Sessions Property

Sessions Property

Description

This property is another name for the children property. It was added for better readability as all the children of GuiConnection are sessions. Accessing either the children property or the sessions property can cause the exception Gui_Err_Scripting_Disabled_Srv (624) to be raised if the respective application server has not enabled the scripting support.

Property type

Read-only property

Syntax

Visual Basic
Public Property Sessions() As GuiComponentCollection

See Also

GuiConnection Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiConnection Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiConnection Object


GuiContainer Object

GuiContainer Object
See Also Members

Description

This interface resembles GuiVContainer. The only difference is that it is not intended for visual objects but rather administrative objects such as connections or sessions. Objects exposing this interface will therefore support GuiComponent but not GuiVComponent. GuiContainer extends GuiComponent.

Object Model

See Also

GuiContainer Members


GuiContainer Object Members

GuiContainer Object Members
See Also Overview

Public Methods

Public Method FindById Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Public Properties

Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

See Also

GuiContainer Overview


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiContainer Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiContainer Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiContainer Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiContainer Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiContainer Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiContainer Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiContainer Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiContainer Object


GuiContainerShell Object

GuiContainerShell Object
See Also Members

Description

A GuiContainerShell is a wrapper for a set of GuiShell objects. GuiContainerShell extends GuiVContainer. The type prefix is shellcont, the name is the last part of the id, shellcont[n].

Object Model

See Also

GuiContainerShell Members


GuiContainerShell Object Members

GuiContainerShell Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DockerIsVertical | Is TRUE if the container is a vertical docker control.
Public Property DockerPixelSize | Returns the size of the docker control in pixels.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiContainerShell Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiContainerShell Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiContainerShell Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiContainerShell Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiContainerShell Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiContainerShell Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiContainerShell Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiContainerShell Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiContainerShell Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiContainerShell Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiContainerShell Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiContainerShell Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiContainerShell Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiContainerShell Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiContainerShell Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiContainerShell Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiContainerShell Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiContainerShell Object


DockerIsVertical Property

DockerIsVertical Property

Description

Is TRUE if the container is a vertical docker control.

Property type

Read-only property

Syntax

Visual Basic
Public Property DockerIsVertical() As Byte

See Also

GuiContainerShell Object


DockerPixelSize Property

DockerPixelSize Property

Description

Returns the size of the docker control in pixels.

Property type

Read-write property

Syntax

Visual Basic
Public Property DockerPixelSize() As Long

See Also

GuiContainerShell Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiContainerShell Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiContainerShell Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiContainerShell Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiContainerShell Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiContainerShell Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiContainerShell Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiContainerShell Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiContainerShell Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiContainerShell Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiContainerShell Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiContainerShell Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiContainerShell Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiContainerShell Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiContainerShell Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiContainerShell Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiContainerShell Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiContainerShell Object


GuiContextMenu Object

GuiContextMenu Object
See Also Members

Description

A GuiContextMenu may have other GuiContextMenu objects as children. GuiContextMenu extends GuiMenu. The type is mnu, the name is the function code that is sent to the system when the menu item is selected.

Object Model

See Also

GuiContextMenu Members


GuiContextMenu Object Members

GuiContextMenu Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method Select | Select the context menu item.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiContextMenu Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiContextMenu Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiContextMenu Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiContextMenu Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiContextMenu Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiContextMenu Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiContextMenu Object


Select Method

Select Method

Description

Select the context menu item.

Syntax

Visual Basic
Public Sub Select()

See Also

GuiContextMenu Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiContextMenu Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiContextMenu Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiContextMenu Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiContextMenu Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiContextMenu Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiContextMenu Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiContextMenu Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiContextMenu Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiContextMenu Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiContextMenu Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiContextMenu Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiContextMenu Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiContextMenu Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiContextMenu Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiContextMenu Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiContextMenu Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiContextMenu Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiContextMenu Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiContextMenu Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiContextMenu Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiContextMenu Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiContextMenu Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiContextMenu Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiContextMenu Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiContextMenu Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiContextMenu Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiContextMenu Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiContextMenu Object


GuiCTextField Object

GuiCTextField Object
See Also Members

Description

If the cursor is set into a text field of type GuiCTextField a combo box button is displayed to the right of the text field. Pressing this button is equivalent to pressing the F4 key. The button is not represented in the scripting object model as a separate object; it is considered to be part of the text field.
There are no other differences between GuiTextField and GuiCTextField. GuiCTextField extends GuiTextField. The type prefix is ctxt, the name is the Fieldname taken from the SAP data dictionary.

Object Model

Example

This is an example of GuiCTextField type text field, where the upper field has the focus. Please note that the button is only displayed when the corresponding input field has the focus.

See Also

GuiCTextField Members


GuiCTextField Object Members

GuiCTextField Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property CaretPosition | Position of the text caret in the input field.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DisplayedText | This property contains the text as it is displayed on the screen, including preceding or trailing blanks. These blanks are stripped from the text property.
Public Property Height | Height of the component in pixels.
Public Property Highlighted | This property is True if the Highlighted flag is set in the screen painter for the dynpro element.
Public Property HistoryCurEntry | Text of the currently focussed entry in the history list box.
Public Property HistoryCurIndex | Currently focussed index in the history dropdown list box.
Public Property HistoryIsActive | This property is True if the local input field history drop down is currently open.
Public Property HistoryList | List of entries in the local history list box.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsHotspot | Dynpro elements such as labels may be configured to cause a round trip when they are clicked. In that case the mouse cursor changes to the hand shape. This is called a hot spot.
Public Property IsLeftLabel | This property is True if the component has the 'assign left' flag.
Public Property IsOField | OField is a special ABAP dynpro element, the Output Field. These fields can be set programmatically to a value at runtime. In this respect they differ from labels. However they can not be used to enter data, so they are not input fields.
Public Property IsRightLabel | This property is True if the component has the 'assign right' flag.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property LeftLabel | Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.
Public Property MaxLength | Maximum length of the input field in number of characters.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Numerical | This property is True if the component is an input field that only accepts numeric characters.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property Required | This property is True if the component is a required value for the screen.
Public Property RightLabel | Right label of the component. This property is set in screenpainter using the 'assign right' flag.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiCTextField Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiCTextField Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiCTextField Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiCTextField Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiCTextField Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiCTextField Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiCTextField Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiCTextField Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiCTextField Object


CaretPosition Property

CaretPosition Property

Description

Position of the text caret in the input field.

Property type

Read-write property

Syntax

Visual Basic
Public Property CaretPosition() As Long

See Also

GuiCTextField Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiCTextField Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiCTextField Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiCTextField Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiCTextField Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiCTextField Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiCTextField Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiCTextField Object


DisplayedText Property

DisplayedText Property

Description

This property contains the text as it is displayed on the screen, including preceding or trailing blanks. These blanks are stripped from the text property.

Property type

Read-only property

Syntax

Visual Basic
Public Property DisplayedText() As String

See Also

GuiCTextField Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiCTextField Object


Highlighted Property

Highlighted Property

Description

This property is True if the Highlighted flag is set in the screen painter for the dynpro element.

Property type

Read-only property

Syntax

Visual Basic
Public Property Highlighted() As Byte

See Also

GuiCTextField Object


HistoryCurEntry Property

HistoryCurEntry Property

Description

Text of the currently focussed entry in the history list box.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryCurEntry() As String

See Also

GuiCTextField Object


HistoryCurIndex Property

HistoryCurIndex Property

Description

Currently focussed index in the history dropdown list box.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryCurIndex() As Long

See Also

GuiCTextField Object


HistoryIsActive Property

HistoryIsActive Property

Description

This property is True if the local input field history drop down is currently open.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryIsActive() As Byte

See Also

GuiCTextField Object


HistoryList Property

HistoryList Property

Description

List of entries in the local history list box.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryList() As GuiCollection

See Also

GuiCTextField Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiCTextField Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiCTextField Object


IsHotspot Property

IsHotspot Property

Description

Dynpro elements such as labels may be configured to cause a round trip when they are clicked. In that case the mouse cursor changes to the hand shape. This is called a hot spot.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsHotspot() As Byte

See Also

GuiCTextField Object


IsLeftLabel Property

IsLeftLabel Property

Description

This property is True if the component has the 'assign left' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsLeftLabel() As Byte

See Also

GuiCTextField Object


IsOField Property

IsOField Property

Description

OField is a special ABAP dynpro element, the Output Field. These fields can be set programmatically to a value at runtime. In this respect they differ from labels. However they can not be used to enter data, so they are not input fields.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsOField() As Byte

See Also

GuiCTextField Object


IsRightLabel Property

IsRightLabel Property

Description

This property is True if the component has the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsRightLabel() As Byte

See Also

GuiCTextField Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiCTextField Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiCTextField Object


LeftLabel Property

LeftLabel Property

Description

Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.

Property type

Read-only property

Syntax

Visual Basic
Public Property LeftLabel() As GuiVComponent

See Also

GuiCTextField Object


MaxLength Property

MaxLength Property

Description

Maximum length of the input field in number of characters.

Property type

Read-only property

Syntax

Visual Basic
Public Property MaxLength() As Long

See Also

GuiCTextField Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiCTextField Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiCTextField Object


Numerical Property

Numerical Property

Description

This property is True if the component is an input field that only accepts numeric characters.

Property type

Read-only property

Syntax

Visual Basic
Public Property Numerical() As Byte

See Also

GuiCTextField Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiCTextField Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiCTextField Object


Required Property

Required Property

Description

This property is True if the component is a required value for the screen.

Property type

Read-only property

Syntax

Visual Basic
Public Property Required() As Byte

See Also

GuiCTextField Object


RightLabel Property

RightLabel Property

Description

Right label of the component. This property is set in screenpainter using the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property RightLabel() As GuiVComponent

See Also

GuiCTextField Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiCTextField Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiCTextField Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiCTextField Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiCTextField Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiCTextField Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiCTextField Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiCTextField Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiCTextField Object


GuiCustomControl Object

GuiCustomControl Object
See Also Members

Description

The GuiCustomControl is a wrapper object that is used to place ActiveX controls onto dynpro screens. While GuiCustomControl is a dynpro element itself, its children are of GuiContainerShell type, which is a container for controls. GuiCustomControl extends GuiVContainer. The type prefix is cntl, the name is the fieldname taken from the SAP data dictionary.

Object Model

See Also

GuiCustomControl Members


GuiCustomControl Object Members

GuiCustomControl Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiCustomControl Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiCustomControl Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiCustomControl Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiCustomControl Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiCustomControl Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiCustomControl Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiCustomControl Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiCustomControl Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiCustomControl Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiCustomControl Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiCustomControl Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiCustomControl Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiCustomControl Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiCustomControl Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiCustomControl Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiCustomControl Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiCustomControl Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiCustomControl Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiCustomControl Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiCustomControl Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiCustomControl Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiCustomControl Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiCustomControl Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiCustomControl Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiCustomControl Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiCustomControl Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiCustomControl Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiCustomControl Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiCustomControl Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiCustomControl Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiCustomControl Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiCustomControl Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiCustomControl Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiCustomControl Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiCustomControl Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiCustomControl Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiCustomControl Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiCustomControl Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiCustomControl Object


GuiDialogShell Object

GuiDialogShell Object
See Also Members

Description

The GuiDialogShell is an external window that is used as a container for other shells, for example a toolbar. GuiDialogShell extends GuiVContainer. The type prefix is shellcont, the name is the last part of the id, shellcont[n].

Object Model

Example

See Also

GuiDialogShell Members


GuiDialogShell Object Members

GuiDialogShell Object Members
See Also Overview

Public Methods

Public Method Close | This method closes the external window.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Title | Title of the dialog.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiDialogShell Overview


Close Method

Close Method

Description

This method closes the external window.

Syntax

Visual Basic
Public Sub Close()

See Also

GuiDialogShell Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiDialogShell Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiDialogShell Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiDialogShell Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiDialogShell Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiDialogShell Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiDialogShell Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiDialogShell Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiDialogShell Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiDialogShell Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiDialogShell Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiDialogShell Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiDialogShell Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiDialogShell Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiDialogShell Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiDialogShell Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiDialogShell Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiDialogShell Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiDialogShell Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiDialogShell Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiDialogShell Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiDialogShell Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiDialogShell Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiDialogShell Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiDialogShell Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiDialogShell Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiDialogShell Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiDialogShell Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiDialogShell Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiDialogShell Object


Title Property

Title Property

Description

Title of the dialog.

Property type

Read-only property

Syntax

Visual Basic
Public Property Title() As String

See Also

GuiDialogShell Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiDialogShell Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiDialogShell Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiDialogShell Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiDialogShell Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiDialogShell Object


GuiEAIViewer2D Object

GuiEAIViewer2D Object
See Also Members

Description

The GuiEAIViewer2D control is used to view 2-dimensional graphic images in the SAP system. Presently Webviewer2D supports 22 available image types. The user can carry out redlining over the loaded image. The scripting wrapper for this control records all user actions during the redlining process and reproduces the same actions when the recorded script is replayed.

GuiEAIViewer2D extends GuiShell.

Object Model

Example

See Also

GuiEAIViewer2D Members


GuiEAIViewer2D Object Members

GuiEAIViewer2D Object Members
See Also Overview

Public Methods

Public Method annotationTextRequest |
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property AnnotationEnabled | The value of this property is set to 1 when redlining is started. The wrapper control starts recording user actions as soon as this property is set to value 1.
Public Property AnnotationMode | During redlining, the selected redlining mode is stored in this property.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property RedliningStream | This property stores the redlining layer as BLOB (Binary large data object). During recording, the whole BLOB is copied into the generated script.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value EAI2D.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiEAIViewer2D Overview


annotationTextRequest Method

annotationTextRequest Method
strText

Syntax

Visual Basic
Public Sub annotationTextRequest( _
   ByVal strText As String _
)

Parameters

strText

See Also

GuiEAIViewer2D Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiEAIViewer2D Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiEAIViewer2D Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiEAIViewer2D Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiEAIViewer2D Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiEAIViewer2D Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiEAIViewer2D Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiEAIViewer2D Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiEAIViewer2D Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiEAIViewer2D Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiEAIViewer2D Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiEAIViewer2D Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiEAIViewer2D Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiEAIViewer2D Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiEAIViewer2D Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiEAIViewer2D Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiEAIViewer2D Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiEAIViewer2D Object


AnnotationEnabled Property

AnnotationEnabled Property

Description

The value of this property is set to 1 when redlining is started. The wrapper control starts recording user actions as soon as this property is set to value 1.

Property type

Read-write property

Syntax

Visual Basic
Public Property AnnotationEnabled() As Long

Example

The following screen shot shows how to start redlining:

See Also

GuiEAIViewer2D Object


AnnotationMode Property

AnnotationMode Property

Description

During redlining, the selected redlining mode is stored in this property.

Property type

Read-write property

Syntax

Visual Basic
Public Property AnnotationMode() As Integer

See Also

GuiEAIViewer2D Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiEAIViewer2D Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiEAIViewer2D Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiEAIViewer2D Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiEAIViewer2D Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiEAIViewer2D Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiEAIViewer2D Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiEAIViewer2D Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiEAIViewer2D Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiEAIViewer2D Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiEAIViewer2D Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiEAIViewer2D Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiEAIViewer2D Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiEAIViewer2D Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiEAIViewer2D Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiEAIViewer2D Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiEAIViewer2D Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiEAIViewer2D Object


RedliningStream Property

RedliningStream Property

Description

This property stores the redlining layer as BLOB (Binary large data object). During recording, the whole BLOB is copied into the generated script.

Property type

Read-write property

Syntax

Visual Basic
Public Property RedliningStream() As String

See Also

GuiEAIViewer2D Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiEAIViewer2D Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiEAIViewer2D Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value EAI2D.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiEAIViewer2D Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiEAIViewer2D Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiEAIViewer2D Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiEAIViewer2D Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiEAIViewer2D Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiEAIViewer2D Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiEAIViewer2D Object


GuiEAIViewer3D Object

GuiEAIViewer3D Object
See Also Members

Object Model

See Also

GuiEAIViewer3D Members


GuiEAIViewer3D Object Members

GuiEAIViewer3D Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiEAIViewer3D Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiEAIViewer3D Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiEAIViewer3D Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiEAIViewer3D Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiEAIViewer3D Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiEAIViewer3D Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiEAIViewer3D Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiEAIViewer3D Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiEAIViewer3D Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiEAIViewer3D Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiEAIViewer3D Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiEAIViewer3D Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiEAIViewer3D Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiEAIViewer3D Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiEAIViewer3D Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiEAIViewer3D Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiEAIViewer3D Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiEAIViewer3D Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiEAIViewer3D Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiEAIViewer3D Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiEAIViewer3D Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiEAIViewer3D Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiEAIViewer3D Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiEAIViewer3D Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiEAIViewer3D Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiEAIViewer3D Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiEAIViewer3D Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiEAIViewer3D Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiEAIViewer3D Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiEAIViewer3D Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiEAIViewer3D Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiEAIViewer3D Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiEAIViewer3D Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiEAIViewer3D Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiEAIViewer3D Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiEAIViewer3D Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiEAIViewer3D Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiEAIViewer3D Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiEAIViewer3D Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiEAIViewer3D Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiEAIViewer3D Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiEAIViewer3D Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiEAIViewer3D Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiEAIViewer3D Object


GuiFrameWindow Object

GuiFrameWindow Object
See Also Members

Description

A GuiFrameWindow is a high level visual object in the runtime hierarchy. It can be either the main window or a modal popup window. See the GuiMainWindow and GuiModalWindow sections for examples. GuiFrameWindow itself is an abstract interface. GuiFrameWindow extends GuiVContainer. The type prefix is wnd, the name is wnd plus the window number in square brackets.

Object Model

See Also

GuiFrameWindow Members


GuiFrameWindow Object Members

GuiFrameWindow Object Members
See Also Overview

Public Methods

Public Method Close | The function attempts to close the window. Trying to close the last main window of a session will not succeed immediately; the dialog ‘Do you really want to log off?’ will be displayed first.
Public Method CompBitmap | This method compares two bitmap files pixel by pixel.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method HardCopy | This function dumps a hardcopy of the window as a bitmap file to disk. The parameter is the name of the file. If the function succeeds, then the return value will be the fully qualified path of the file. If no path information is given, then the file will be written to the SapWorkDir.
Public Method HardCopyToMemory | This function returns a hardcopy of the window as a safe array of bytes.
Public Method Iconify | This will set a window to the iconified state. It is not possible to iconify a specific window of a session; both the main window and all existing modals will be iconfied.
Public Method IsVKeyAllowed | This function returns True if the virtual key VKey is currently available. The VKeys are defined in the menu painter.
Public Method JumpBackward | Execute the Ctrl+Shift+Tab key on the window to jump backward one block.
Public Method JumpForward | Execute the Ctrl+Tab key on the window to jump forward one block.
Public Method Maximize | This will maximize a window. It is not possible to maximize a modal window; it is always the main window which will be maximized.
Public Method Restore | This will restore a window from its iconified state. It is not possible to restore a specific window of a session; both the main window and all existing modals will be restored.
Public Method SendVKey | The virtual key VKey is executed on the window. The VKeys are defined in the menu painter.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowMessageBox | This method shows the message box modal to the GuiFrameWindow. The title and text parameters set the title and text of the message box. The return value will be one of the MESSAGE_RESULT_* values.
Public Method TabBackward | Execute the Shift+Tab key on the window to jump backward one element.
Public Method TabForward | Execute the Tab key on the window to jump forward one element.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property ElementVisualizationMode | When elementVisualizationMode is enabled, a hit test can be performed on SAP GUI by moving the cursor over the window. The hit event of the session is fired when a component was found at the mouse position.
Public Property GuiFocus | The systemFocus only supports dynpro elements. To receive information about the currently focussed ActiveX control you can access the guiFocus property.
Public Property Handle | The window handle of the control that is connected to the GuiShell. This is the handle of the underlying window in Microsoft Windows.
Public Property Height | Height of the component in pixels.
Public Property Iconic | This property is True if the window is iconified. It is possible to execute script commands on an iconified window , but there may be undefined results, especially when controls are involved, as these may have invalid size settings.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SystemFocus | The systemFocus specifies the component that the SAP system is currently seeing as being focussed. This value is only valid for dynpro elements and might therefore differ from the focus as seen on the frontend.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.
Public Property WorkingPaneHeight | This is the height of the working pane in character metric.
Public Property WorkingPaneWidth | This is the width of the working pane in character metric. The working pane is the area between the toolbars in the upper area of the window and the statusbar at the bottom of the window.

See Also

GuiFrameWindow Overview


Close Method

Close Method

Description

The function attempts to close the window. Trying to close the last main window of a session will not succeed immediately; the dialog ‘Do you really want to log off?’ will be displayed first.

Syntax

Visual Basic
Public Sub Close()

See Also

GuiFrameWindow Object


CompBitmap Method

CompBitmap Method
Filename1
Filename2

Description

This method compares two bitmap files pixel by pixel.

Syntax

Visual Basic
Public Function CompBitmap( _
   ByVal Filename1 As String, _
   ByVal Filename2 As String _
) As Long

Parameters

Filename1
Filename2

Return Type

The method returns one of the following values:

  • 0: The files do not differ
  • 1: The files differ in size
  • 2: The files have different content
  • 3: There was an error

Example

result = MyWindow.CompBitmap(file1, file2)

Select Case result
Case 0 MsgBox "Files " & file1 & " and " & file2 & " are equal", vbOKOnly & vbInformation, "File Comparison"
Case 1 MsgBox "Files " & file1 & " and " & file2 & " differ in size", vbOKOnly & vbCritical, "File Comparison"
Case 2 MsgBox "Files " & file1 & " and " & file2 & " differ in content", vbOKOnly & vbCritical, "File Comparison"
Case 3 MsgBox "Error comparing files " & file1 & " and " & file2, vbOKOnly & vbCritical, "File Comparison"
End Select

See Also

GuiFrameWindow Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiFrameWindow Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiFrameWindow Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiFrameWindow Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiFrameWindow Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiFrameWindow Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiFrameWindow Object


HardCopy Method

HardCopy Method
Filename
ImageType

The following values are valid:

  • 0: BMP
  • 1: JPG
  • 2: PNG
  • 3: GIF
  • 4: TIFF

BMP is the default format.

xPos
If the optional parameters xPos, yPos, nWidth and nHeight are set, only the specified rectangle of the main window will be captured.
yPos
If the optional parameters xPos, yPos, nWidth and nHeight are set, only the specified rectangle of the main window will be captured.
nWidth
If the optional parameters xPos, yPos, nWidth and nHeight are set, only the specified rectangle of the main window will be captured.
nHeight
If the optional parameters xPos, yPos, nWidth and nHeight are set, only the specified rectangle of the main window will be captured.

Description

This function dumps a hardcopy of the window as a bitmap file to disk. The parameter is the name of the file. If the function succeeds, then the return value will be the fully qualified path of the file. If no path information is given, then the file will be written to the SapWorkDir.

Syntax

Visual Basic
Public Function HardCopy( _
   ByVal Filename As String, _
   Optional ByVal ImageType As Variant, _
   Optional ByVal xPos As Variant, _
   Optional ByVal yPos As Variant, _
   Optional ByVal nWidth As Variant, _
   Optional ByVal nHeight As Variant _
) As String

Parameters

Filename
ImageType

The following values are valid:

  • 0: BMP
  • 1: JPG
  • 2: PNG
  • 3: GIF
  • 4: TIFF

BMP is the default format.

xPos
If the optional parameters xPos, yPos, nWidth and nHeight are set, only the specified rectangle of the main window will be captured.
yPos
If the optional parameters xPos, yPos, nWidth and nHeight are set, only the specified rectangle of the main window will be captured.
nWidth
If the optional parameters xPos, yPos, nWidth and nHeight are set, only the specified rectangle of the main window will be captured.
nHeight
If the optional parameters xPos, yPos, nWidth and nHeight are set, only the specified rectangle of the main window will be captured.

See Also

GuiFrameWindow Object


HardCopyToMemory Method

HardCopyToMemory Method
ImageType

The following values are valid:

  • 0: BMP
  • 1: JPG
  • 2: PNG
  • 3: GIF

BMP is the default format.

Description

This function returns a hardcopy of the window as a safe array of bytes.

Syntax

Visual Basic
Public Function HardCopyToMemory( _
   Optional ByVal ImageType As Variant _
) As Variant

Parameters

ImageType

The following values are valid:

  • 0: BMP
  • 1: JPG
  • 2: PNG
  • 3: GIF

BMP is the default format.

See Also

GuiFrameWindow Object


Iconify Method

Iconify Method

Description

This will set a window to the iconified state. It is not possible to iconify a specific window of a session; both the main window and all existing modals will be iconfied.

Syntax

Visual Basic
Public Sub Iconify()

See Also

GuiFrameWindow Object


IsVKeyAllowed Method

IsVKeyAllowed Method
VKey

Description

This function returns True if the virtual key VKey is currently available. The VKeys are defined in the menu painter.

Syntax

Visual Basic
Public Function IsVKeyAllowed( _
   ByVal VKey As Integer _
) As Byte

Parameters

VKey

See Also

GuiFrameWindow Object


JumpBackward Method

JumpBackward Method

Description

Execute the Ctrl+Shift+Tab key on the window to jump backward one block.

Syntax

Visual Basic
Public Sub JumpBackward()

See Also

GuiFrameWindow Object


JumpForward Method

JumpForward Method

Description

Execute the Ctrl+Tab key on the window to jump forward one block.

Syntax

Visual Basic
Public Sub JumpForward()

See Also

GuiFrameWindow Object


Maximize Method

Maximize Method

Description

This will maximize a window. It is not possible to maximize a modal window; it is always the main window which will be maximized.

Syntax

Visual Basic
Public Sub Maximize()

See Also

GuiFrameWindow Object


Restore Method

Restore Method

Description

This will restore a window from its iconified state. It is not possible to restore a specific window of a session; both the main window and all existing modals will be restored.

Syntax

Visual Basic
Public Sub Restore()

See Also

GuiFrameWindow Object


SendVKey Method

SendVKey Method
VKey

Description

The virtual key VKey is executed on the window. The VKeys are defined in the menu painter.

Syntax

Visual Basic
Public Sub SendVKey( _
   ByVal VKey As Integer _
)

Parameters

VKey

See Also

GuiFrameWindow Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiFrameWindow Object


ShowMessageBox Method

ShowMessageBox Method
Title
Text
MsgIcon
The msgIcon parameter sets the icon to be used for the message box and should be set to one of the MESSAGE_TYPE_* constants.
MsgType
msgType sets the buttons available on the message box and should be set to one of the MESSAGE_OPTION* constants.

Description

This method shows the message box modal to the GuiFrameWindow. The title and text parameters set the title and text of the message box. The return value will be one of the MESSAGE_RESULT_* values.

Syntax

Visual Basic
Public Function ShowMessageBox( _
   ByVal Title As String, _
   ByVal Text As String, _
   ByVal MsgIcon As Long, _
   ByVal MsgType As Long _
) As Long

Parameters

Title
Text
MsgIcon
The msgIcon parameter sets the icon to be used for the message box and should be set to one of the MESSAGE_TYPE_* constants.
MsgType
msgType sets the buttons available on the message box and should be set to one of the MESSAGE_OPTION* constants.

See Also

GuiFrameWindow Object


TabBackward Method

TabBackward Method

Description

Execute the Shift+Tab key on the window to jump backward one element.

Syntax

Visual Basic
Public Sub TabBackward()

See Also

GuiFrameWindow Object


TabForward Method

TabForward Method

Description

Execute the Tab key on the window to jump forward one element.

Syntax

Visual Basic
Public Sub TabForward()

See Also

GuiFrameWindow Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiFrameWindow Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiFrameWindow Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiFrameWindow Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiFrameWindow Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiFrameWindow Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiFrameWindow Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiFrameWindow Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiFrameWindow Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiFrameWindow Object


ElementVisualizationMode Property

ElementVisualizationMode Property

Description

When elementVisualizationMode is enabled, a hit test can be performed on SAP GUI by moving the cursor over the window. The hit event of the session is fired when a component was found at the mouse position.

Property type

Read-write property

Syntax

Visual Basic
Public Property ElementVisualizationMode() As Byte

See Also

GuiFrameWindow Object


GuiFocus Property

GuiFocus Property

Description

The systemFocus only supports dynpro elements. To receive information about the currently focussed ActiveX control you can access the guiFocus property.

Property type

Read-only property

Syntax

Visual Basic
Public Property GuiFocus() As GuiVComponent

See Also

GuiFrameWindow Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell. This is the handle of the underlying window in Microsoft Windows.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiFrameWindow Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiFrameWindow Object


Iconic Property

Iconic Property

Description

This property is True if the window is iconified. It is possible to execute script commands on an iconified window , but there may be undefined results, especially when controls are involved, as these may have invalid size settings.

Property type

Read-only property

Syntax

Visual Basic
Public Property Iconic() As Byte

See Also

GuiFrameWindow Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiFrameWindow Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiFrameWindow Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiFrameWindow Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiFrameWindow Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiFrameWindow Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiFrameWindow Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiFrameWindow Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiFrameWindow Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiFrameWindow Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiFrameWindow Object


SystemFocus Property

SystemFocus Property

Description

The systemFocus specifies the component that the SAP system is currently seeing as being focussed. This value is only valid for dynpro elements and might therefore differ from the focus as seen on the frontend.

Property type

Read-only property

Syntax

Visual Basic
Public Property SystemFocus() As GuiVComponent

See Also

GuiFrameWindow Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiFrameWindow Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiFrameWindow Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiFrameWindow Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiFrameWindow Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiFrameWindow Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiFrameWindow Object


WorkingPaneHeight Property

WorkingPaneHeight Property

Description

This is the height of the working pane in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property WorkingPaneHeight() As Long

See Also

GuiFrameWindow Object


WorkingPaneWidth Property

WorkingPaneWidth Property

Description

This is the width of the working pane in character metric. The working pane is the area between the toolbars in the upper area of the window and the statusbar at the bottom of the window.

Property type

Read-only property

Syntax

Visual Basic
Public Property WorkingPaneWidth() As Long

See Also

GuiFrameWindow Object


GuiGOSShell Object

GuiGOSShell Object
See Also Members

Description

The GuiGosShell is only available in New Visual Design mode. GuiGOSShell extends GuiVContainer. The type prefix is shellcont, the name is the last part of the id, shellcont[n].

Object Model

Example

Transaction me22:

The GOS shell is a child of the titlebar and will contain another shell, in this example a toolbar control.

See Also

GuiGOSShell Members


GuiGOSShell Object Members

GuiGOSShell Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiGOSShell Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiGOSShell Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiGOSShell Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiGOSShell Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiGOSShell Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiGOSShell Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiGOSShell Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiGOSShell Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiGOSShell Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiGOSShell Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiGOSShell Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiGOSShell Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiGOSShell Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiGOSShell Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiGOSShell Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiGOSShell Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiGOSShell Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiGOSShell Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiGOSShell Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiGOSShell Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiGOSShell Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiGOSShell Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiGOSShell Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiGOSShell Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiGOSShell Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiGOSShell Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiGOSShell Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiGOSShell Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiGOSShell Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiGOSShell Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiGOSShell Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiGOSShell Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiGOSShell Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiGOSShell Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiGOSShell Object


GuiGraphAdapt Object

GuiGraphAdapt Object
See Also Members

Description

For the graphic adapter control only basic members from GuiShell are available. Recording and playback is not possible.

Object Model

Remarks

In addition to the new, activeX based controls SAP GUI also comes with a set of external graphics executables, for example to display a GANTT chart. These executables are not supported within the API. If during the execution of a script one of these executables is launched, then the script will be blocked.

If you need to automate a process during which a graphics executable is displayed, then you need an automation tool then allows you to both manipulate SAP GUI using the Scripting API, and other Windows applications using native methods.

There are many automation tools on the market that come with these features. The sample script below was written for WinBatch from Wilson WindowWare.

Open and close a graphics executable

This WinBatch script automates SAP GUI to open an external graphics executable and then closes the executable using WinBatch functions.

SapGuiAuto = ObjectGet("SAPGUI");

Application = SapGuiAuto.GetScriptingEngine;

AllConnections = Application.Children;
Connection = AllConnections.ElementAt(0);

AllSessions = Connection.Children;
Session = AllSessions.ElementAt(0);

session.findById("wnd[0]/tbar[0]/okcd").text = "/nse38";
session.findById("wnd[0]").sendVKey(0);

session.findById("wnd[0]/usr/ctxtRS38M-PROGRAMM").text = "GRGANT_1";
session.findById("wnd[0]").sendVKey(8);

session.findById("wnd[0]/tbar[1]/btn[8]").press(); At this point the graphics

                                                 ; executable is displayed

WinClose( "Studio-Disposition" );

session.findById("wnd[0]/tbar[0]/okcd").text = "/n";
session.findById("wnd[0]").sendVKey(0);

Message ("My Script", "Done");

See Also

GuiGraphAdapt Members


GuiGraphAdapt Object Members

GuiGraphAdapt Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiGraphAdapt Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiGraphAdapt Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiGraphAdapt Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiGraphAdapt Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiGraphAdapt Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiGraphAdapt Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiGraphAdapt Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiGraphAdapt Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiGraphAdapt Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiGraphAdapt Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiGraphAdapt Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiGraphAdapt Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiGraphAdapt Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiGraphAdapt Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiGraphAdapt Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiGraphAdapt Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiGraphAdapt Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiGraphAdapt Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiGraphAdapt Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiGraphAdapt Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiGraphAdapt Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiGraphAdapt Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiGraphAdapt Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiGraphAdapt Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiGraphAdapt Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiGraphAdapt Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiGraphAdapt Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiGraphAdapt Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiGraphAdapt Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiGraphAdapt Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiGraphAdapt Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiGraphAdapt Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiGraphAdapt Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiGraphAdapt Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiGraphAdapt Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiGraphAdapt Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiGraphAdapt Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiGraphAdapt Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiGraphAdapt Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiGraphAdapt Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiGraphAdapt Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiGraphAdapt Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiGraphAdapt Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiGraphAdapt Object


GuiGridView Object

GuiGridView Object
See Also Members

Description

The grid view is similar to the dynpro table control, but significantly more powerful. GuiGridView extends GuiShell.

Object Model

Example

See Also

GuiGridView Members


GuiGridView Object Members

GuiGridView Object Members
See Also Overview

Public Methods

Public Method ClearSelection | Calling clearSelection removes all row, column and cell selections.
Public Method Click | This function emulates a mouse click on a given cell if the parameters are valid and raises an exception otherwise.
Public Method ClickCurrentCell | This function emulates a mouse click on the current cell.
Public Method ContextMenu | Calling contextMenu emulates the context menu request.
Public Method CurrentCellMoved | This function notifies the server that a different cell has been made the current cell. It must be called whenever the current cell is changed.
Public Method DeleteRows | The parameter rows is a comma separated string of indices or index ranges, for example “3,5-8,14,15”. The entries must be ordered and not overlap, otherwise an exception is raised.
Public Method DeselectColumn | This function removes the specified column from the collection of the selected columns.
Public Method DoubleClick | This function emulates a mouse double click on a given cell if the parameters are valid and raises an exception otherwise.
Public Method DoubleClickCurrentCell | This function emulates a mouse double click on the current cell.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method DuplicateRows | The parameter rows is a comma separated string of indices or index ranges, for example “3,5-8,14,15”. For any single index a copy of the row will be inserted at the given index. If a range of indexes is duplicated then all the new lines are inserted as one block, before the old lines. The entries must be ordered and not overlap, otherwise an exception is raised.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method GetCellChangeable | This function returns True if the specified cell is changeable.
Public Method GetCellCheckBoxChecked | Returns True if the checkbox at the specified position is checked. Throws an exception if there is no checkbox in the specified cell.
Public Method GetCellColor | Returns an identifier for the color of the cell. This can be used to retrieve the color information using GetColorInfo.
Public Method GetCellHeight | Return the height of the cell in pixels.
Public Method GetCellIcon | Return the icon string of the cell, if the cell contains an icon. The string has the ABAP icon format '@xy@', where xy is a number or character.
Public Method GetCellLeft | Returns the left position of the cell in client coordinates.
Public Method GetCellMaxLength | Returns the maximum length of the cell in number of bytes.
Public Method GetCellState Returns the state of the cell. Possible values are:
  • Normal
  • Error
  • Warning
  • Info
Public Method GetCellTooltip | Returns the tooltip of the cell.
Public Method GetCellTop | Returns the top position of the cell in client coordinates.
Public Method GetCellType This function returns the type of the specified cell. Possible values are:
  • Normal
  • Button
  • Checkbox
  • ValueList
  • RadioButton
Public Method GetCellValue | This function returns the value of the specified cell.
Public Method GetCellWidth | Returns the width of the cell in pixels.
Public Method GetColorInfo | Returns the description for the color of the cell.
Public Method GetColumnDataType | Returns the data type of the column according to the 'built-in datatypes' of the XML schema standard.
Public Method GetColumnPosition | Returns the position of the column as shown on the screen, starting from 1.
Public Method GetColumnSortType Returns the sort type of the column. Possible values are:
  • None
  • Ascending
  • Descending
Public Method GetColumnTitles | This function returns a collection of strings that are used to display the title of a column. The control chooses the appropriate title according to the width of the column.
Public Method GetColumnTooltip | The tooltip of a column contains a text which is designed to help the user understands the meaning of the column.
Public Method GetColumnTotalType Returns the total type of the column. Possible values are:
  • None
  • Total
  • Subtotal
Public Method GetDisplayedColumnTitle | This function returns the title of the column that is currently displayed. This text is one of the values of the collection returned from the function “getColumnTitles”.
Public Method GetRowTotalLevel | Returns the level of the row.
Public Method GetSymbolInfo | Returns the description for the symbol in the cell.
Public Method GetToolbarButtonChecked | Returns True if the button is currently checked (pressed).
Public Method GetToolbarButtonEnabled | Indicates if the button can be pressed.
Public Method GetToolbarButtonIcon | Returns the name of the icon of the specified toolbar button.
Public Method GetToolbarButtonId | Returns the ID of the specified toolbar button, as defined in the ABAP data dictionary.
Public Method GetToolbarButtonText | Returns the text of the specified toolbar button.
Public Method GetToolbarButtonTooltip | Returns the tooltip of the specified toolbar button.
Public Method GetToolbarButtonType Returns the type of the specified toolbar button. Possible values are:
"Button", "ButtonAndMenu", "Menu", "Separator", "Group", "CheckBox"
Public Method GetToolbarFocusButton | Returns the position of the toolbar button that has the focus. If no button in the toolbar has the focus, the method returns -1.
Public Method HasCellF4Help | Returns True if the cell has a value help.
Public Method InsertRows | The parameter rows is a comma separated text of indices or index ranges, for example “3,5-8,14,15”. For any single index, a new row will be added at the given index, moving the old row one line down. If a range of indexes is inserted then all the new lines are inserted as one block, before any of the old lines. The entries must be ordered and not overlap, otherwise, an exception is raised.
Public Method IsCellHotspot | Returns True if the cell is a link.
Public Method IsCellSymbol | Returns True if the text in the cell is displayed in the SAP symbol font.
Public Method IsCellTotalExpander | Returns True if the cell contains a total expander button.
Public Method IsColumnFiltered | Returns True if a filter was applied to the column.
Public Method IsColumnKey | Returns True if the column is marked as a key column.
Public Method IsTotalRowExpanded | Returns true if the row containing an expander is currently expanded.
Public Method ModifyCell | If row and column identify a valid editable cell and value has a valid type for this cell, then the value of the cell is changed. Otherwise, an exception is raised.
Public Method ModifyCheckBox | If row and column identify a valid editable cell containing a checkbox, then the value of the cell is changed. Otherwise, an exception is raised.
Public Method MoveRows The rows with an index greater than or equal to fromRow up to an index less than or equal to toRow are moved to the position of destRow .
Passing invalid index values as parameters raises an exception.
Public Method PressButton | This function emulates pressing a button placed in a given cell. It will raise an exception if the cell does not contain a button, or does not even exist.
Public Method PressButtonCurrentCell | This function emulates pressing a button placed in the current cell. It will raise an exception if the cell does not contain a button.
Public Method PressColumnHeader | This function emulates a mouse click on the header of the column if the parameter identifies a valid column and raises an exception otherwise.
Public Method PressEnter | This emulates pressing the Enter key.
Public Method PressF1 | This emulates pressing the F1 key while the focus is on the grid view.
Public Method PressF4 | This emulates pressing the F4 key.
Public Method PressToolbarButton | This function emulates clicking a button in the grid view’s toolbar.
Public Method PressToolbarContextButton | This emulates opening the context menu of the grid view’s toolbar.
Public Method PressTotalRow | Pressing the total row button expands or condenses the grouped rows. If the selected cell is not a total row cell an exception is raised.
Public Method PressTotalRowCurrentCell | This function differs from pressTotalRow only in that it tries to press the expansion button on the current cell.
Public Method SelectAll | This function selects the whole grid content (i.e. all rows and all columns).
Public Method SelectColumn | This function adds the specified column to the collection of the selected columns.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SelectionChanged | This function notifies the server that the selection has changed.
Public Method SelectToolbarMenuItem | This function emulates the selection of an item from the context menu of the grid view’s toolbar. The parameter should be the function code of the item.
Public Method SetColumnWidth | The width of a column can be set using this function. The width is given in characters. For proportional fonts this refers to the width of an average character. Depending on the contents of the cell more or less characters may fit in the column. If the parameter is invalid an exception is raised.
Public Method SetCurrentCell | If row and column identify a valid cell, this cell becomes the current cell. Otherwise, an exception is raised.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method TriggerModified | Notifies the server of multiple changes in cells. Typically this method should be called after multiple calls to ModifyCell.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ColumnCount | This property represents the number of columns in the control.
Public Property ColumnOrder | This collection contains all the column identifiers in the order in which they are currently displayed. Passing an invalid column identifier to this property will raise an exception.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentCellColumn | The string identifying a column is the field name defined in the SAP data dictionary. In the example above the identifiers are named CARRID, CONNID, FLDATE, PRICE etc.
Public Property CurrentCellRow | The row index of the current cell ranges from 0 to the number of rows less 1, with -1 being the index of the title row.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property FirstVisibleColumn | This property represents the first visible column of the scrollable area of the grid view. Fixed columns are ignored. Setting the property to an invalid column identifier will raise an exception.
Public Property FirstVisibleRow | This is the index of the first visible row in the grid. Setting this property to an invalid row index will raise an exception.
Public Property FrozenColumnCount | This property represents the number of columns that are excluded from horizontal scrolling.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property RowCount | This property represents the number of rows in the control.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SelectedCells | The collection of selected cells contains strings, each of which has the format “<index of the row>,<column identifier>”, such as “0,CARRID”. Trying to set this property to an invalid value will raise an exception.
Public Property SelectedColumns | The selected columns are available as a collection of strings like the currentCellColumn string. Setting this property can raise an exception, if the new collection contains an invalid column identifier.
Public Property SelectedRows The string is a comma separated list of row index numbers or index ranges, such as “1,2,4-8,10”.
Setting this property to an invalid string or a string containing invalid row indices will raise an exception.
Public Property SelectionMode Possible values are:
  • “RowsAndColumns”: Only rows and columns can be selected. Individual rectangular areas of cells are not allowed.
  • “ListboxSingle”: Only one single row can be selected.
  • “ListboxMultiple”: One or more rows can be selected.
  • “Free”: Any kind of selection can be made.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “GridView”.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Title | This property represents title of the grid control.
Public Property ToolbarButtonCount | The number of toolbar buttons including separators.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property VisibleRowCount | Retrieves the number of visible rows of the grid.
Public Property Width | Width of the component in pixels.

See Also

GuiGridView Overview


ClearSelection Method

ClearSelection Method

Description

Calling clearSelection removes all row, column and cell selections.

Syntax

Visual Basic
Public Sub ClearSelection()

See Also

GuiGridView Object


Click Method

Click Method
Row
Column

Description

This function emulates a mouse click on a given cell if the parameters are valid and raises an exception otherwise.

Syntax

Visual Basic
Public Sub Click( _
   ByVal Row As Long, _
   ByVal Column As String _
)

Parameters

Row
Column

See Also

GuiGridView Object


ClickCurrentCell Method

ClickCurrentCell Method

Description

This function emulates a mouse click on the current cell.

Syntax

Visual Basic
Public Sub ClickCurrentCell()

See Also

GuiGridView Object


ContextMenu Method

ContextMenu Method

Description

Calling contextMenu emulates the context menu request.

Syntax

Visual Basic
Public Sub ContextMenu()

See Also

GuiGridView Object


CurrentCellMoved Method

CurrentCellMoved Method

Description

This function notifies the server that a different cell has been made the current cell. It must be called whenever the current cell is changed.

Syntax

Visual Basic
Public Sub CurrentCellMoved()

See Also

GuiGridView Object


DeleteRows Method

DeleteRows Method
Rows

Description

The parameter rows is a comma separated string of indices or index ranges, for example “3,5-8,14,15”. The entries must be ordered and not overlap, otherwise an exception is raised.

Syntax

Visual Basic
Public Sub DeleteRows( _
   ByVal Rows As String _
)

Parameters

Rows

See Also

GuiGridView Object


DeselectColumn Method

DeselectColumn Method
Column

Description

This function removes the specified column from the collection of the selected columns.

Syntax

Visual Basic
Public Sub DeselectColumn( _
   ByVal Column As String _
)

Parameters

Column

See Also

GuiGridView Object


DoubleClick Method

DoubleClick Method
Row
Column

Description

This function emulates a mouse double click on a given cell if the parameters are valid and raises an exception otherwise.

Syntax

Visual Basic
Public Sub DoubleClick( _
   ByVal Row As Long, _
   ByVal Column As String _
)

Parameters

Row
Column

See Also

GuiGridView Object


DoubleClickCurrentCell Method

DoubleClickCurrentCell Method

Description

This function emulates a mouse double click on the current cell.

Syntax

Visual Basic
Public Sub DoubleClickCurrentCell()

See Also

GuiGridView Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The GridView accepts the following values as “innerObject”:

  • "Toolbar": The returned GuiCollection contains information about the grid’s toolbar.
  • “Cell(row,column)”: The values of “row” and “column” must identify a cell of the grid (e.g. “Cell(2,PRICE)”). The returned GuiCollection contains information about the referenced cell.

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiGridView Object


DuplicateRows Method

DuplicateRows Method
Rows

Description

The parameter rows is a comma separated string of indices or index ranges, for example “3,5-8,14,15”. For any single index a copy of the row will be inserted at the given index. If a range of indexes is duplicated then all the new lines are inserted as one block, before the old lines. The entries must be ordered and not overlap, otherwise an exception is raised.

Syntax

Visual Basic
Public Sub DuplicateRows( _
   ByVal Rows As String _
)

Parameters

Rows

Example

0 | Value A
1 | Value B

If rows is “0,1” then the resulting table would be:

0 | Value A
1 | Value A
2 | Value B
3 | Value B

If on the other hand rows is “0-1” then the resulting table is:

0 | Value A
1 | Value B
2 | Value A
3 | Value B

See Also

GuiGridView Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiGridView Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiGridView Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiGridView Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiGridView Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiGridView Object


GetCellChangeable Method

GetCellChangeable Method
Row
Column

Description

This function returns True if the specified cell is changeable.

Syntax

Visual Basic
Public Function GetCellChangeable( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Byte

Parameters

Row
Column

See Also

GuiGridView Object


GetCellCheckBoxChecked Method

GetCellCheckBoxChecked Method
Row
Column

Description

Returns True if the checkbox at the specified position is checked. Throws an exception if there is no checkbox in the specified cell.

Syntax

Visual Basic
Public Function GetCellCheckBoxChecked( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Byte

Parameters

Row
Column

See Also

GuiGridView Object


GetCellColor Method

GetCellColor Method
Row
Column

Description

Returns an identifier for the color of the cell. This can be used to retrieve the color information using GetColorInfo.

Syntax

Visual Basic
Public Function GetCellColor( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Long

Parameters

Row
Column

See Also

GuiGridView Object


GetCellHeight Method

GetCellHeight Method
Row
Column

Description

Return the height of the cell in pixels.

Syntax

Visual Basic
Public Function GetCellHeight( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Long

Parameters

Row
Column

See Also

GuiGridView Object


GetCellIcon Method

GetCellIcon Method
Row
Column

Description

Return the icon string of the cell, if the cell contains an icon. The string has the ABAP icon format '@xy@', where xy is a number or character.

Syntax

Visual Basic
Public Function GetCellIcon( _
   ByVal Row As Long, _
   ByVal Column As String _
) As String

Parameters

Row
Column

See Also

GuiGridView Object


GetCellLeft Method

GetCellLeft Method
Row
Column

Description

Returns the left position of the cell in client coordinates.

Syntax

Visual Basic
Public Function GetCellLeft( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Long

Parameters

Row
Column

See Also

GuiGridView Object


GetCellMaxLength Method

GetCellMaxLength Method
Row
Column

Description

Returns the maximum length of the cell in number of bytes.

Syntax

Visual Basic
Public Function GetCellMaxLength( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Long

Parameters

Row
Column

See Also

GuiGridView Object


GetCellState Method

GetCellState Method
Row
Column

Description

Returns the state of the cell. Possible values are:

  • Normal
  • Error
  • Warning
  • Info

Syntax

Visual Basic
Public Function GetCellState( _
   ByVal Row As Long, _
   ByVal Column As String _
) As String

Parameters

Row
Column

See Also

GuiGridView Object


GetCellTooltip Method

GetCellTooltip Method
Row
Column

Description

Returns the tooltip of the cell.

Syntax

Visual Basic
Public Function GetCellTooltip( _
   ByVal Row As Long, _
   ByVal Column As String _
) As String

Parameters

Row
Column

See Also

GuiGridView Object


GetCellTop Method

GetCellTop Method
Row
Column

Description

Returns the top position of the cell in client coordinates.

Syntax

Visual Basic
Public Function GetCellTop( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Long

Parameters

Row
Column

See Also

GuiGridView Object


GetCellType Method

GetCellType Method
Row
Column

Description

This function returns the type of the specified cell. Possible values are:

  • Normal
  • Button
  • Checkbox
  • ValueList
  • RadioButton

Syntax

Visual Basic
Public Function GetCellType( _
   ByVal Row As Long, _
   ByVal Column As String _
) As String

Parameters

Row
Column

See Also

GuiGridView Object


GetCellValue Method

GetCellValue Method
Row
Column

Description

This function returns the value of the specified cell.

Syntax

Visual Basic
Public Function GetCellValue( _
   ByVal Row As Long, _
   ByVal Column As String _
) As String

Parameters

Row
Column

See Also

GuiGridView Object


GetCellWidth Method

GetCellWidth Method
Row
Column

Description

Returns the width of the cell in pixels.

Syntax

Visual Basic
Public Function GetCellWidth( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Long

Parameters

Row
Column

See Also

GuiGridView Object


GetColorInfo Method

GetColorInfo Method
Color
Identifier returned by GetCellColor

Description

Returns the description for the color of the cell.

Syntax

Visual Basic
Public Function GetColorInfo( _
   ByVal Color As Long _
) As String

Parameters

Color
Identifier returned by GetCellColor

Remarks

This function will only return a value when the accessibility mode of SAP GUI is enabled.

See Also

GuiGridView Object


GetColumnDataType Method

GetColumnDataType Method
Column

Description

Returns the data type of the column according to the 'built-in datatypes' of the XML schema standard.

Syntax

Visual Basic
Public Function GetColumnDataType( _
   ByVal Column As String _
) As String

Parameters

Column

See Also

GuiGridView Object


GetColumnPosition Method

GetColumnPosition Method
Column

Description

Returns the position of the column as shown on the screen, starting from 1.

Syntax

Visual Basic
Public Function GetColumnPosition( _
   ByVal Column As String _
) As Long

Parameters

Column

See Also

GuiGridView Object


GetColumnSortType Method

GetColumnSortType Method
Column

Description

Returns the sort type of the column. Possible values are:

  • None
  • Ascending
  • Descending

Syntax

Visual Basic
Public Function GetColumnSortType( _
   ByVal Column As String _
) As String

Parameters

Column

See Also

GuiGridView Object


GetColumnTitles Method

GetColumnTitles Method
Column

Description

This function returns a collection of strings that are used to display the title of a column. The control chooses the appropriate title according to the width of the column.

Syntax

Visual Basic
Public Function GetColumnTitles( _
   ByVal Column As String _
) As Object

Parameters

Column

See Also

GuiGridView Object


GetColumnTooltip Method

GetColumnTooltip Method
Column

Description

The tooltip of a column contains a text which is designed to help the user understands the meaning of the column.

Syntax

Visual Basic
Public Function GetColumnTooltip( _
   ByVal Column As String _
) As String

Parameters

Column

See Also

GuiGridView Object


GetColumnTotalType Method

GetColumnTotalType Method
Column

Description

Returns the total type of the column. Possible values are:

  • None
  • Total
  • Subtotal

Syntax

Visual Basic
Public Function GetColumnTotalType( _
   ByVal Column As String _
) As String

Parameters

Column

See Also

GuiGridView Object


GetDisplayedColumnTitle Method

GetDisplayedColumnTitle Method
Column

Description

This function returns the title of the column that is currently displayed. This text is one of the values of the collection returned from the function “getColumnTitles”.

Syntax

Visual Basic
Public Function GetDisplayedColumnTitle( _
   ByVal Column As String _
) As String

Parameters

Column

See Also

GuiGridView Object


GetRowTotalLevel Method

GetRowTotalLevel Method
Row

Description

Returns the level of the row.

Syntax

Visual Basic
Public Function GetRowTotalLevel( _
   ByVal Row As Long _
) As Long

Parameters

Row

Example

In this example the level is visualized by the number of dots in the sum/total column.

See Also

GuiGridView Object


GetSymbolInfo Method

GetSymbolInfo Method
Symbol
Value of the cell.

Description

Returns the description for the symbol in the cell.

Syntax

Visual Basic
Public Function GetSymbolInfo( _
   ByVal Symbol As String _
) As String

Parameters

Symbol
Value of the cell.

Remarks

This function will only return a value when the accessibility mode of SAP GUI is enabled.

See Also

GuiGridView Object


GetToolbarButtonChecked Method

GetToolbarButtonChecked Method
ButtonPos

Description

Returns True if the button is currently checked (pressed).

Syntax

Visual Basic
Public Function GetToolbarButtonChecked( _
   ByVal ButtonPos As Long _
) As Byte

Parameters

ButtonPos

See Also

GuiGridView Object


GetToolbarButtonEnabled Method

GetToolbarButtonEnabled Method
ButtonPos

Description

Indicates if the button can be pressed.

Syntax

Visual Basic
Public Function GetToolbarButtonEnabled( _
   ByVal ButtonPos As Long _
) As Byte

Parameters

ButtonPos

See Also

GuiGridView Object


GetToolbarButtonIcon Method

GetToolbarButtonIcon Method
ButtonPos

Description

Returns the name of the icon of the specified toolbar button.

Syntax

Visual Basic
Public Function GetToolbarButtonIcon( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiGridView Object


GetToolbarButtonId Method

GetToolbarButtonId Method
ButtonPos

Description

Returns the ID of the specified toolbar button, as defined in the ABAP data dictionary.

Syntax

Visual Basic
Public Function GetToolbarButtonId( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiGridView Object


GetToolbarButtonText Method

GetToolbarButtonText Method
ButtonPos

Description

Returns the text of the specified toolbar button.

Syntax

Visual Basic
Public Function GetToolbarButtonText( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiGridView Object


GetToolbarButtonTooltip Method

GetToolbarButtonTooltip Method
ButtonPos

Description

Returns the tooltip of the specified toolbar button.

Syntax

Visual Basic
Public Function GetToolbarButtonTooltip( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiGridView Object


GetToolbarButtonType Method

GetToolbarButtonType Method
ButtonPos

Description

Returns the type of the specified toolbar button. Possible values are:
"Button", "ButtonAndMenu", "Menu", "Separator", "Group", "CheckBox"

Syntax

Visual Basic
Public Function GetToolbarButtonType( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiGridView Object


GetToolbarFocusButton Method

GetToolbarFocusButton Method

Description

Returns the position of the toolbar button that has the focus. If no button in the toolbar has the focus, the method returns -1.

Syntax

Visual Basic
Public Function GetToolbarFocusButton() As Long

See Also

GuiGridView Object


HasCellF4Help Method

HasCellF4Help Method
Row
Column

Description

Returns True if the cell has a value help.

Syntax

Visual Basic
Public Function HasCellF4Help( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Byte

Parameters

Row
Column

Example

See Also

GuiGridView Object


InsertRows Method

InsertRows Method
Rows

Description

The parameter rows is a comma separated text of indices or index ranges, for example “3,5-8,14,15”. For any single index, a new row will be added at the given index, moving the old row one line down. If a range of indexes is inserted then all the new lines are inserted as one block, before any of the old lines. The entries must be ordered and not overlap, otherwise, an exception is raised.

Syntax

Visual Basic
Public Sub InsertRows( _
   ByVal Rows As String _
)

Parameters

Rows

Example

0 | Value A
1 | Value B

If rows is “0,1”, then the resulting table would be:

0 |
1 | Value A
2 |
3 | Value B

If, on the other hand, rows is “0-1”, then the resulting table is:

0 |
1 |
2 | Value A
3 | Value B

See Also

GuiGridView Object


IsCellHotspot Method

IsCellHotspot Method
Row
Column

Description

Returns True if the cell is a link.

Syntax

Visual Basic
Public Function IsCellHotspot( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Byte

Parameters

Row
Column

Example

See Also

GuiGridView Object


IsCellSymbol Method

IsCellSymbol Method
Row
Column

Description

Returns True if the text in the cell is displayed in the SAP symbol font.

Syntax

Visual Basic
Public Function IsCellSymbol( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Byte

Parameters

Row
Column

Example

See Also

GuiGridView Object


IsCellTotalExpander Method

IsCellTotalExpander Method
Row
Column

Description

Returns True if the cell contains a total expander button.

Syntax

Visual Basic
Public Function IsCellTotalExpander( _
   ByVal Row As Long, _
   ByVal Column As String _
) As Byte

Parameters

Row
Column

Example

See Also

GuiGridView Object


IsColumnFiltered Method

IsColumnFiltered Method
Column

Description

Returns True if a filter was applied to the column.

Syntax

Visual Basic
Public Function IsColumnFiltered( _
   ByVal Column As String _
) As Byte

Parameters

Column

Example

See Also

GuiGridView Object


IsColumnKey Method

IsColumnKey Method
Column

Description

Returns True if the column is marked as a key column.

Syntax

Visual Basic
Public Function IsColumnKey( _
   ByVal Column As String _
) As Byte

Parameters

Column

See Also

GuiGridView Object


IsTotalRowExpanded Method

IsTotalRowExpanded Method
Row

Description

Returns true if the row containing an expander is currently expanded.

Syntax

Visual Basic
Public Function IsTotalRowExpanded( _
   ByVal Row As Long _
) As Byte

Parameters

Row

Example

Expanded:

Collapsed:

See Also

GuiGridView Object


ModifyCell Method

ModifyCell Method
Row
Column
Value

Description

If row and column identify a valid editable cell and value has a valid type for this cell, then the value of the cell is changed. Otherwise, an exception is raised.

Syntax

Visual Basic
Public Sub ModifyCell( _
   ByVal Row As Long, _
   ByVal Column As String, _
   ByVal Value As String _
)

Parameters

Row
Column
Value

See Also

GuiGridView Object


ModifyCheckBox Method

ModifyCheckBox Method
Row
Column
Checked

Description

If row and column identify a valid editable cell containing a checkbox, then the value of the cell is changed. Otherwise, an exception is raised.

Syntax

Visual Basic
Public Sub ModifyCheckBox( _
   ByVal Row As Long, _
   ByVal Column As String, _
   ByVal Checked As Boolean _
)

Parameters

Row
Column
Checked

See Also

GuiGridView Object


MoveRows Method

MoveRows Method
FromRow
ToRow
DestRow

Description

The rows with an index greater than or equal to fromRow up to an index less than or equal to toRow are moved to the position of destRow .
Passing invalid index values as parameters raises an exception.

Syntax

Visual Basic
Public Sub MoveRows( _
   ByVal FromRow As Long, _
   ByVal ToRow As Long, _
   ByVal DestRow As Long _
)

Parameters

FromRow
ToRow
DestRow

See Also

GuiGridView Object


PressButton Method

PressButton Method
Row
Column

Description

This function emulates pressing a button placed in a given cell. It will raise an exception if the cell does not contain a button, or does not even exist.

Syntax

Visual Basic
Public Sub PressButton( _
   ByVal Row As Long, _
   ByVal Column As String _
)

Parameters

Row
Column

See Also

GuiGridView Object


PressButtonCurrentCell Method

PressButtonCurrentCell Method

Description

This function emulates pressing a button placed in the current cell. It will raise an exception if the cell does not contain a button.

Syntax

Visual Basic
Public Sub PressButtonCurrentCell()

See Also

GuiGridView Object


PressColumnHeader Method

PressColumnHeader Method
Column

Description

This function emulates a mouse click on the header of the column if the parameter identifies a valid column and raises an exception otherwise.

Syntax

Visual Basic
Public Sub PressColumnHeader( _
   ByVal Column As String _
)

Parameters

Column

See Also

GuiGridView Object


PressEnter Method

PressEnter Method

Description

This emulates pressing the Enter key.

Syntax

Visual Basic
Public Sub PressEnter()

See Also

GuiGridView Object


PressF1 Method

PressF1 Method

Description

This emulates pressing the F1 key while the focus is on the grid view.

Syntax

Visual Basic
Public Sub PressF1()

See Also

GuiGridView Object


PressF4 Method

PressF4 Method

Description

This emulates pressing the F4 key.

Syntax

Visual Basic
Public Sub PressF4()

See Also

GuiGridView Object


PressToolbarButton Method

PressToolbarButton Method
Id

Description

This function emulates clicking a button in the grid view’s toolbar.

Syntax

Visual Basic
Public Sub PressToolbarButton( _
   ByVal Id As String _
)

Parameters

Id

See Also

GuiGridView Object


PressToolbarContextButton Method

PressToolbarContextButton Method
Id

Description

This emulates opening the context menu of the grid view’s toolbar.

Syntax

Visual Basic
Public Sub PressToolbarContextButton( _
   ByVal Id As String _
)

Parameters

Id

See Also

GuiGridView Object


PressTotalRow Method

PressTotalRow Method
Row
Column

Description

Pressing the total row button expands or condenses the grouped rows. If the selected cell is not a total row cell an exception is raised.

Syntax

Visual Basic
Public Sub PressTotalRow( _
   ByVal Row As Long, _
   ByVal Column As String _
)

Parameters

Row
Column

Example

See Also

GuiGridView Object


PressTotalRowCurrentCell Method

PressTotalRowCurrentCell Method

Description

This function differs from pressTotalRow only in that it tries to press the expansion button on the current cell.

Syntax

Visual Basic
Public Sub PressTotalRowCurrentCell()

See Also

GuiGridView Object


SelectAll Method

SelectAll Method

Description

This function selects the whole grid content (i.e. all rows and all columns).

Syntax

Visual Basic
Public Sub SelectAll()

See Also

GuiGridView Object


SelectColumn Method

SelectColumn Method
Column

Description

This function adds the specified column to the collection of the selected columns.

Syntax

Visual Basic
Public Sub SelectColumn( _
   ByVal Column As String _
)

Parameters

Column

See Also

GuiGridView Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiGridView Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiGridView Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiGridView Object


SelectionChanged Method

SelectionChanged Method

Description

This function notifies the server that the selection has changed.

Syntax

Visual Basic
Public Sub SelectionChanged()

See Also

GuiGridView Object


SelectToolbarMenuItem Method

SelectToolbarMenuItem Method
Id

Description

This function emulates the selection of an item from the context menu of the grid view’s toolbar. The parameter should be the function code of the item.

Syntax

Visual Basic
Public Sub SelectToolbarMenuItem( _
   ByVal Id As String _
)

Parameters

Id

See Also

GuiGridView Object


SetColumnWidth Method

SetColumnWidth Method
Column
Width

Description

The width of a column can be set using this function. The width is given in characters. For proportional fonts this refers to the width of an average character. Depending on the contents of the cell more or less characters may fit in the column. If the parameter is invalid an exception is raised.

Syntax

Visual Basic
Public Sub SetColumnWidth( _
   ByVal Column As String, _
   ByVal Width As Long _
)

Parameters

Column
Width

See Also

GuiGridView Object


SetCurrentCell Method

SetCurrentCell Method
Row
Column

Description

If row and column identify a valid cell, this cell becomes the current cell. Otherwise, an exception is raised.

Syntax

Visual Basic
Public Sub SetCurrentCell( _
   ByVal Row As Long, _
   ByVal Column As String _
)

Parameters

Row
Column

See Also

GuiGridView Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiGridView Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiGridView Object


TriggerModified Method

TriggerModified Method

Description

Notifies the server of multiple changes in cells. Typically this method should be called after multiple calls to ModifyCell.

Syntax

Visual Basic
Public Sub TriggerModified()

See Also

GuiGridView Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiGridView Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiGridView Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiGridView Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiGridView Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiGridView Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiGridView Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiGridView Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiGridView Object


ColumnCount Property

ColumnCount Property

Description

This property represents the number of columns in the control.

Property type

Read-only property

Syntax

Visual Basic
Public Property ColumnCount() As Long

See Also

GuiGridView Object


ColumnOrder Property

ColumnOrder Property

Description

This collection contains all the column identifiers in the order in which they are currently displayed. Passing an invalid column identifier to this property will raise an exception.

Property type

Read-write property

Syntax

Visual Basic
Public Property ColumnOrder() As Object

See Also

GuiGridView Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiGridView Object


CurrentCellColumn Property

CurrentCellColumn Property

Description

The string identifying a column is the field name defined in the SAP data dictionary. In the example above the identifiers are named CARRID, CONNID, FLDATE, PRICE etc.

Property type

Read-write property

Syntax

Visual Basic
Public Property CurrentCellColumn() As String

See Also

GuiGridView Object


CurrentCellRow Property

CurrentCellRow Property

Description

The row index of the current cell ranges from 0 to the number of rows less 1, with -1 being the index of the title row.

Property type

Read-write property

Syntax

Visual Basic
Public Property CurrentCellRow() As Long

See Also

GuiGridView Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiGridView Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiGridView Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiGridView Object


FirstVisibleColumn Property

FirstVisibleColumn Property

Description

This property represents the first visible column of the scrollable area of the grid view. Fixed columns are ignored. Setting the property to an invalid column identifier will raise an exception.

Property type

Read-write property

Syntax

Visual Basic
Public Property FirstVisibleColumn() As String

See Also

GuiGridView Object


FirstVisibleRow Property

FirstVisibleRow Property

Description

This is the index of the first visible row in the grid. Setting this property to an invalid row index will raise an exception.

Property type

Read-write property

Syntax

Visual Basic
Public Property FirstVisibleRow() As Long

See Also

GuiGridView Object


FrozenColumnCount Property

FrozenColumnCount Property

Description

This property represents the number of columns that are excluded from horizontal scrolling.

Property type

Read-only property

Syntax

Visual Basic
Public Property FrozenColumnCount() As Long

See Also

GuiGridView Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiGridView Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiGridView Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiGridView Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiGridView Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiGridView Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiGridView Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiGridView Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiGridView Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiGridView Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiGridView Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiGridView Object


RowCount Property

RowCount Property

Description

This property represents the number of rows in the control.

Property type

Read-only property

Syntax

Visual Basic
Public Property RowCount() As Long

See Also

GuiGridView Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiGridView Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiGridView Object


SelectedCells Property

SelectedCells Property

Description

The collection of selected cells contains strings, each of which has the format “<index of the row>,<column identifier>”, such as “0,CARRID”. Trying to set this property to an invalid value will raise an exception.

Property type

Read-write property

Syntax

Visual Basic
Public Property SelectedCells() As Object

See Also

GuiGridView Object


SelectedColumns Property

SelectedColumns Property

Description

The selected columns are available as a collection of strings like the currentCellColumn string. Setting this property can raise an exception, if the new collection contains an invalid column identifier.

Property type

Read-write property

Syntax

Visual Basic
Public Property SelectedColumns() As Object

See Also

GuiGridView Object


SelectedRows Property

SelectedRows Property

Description

The string is a comma separated list of row index numbers or index ranges, such as “1,2,4-8,10”.
Setting this property to an invalid string or a string containing invalid row indices will raise an exception.

Property type

Read-write property

Syntax

Visual Basic
Public Property SelectedRows() As String

See Also

GuiGridView Object


SelectionMode Property

SelectionMode Property

Description

Possible values are:

  • “RowsAndColumns”: Only rows and columns can be selected. Individual rectangular areas of cells are not allowed.
  • “ListboxSingle”: Only one single row can be selected.
  • “ListboxMultiple”: One or more rows can be selected.
  • “Free”: Any kind of selection can be made.

Property type

Read-only property

Syntax

Visual Basic
Public Property SelectionMode() As String

See Also

GuiGridView Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “GridView”.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiGridView Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiGridView Object


Title Property

Title Property

Description

This property represents title of the grid control.

Property type

Read-only property

Syntax

Visual Basic
Public Property Title() As String

See Also

GuiGridView Object


ToolbarButtonCount Property

ToolbarButtonCount Property

Description

The number of toolbar buttons including separators.

Property type

Read-only property

Syntax

Visual Basic
Public Property ToolbarButtonCount() As Long

See Also

GuiGridView Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiGridView Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiGridView Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiGridView Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiGridView Object


VisibleRowCount Property

VisibleRowCount Property

Description

Retrieves the number of visible rows of the grid.

Property type

Read-only property

Syntax

Visual Basic
Public Property VisibleRowCount() As Long

See Also

GuiGridView Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiGridView Object


GuiHTMLViewer Object

GuiHTMLViewer Object
See Also Members

Description

The GuiHTMLViewer is used to display an HTML document inside SAP GUI. GuiHTMLViewer extends GuiShell.

Object Model

See Also

GuiHTMLViewer Members


GuiHTMLViewer Object Members

GuiHTMLViewer Object Members
See Also Overview

Public Methods

Public Method ContextMenu | Calling contextMenu emulates the context menu request. Note that this function applies only to context menus provided by the backend, not to the local context menu, which is generated by the HTML control.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SapEvent | This function submits an HTML form to the backend.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property BrowserHandle |
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DocumentComplete |
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value HTMLViewer.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiHTMLViewer Overview


ContextMenu Method

ContextMenu Method

Description

Calling contextMenu emulates the context menu request. Note that this function applies only to context menus provided by the backend, not to the local context menu, which is generated by the HTML control.

Syntax

Visual Basic
Public Sub ContextMenu()

See Also

GuiHTMLViewer Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiHTMLViewer Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiHTMLViewer Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiHTMLViewer Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiHTMLViewer Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiHTMLViewer Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiHTMLViewer Object


SapEvent Method

SapEvent Method
FrameName
This is the name of the frame in which the HTML form that has been submitted lives.
PostData
Contains the form data when a submit is made using the POST method.
Url
This is the URL which is submitted to the backend. The protocol name for the URL string is “sapevent:”. This is followed by the name of the event as defined in the Action Property of the HTML form which is called.

Description

This function submits an HTML form to the backend.

Syntax

Visual Basic
Public Sub SapEvent( _
   ByVal FrameName As String, _
   ByVal PostData As String, _
   ByVal Url As String _
)

Parameters

FrameName
This is the name of the frame in which the HTML form that has been submitted lives.
PostData
Contains the form data when a submit is made using the POST method.
Url
This is the URL which is submitted to the backend. The protocol name for the URL string is “sapevent:”. This is followed by the name of the event as defined in the Action Property of the HTML form which is called.

Remarks

If the form is to be submitted using the GET method, the data is appended to the event name in the usual http URL fashion, for example:

sapEvent("Frame1","","sapevent:SUBMIT_FORM_AS_GET_METHOD?FirstName=John&LastName=Smith");

In this case, postData is always an empty string.

If the form is to be submitted using the POST method, the data is transported in the postData parameter:

sapEvent("Frame1","FirstName=John&LastName=Smith","sapevent:SUBMIT_FORM_AS_POST_METHOD");

See Also

GuiHTMLViewer Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiHTMLViewer Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiHTMLViewer Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiHTMLViewer Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiHTMLViewer Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiHTMLViewer Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiHTMLViewer Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiHTMLViewer Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiHTMLViewer Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiHTMLViewer Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiHTMLViewer Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiHTMLViewer Object


BrowserHandle Property

BrowserHandle Property

Property type

Read-only property

Syntax

Visual Basic
Public Property BrowserHandle() As Object

See Also

GuiHTMLViewer Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiHTMLViewer Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiHTMLViewer Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiHTMLViewer Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiHTMLViewer Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiHTMLViewer Object


DocumentComplete Property

DocumentComplete Property

Property type

Read-only property

Syntax

Visual Basic
Public Property DocumentComplete() As Long

See Also

GuiHTMLViewer Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiHTMLViewer Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiHTMLViewer Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiHTMLViewer Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiHTMLViewer Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiHTMLViewer Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiHTMLViewer Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiHTMLViewer Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiHTMLViewer Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiHTMLViewer Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiHTMLViewer Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiHTMLViewer Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiHTMLViewer Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiHTMLViewer Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiHTMLViewer Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value HTMLViewer.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiHTMLViewer Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiHTMLViewer Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiHTMLViewer Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiHTMLViewer Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiHTMLViewer Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiHTMLViewer Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiHTMLViewer Object


GuiLabel Object

GuiLabel Object
See Also Members

Description

GuiLabel extends GuiVComponent. The type prefix is lbl, the name is the fieldname taken from the SAP data dictionary.

Object Model

See Also

GuiLabel Members


GuiLabel Object Members

GuiLabel Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method GetListProperty | This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes.
Public Method GetListPropertyNonRec | This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes. In contrast to the method GetListProperty, GetListPropertyNonRec will only return information that is set for the specific element, and ignore list properties set for parent elements.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property CaretPosition | Position of the text caret in the input field. Setting the caret position within a label is possible even though it is not visualized as a caret by SAP GUI. However, the position is transmitted to the server, so ABAP application logic may depend on this position.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property ColorIndex | This number defines the index of the list color of this element.
Public Property ColorIntensified | This property is True if the Intensified flag is set in screen painter for this dynpro element.
Public Property ColorInverse | This property is True if the inverse color style is set in screen painter for the element.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DisplayedText | This property contains the text as it is displayed on the screen, including preceding or trailing blanks. These blanks are stripped from the text property.
Public Property Height | Height of the component in pixels.
Public Property Highlighted | This property is True if the Highlighted flag is set in the screen painter for the dynpro element.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsHotspot | Dynpro elements such as labels may be configured to cause a round trip when they are clicked. In that case the mouse cursor changes to the hand shape. This is called a hot spot.
Public Property IsLeftLabel | This property is True if the component has the 'assign left' flag. This property is set if the label has been assigned as the left label of another control.
Public Property IsListElement | This property is True if the element is on an ABAP list, not a dynpro screen.
Public Property IsRightLabel | This property is True if the component has the 'assign right' flag. This property is set if the label has been assigned as the right label of another control.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property MaxLength | Maximum length of the input field in number of characters. The maximum text length of a label is counted in code units. On non-Unicode clients these are equivalent to bytes.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Numerical | This property is True if the component is an input field that only accepts numeric characters. This flag is True if the label may only contain numbers.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property RowText | This property is only available in ABAP list screens. It returns the text of the while line containing the current component.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiLabel Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiLabel Object


GetListProperty Method

GetListProperty Method
Property

Description

This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes.

Syntax

Visual Basic
Public Function GetListProperty( _
   ByVal Property As String _
) As String

Parameters

Property

Remarks

Attributes of containers in general

  • ContainerType
    • "L": Entire list
    • "T": A table
    • "G": A group inside a table
    • "S" : A subgroup (inside a group)
    • "R": A line in the body of a table
    • "B": A text box
    • "E": A tree
    • "F": Simple "free" text outside any box
  • ContainerTitle: Title of a table (if provided) or of a text box
  • ContainerInputFields: Used iff a table or a tree has input fields (incl. checkboxes): Number of input fields

Attributes of containers of type "L" (Entire list)

  • ListTablesTotal: Number of tables on the list
  • ListTextBoxesTotal: Number of text boxes on the list
  • ListTreesTotal: Number of trees on the list
  • ListErrorMessage: Used iff the structure recognition detected a (severe) error.
  • ListInputType
    • "N": list contains no input fields
    • "C": list contains check boxes
    • "E": list contains edit fields
    • "A": list contains edit fields and check boxes

Attributes of containers of type "T" (Table), "G" (Group) and "S" (Subgroup)

  • RowsTotal: Number of logical rows in the table body. If this is an attribute of a (sub-)group, number of logical rows until the next (sub-)group starts. The numbers do NOT include summation lines and inserted lines.
  • RowsSummation: Number of rows with color COL_SUMMING INTENSIFIED ON (if there are any).
  • RowsSubSummation: Number of rows with color COL_SUMMING INTENSIFIED OFF (if there are any).
  • RowsInserted: Number of inserted rows (if there are any).

Attributes of containers of type "T" (Table)

  • TableNo: Number of the table if there is more than one table on the list
  • ColumnsTotal: Number of logical columns
  • SuperColumnsTotal: Used iff the table has a hierarchical header
  • TableHierarchical: Used iff the table is hierarchical-sequential
    • "A": ALV-like 2-level hierarchical-seq.
    • "2": 2-level hierarchical-seq.
    • "3": 3-level hierarchical-seq.
  • TableGroupsTotal: Used iff the table is hierarchical-seq.: Number of groups (not counting subgroups)
  • Columns2LevelALV: Used iff TableHierarchical is "A": Number of columns in the group header
  • HeaderRows2LevelALV: Used iff TableHierarchical is "A": Number of lines in the group header
  • TableHierarchicalHeader: Used iff the table has a hierarchical header
  • TableMultipleRows: Used iff the table is a multiple-line table: Number of physical lines per logical line

Attributes of containers of type "G" (Group) and "S" (Subgroup)

  • GroupNo: Number of current group if container is of type "G".
  • SubGroupNo: Number of current subgroup if container is of type "S".
  • SubgroupsTotal: Number of subgroups if table is 3-level hierarchical-sequential and container is of type "G"
  • GroupHeaderRows: Number of physical lines in the group header
  • GroupHeaderValues: Number of label-value pairs in the group header if the table is 2- or 3- level hierarchical-sequential.

Attributes of containers of type "R" (Row)

  • RowType: Used iff the row has a special type
    • "S": Color COL_SUMMING INTENSIFIED ON
    • "U": Color COL_SUMMING INTENSIFIED OFF
    • "I": Inserted line
  • RowNo: Number of current (logical) row, relative to the beginning of the (sub-)group if the table is 3- or 2-level hierarchical-seq.
  • RowMultipleRows: Number of physical lines for current logical line; used iff > 1 (multiple-line tables). Lines with totals may or may not be multiple lines.
  • RowInputFields: Number of input fields in the current line (if any).

Attributes of fields in tables

  • FieldHeader: The text of the column header (unavailable if the field itself is in the header, or the field is the label of a label-value pair in a hierarchical-sequential table, or the field is in an inserted line and does not belong to any column).
  • FieldSuperHeader: Text of the supercolumn if the field is in the lower line of a hierarchical header or in the table body (and belongs to a column).
  • ColumnNo: The number of the logical column (if the field belongs to a column).
  • LabelType: Used iff the field is in the header or is a label of a label-value pair in a hierarchical-seq. table.
    • "N": normal header field (lowest level in hierar.-seq. tables)
    • "H": header field in a supercolumn (upper line of a hierarchical header)
    • "A": group header field (COL_GROUPING INTENSIFIED ON) in table whereTableHierarchical is "A"
    • "G": group header field (COL_GROUPING INTENSIFIED ON) in 2-level hierarchical-sequential table
    • "S": subgroup header field (COL_HEADING INTENSIFIED ON) in 3-level hierarchical-sequential table
    • "T": title-field COL_NORMAL INTENSIFIED ON
  • ColumnType: Used if the field is a column header of a special column.
    • "C": column contains checkboxes
    • "S": column contains symbols and/or icons
  • SubordinateColumns: Number of subordinate columns if the field is in the upper line of a hierarchical header.
  • FieldMultipleRows: Used iff the field is in a table header and word wrapping was done: Number of physical lines of the "logical field".
  • FieldWithEllipsis: The field is directly followed by SYM_ELLIPSIS, i.e. "...".

Attributes of fields in tables, trees or title lines of text boxes

  • FieldPhysRowNo: If we are in the body of a multiple-line table or in a multiple-line node of a tree or word wrapping is used in the table header: Current physical line number within the logical line.

Attributes of text boxes

  • TextBoxNo: Number of the text box if there is more than one text box on the list

Attributes of containers in an SEUT tree

  • TreeNo: Number of the tree if there is more than one tree on the list and the current container is the root node
  • NodeName: Text of the first field of the node (STREENODE-NAME)
  • NodeLevelNo: The current level number; the root has level 0
  • NodeNo: The current node number; the "oldest brother" has number 1.
  • NodeExpandable: Used iff the current node can be expanded (folder with "+").
  • NodeMarked: Node has been marked (yellow in SEUT).
  • NodeChildrenTotal: Used iff the current node is expanded (folder with "-"): Number of children. (Grand children are not counted.)
  • NodeMultipleRows: Used iff the current node has more than one physical line: Number of physical lines

See Also

GuiLabel Object


GetListPropertyNonRec Method

GetListPropertyNonRec Method
Property

Description

This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes. In contrast to the method GetListProperty, GetListPropertyNonRec will only return information that is set for the specific element, and ignore list properties set for parent elements.

Syntax

Visual Basic
Public Function GetListPropertyNonRec( _
   ByVal Property As String _
) As String

Parameters

Property

See Also

GuiLabel Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiLabel Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiLabel Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiLabel Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiLabel Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiLabel Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiLabel Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiLabel Object


CaretPosition Property

CaretPosition Property

Description

Position of the text caret in the input field. Setting the caret position within a label is possible even though it is not visualized as a caret by SAP GUI. However, the position is transmitted to the server, so ABAP application logic may depend on this position.

Property type

Read-write property

Syntax

Visual Basic
Public Property CaretPosition() As Long

See Also

GuiLabel Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiLabel Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiLabel Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiLabel Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiLabel Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiLabel Object


ColorIndex Property

ColorIndex Property

Description

This number defines the index of the list color of this element.

Property type

Read-only property

Syntax

Visual Basic
Public Property ColorIndex() As Long

See Also

GuiLabel Object


ColorIntensified Property

ColorIntensified Property

Description

This property is True if the Intensified flag is set in screen painter for this dynpro element.

Property type

Read-only property

Syntax

Visual Basic
Public Property ColorIntensified() As Byte

See Also

GuiLabel Object


ColorInverse Property

ColorInverse Property

Description

This property is True if the inverse color style is set in screen painter for the element.

Property type

Read-only property

Syntax

Visual Basic
Public Property ColorInverse() As Byte

See Also

GuiLabel Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiLabel Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiLabel Object


DisplayedText Property

DisplayedText Property

Description

This property contains the text as it is displayed on the screen, including preceding or trailing blanks. These blanks are stripped from the text property.

Property type

Read-only property

Syntax

Visual Basic
Public Property DisplayedText() As String

See Also

GuiLabel Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiLabel Object


Highlighted Property

Highlighted Property

Description

This property is True if the Highlighted flag is set in the screen painter for the dynpro element.

Property type

Read-only property

Syntax

Visual Basic
Public Property Highlighted() As Byte

Example

This is an example of both a highlighted GuiLabel on the left and a highlighted GuiTextField on the right. The highlighted property is defined in the data dictionary.

See Also

GuiLabel Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiLabel Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiLabel Object


IsHotspot Property

IsHotspot Property

Description

Dynpro elements such as labels may be configured to cause a round trip when they are clicked. In that case the mouse cursor changes to the hand shape. This is called a hot spot.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsHotspot() As Byte

See Also

GuiLabel Object


IsLeftLabel Property

IsLeftLabel Property

Description

This property is True if the component has the 'assign left' flag. This property is set if the label has been assigned as the left label of another control.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsLeftLabel() As Byte

See Also

GuiLabel Object


IsListElement Property

IsListElement Property

Description

This property is True if the element is on an ABAP list, not a dynpro screen.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsListElement() As Byte

See Also

GuiLabel Object


IsRightLabel Property

IsRightLabel Property

Description

This property is True if the component has the 'assign right' flag. This property is set if the label has been assigned as the right label of another control.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsRightLabel() As Byte

See Also

GuiLabel Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiLabel Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiLabel Object


MaxLength Property

MaxLength Property

Description

Maximum length of the input field in number of characters. The maximum text length of a label is counted in code units. On non-Unicode clients these are equivalent to bytes.

Property type

Read-only property

Syntax

Visual Basic
Public Property MaxLength() As Long

See Also

GuiLabel Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiLabel Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiLabel Object


Numerical Property

Numerical Property

Description

This property is True if the component is an input field that only accepts numeric characters. This flag is True if the label may only contain numbers.

Property type

Read-only property

Syntax

Visual Basic
Public Property Numerical() As Byte

See Also

GuiLabel Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiLabel Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiLabel Object


RowText Property

RowText Property

Description

This property is only available in ABAP list screens. It returns the text of the while line containing the current component.

Property type

Read-only property

Syntax

Visual Basic
Public Property RowText() As String

See Also

GuiLabel Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiLabel Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiLabel Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiLabel Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiLabel Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiLabel Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiLabel Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiLabel Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiLabel Object


GuiMainWindow Object

GuiMainWindow Object
See Also Members

Description

This window represents the main window of a SAP GUI session.

GuiMainWindow extends GuiFrameWindow.

Object Model

See Also

GuiMainWindow Members


GuiMainWindow Object Members

GuiMainWindow Object Members
See Also Overview

Public Methods

Public Method Close | Close the main window.
Public Method CompBitmap |
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method HardCopy | Create a hardcopy of the main window.
Public Method HardCopyToMemory | Create a screenshot of SAP GUI and return it in a memory block to the caller.
Public Method Iconify | Collapse the main window to the minimized state.
Public Method IsVKeyAllowed | The method returns True if the given virtual key can be executed on the current screen.
Public Method JumpBackward | Execute the Ctrl+Shift+Tab key on the window to jump backward one block.
Public Method JumpForward | Execute the Ctrl+Tab key on the window to jump forward one block.
Public Method Maximize | Maximize the main window.
Public Method ResizeWorkingPane | The ResizeWorkingPane function will resize the window so that the available working area has the given width and height in character metric.
Public Method ResizeWorkingPaneEx | The ResizeWorkingPaneEx function will resize the window so that the available working area has the given width and height in pixels.
Public Method Restore | Restore the main window.
Public Method SendVKey | Send a virtual key to the system.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowMessageBox | This method displays a message box. It may be used in scripting environments where there is no built-in function to display a message box, such as JScript. In Visual Basic Script the Windows Script Host supports the MsgBox function.
Public Method TabBackward | Execute the Shift+Tab key on the window to jump backward one element.
Public Method TabForward | Execute the Tab key on the window to jump forward one element.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property ButtonbarVisible | This property it True if the application toolbar, the lower toolbar within SAP GUI, is visible. Setting this property to False will hide the application toolbar.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property ElementVisualizationMode |
Public Property GuiFocus | The GuiFocus is the element within SAP GUI that currently has the focus. This may not be the same element as the one pointed to by SystemFocus. GuiFocus can be any element within SAP GUI, including elements that do not exist in the server model, such as toolbar buttons or the command field.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property Iconic | This property is True if the main window is currently minimized.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property StatusbarVisible |
Public Property SystemFocus | SystemFocus is the element within SAP GUI that has the focus from the server application's perspective. This may only be an element which exists in the server model, such as dynpro or list elements.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property TitlebarVisible | This property it True if the title bar is visible. Setting this property to False will hide the title bar.
Public Property ToolbarVisible | This property it True if the systen toolbar, the upper toolbar within SAP GUI, is visible. Setting this property to False will hide the system toolbar.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.
Public Property WorkingPaneHeight |
Public Property WorkingPaneWidth |

See Also

GuiMainWindow Overview


Close Method

Close Method

Description

Close the main window.

Syntax

Visual Basic
Public Sub Close()

See Also

GuiMainWindow Object


CompBitmap Method

CompBitmap Method
Filename1
Filename2

Syntax

Visual Basic
Public Function CompBitmap( _
   ByVal Filename1 As String, _
   ByVal Filename2 As String _
) As Long

Parameters

Filename1
Filename2

See Also

GuiMainWindow Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiMainWindow Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiMainWindow Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiMainWindow Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiMainWindow Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiMainWindow Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiMainWindow Object


HardCopy Method

HardCopy Method
Filename
Name of the file to which the hard copy should be written.
ImageType
xPos
yPos
nWidth
nHeight

Description

Create a hardcopy of the main window.

Syntax

Visual Basic
Public Function HardCopy( _
   ByVal Filename As String, _
   Optional ByVal ImageType As Variant, _
   Optional ByVal xPos As Variant, _
   Optional ByVal yPos As Variant, _
   Optional ByVal nWidth As Variant, _
   Optional ByVal nHeight As Variant _
) As String

Parameters

Filename
Name of the file to which the hard copy should be written.
ImageType
xPos
yPos
nWidth
nHeight

Remarks

Currently only BMP is supported as output format.

See Also

GuiMainWindow Object


HardCopyToMemory Method

HardCopyToMemory Method
See Also Example
ImageType

Description

Create a screenshot of SAP GUI and return it in a memory block to the caller.

Syntax

Visual Basic
Public Function HardCopyToMemory( _
   Optional ByVal ImageType As Variant _
) As Variant

Parameters

ImageType

Remarks

This method may be more efficient for users who do not want a file to be created on the local filesystem.

Example

Create a screenshot, return it as a memory block and write it to file in the script.
Hardcopy to Memory (Visual Basic) Copy Code
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

Image = session.findById("wnd[0]").HardCopyToMemory()

Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2

Dim BinaryStream
Set BinaryStream = CreateObject("ADODB.Stream")

BinaryStream.Type = adTypeBinary

BinaryStream.Open
BinaryStream.Write Image
BinaryStream.SaveToFile "C:\screenshot.bmp", adSaveCreateOverWrite

MsgBox "Done"

See Also

GuiMainWindow Object


Iconify Method

Iconify Method

Description

Collapse the main window to the minimized state.

Syntax

Visual Basic
Public Sub Iconify()

See Also

GuiMainWindow Object


IsVKeyAllowed Method

IsVKeyAllowed Method
VKey

Description

The method returns True if the given virtual key can be executed on the current screen.

Syntax

Visual Basic
Public Function IsVKeyAllowed( _
   ByVal VKey As Integer _
) As Byte

Parameters

VKey

Example

If F8 can be pressed on a given screen to execute a report, then the method IsVKeyAllowed(8) will return True.

See Also

GuiMainWindow Object


JumpBackward Method

JumpBackward Method

Description

Execute the Ctrl+Shift+Tab key on the window to jump backward one block.

Syntax

Visual Basic
Public Sub JumpBackward()

See Also

GuiMainWindow Object


JumpForward Method

JumpForward Method

Description

Execute the Ctrl+Tab key on the window to jump forward one block.

Syntax

Visual Basic
Public Sub JumpForward()

See Also

GuiMainWindow Object


Maximize Method

Maximize Method

Description

Maximize the main window.

Syntax

Visual Basic
Public Sub Maximize()

See Also

GuiMainWindow Object


ResizeWorkingPane Method

ResizeWorkingPane Method
Width
Height
ThrowOnFail
The throwOnFail parameter has been added for use in the SAP GUI for Java because some window managers may not support a program driven resize of a window.

Description

The ResizeWorkingPane function will resize the window so that the available working area has the given width and height in character metric.

Syntax

Visual Basic
Public Sub ResizeWorkingPane( _
   ByVal Width As Long, _
   ByVal Height As Long, _
   ByVal ThrowOnFail As Boolean _
)

Parameters

Width
Height
ThrowOnFail
The throwOnFail parameter has been added for use in the SAP GUI for Java because some window managers may not support a program driven resize of a window.

Remarks

A script may fail during playback if the size of the window differs from the size during recording. This becomes obvious when you compare the two screen shots below:

If the user selected ‘Two-Line List’ while recording a script and this line is not available during playback because the size of the window has been decreased, then the selection will fail.

This is because only the visible lines of the list are available on the client. Scrolling always requires a new set of data to be read from the server. This may not be the case for other elements of the user interface. For example, a line of the Grid View which will be discussed later is accessible even if it is not currently visible on the client.

See Also

GuiMainWindow Object


ResizeWorkingPaneEx Method

ResizeWorkingPaneEx Method
Width
Height
ThrowOnFail

Description

The ResizeWorkingPaneEx function will resize the window so that the available working area has the given width and height in pixels.

Syntax

Visual Basic
Public Sub ResizeWorkingPaneEx( _
   ByVal Width As Long, _
   ByVal Height As Long, _
   ByVal ThrowOnFail As Boolean _
)

Parameters

Width
Height
ThrowOnFail

Remarks

This method is only used during recording if the DWORD registry key ResizeWorkingPaneEx in patch HKCU\Software\SAP\SAPGUI Front\SAP Frontend Server\Scripting exists and has the value 1.

See Also

GuiMainWindow Object


Restore Method

Restore Method

Description

Restore the main window.

Syntax

Visual Basic
Public Sub Restore()

See Also

GuiMainWindow Object


SendVKey Method

SendVKey Method
VKey

Description

Send a virtual key to the system.

Syntax

Visual Basic
Public Sub SendVKey( _
   ByVal VKey As Integer _
)

Parameters

VKey

Remarks

Possible values for the VKey parameter can be found in the table GUI_FKEY.

VKey | Keyboard Combination
00 | Enter
01 | F1
02 | F2
03 | F3
04 | F4
05 | F5
06 | F6
07 | F7
08 | F8
09 | F9
10 | F10
11 | Ctrl+S
12 | F12
13 | Shift+F1
14 | Shift+F2
15 | Shift+F3
16 | Shift+F4
17 | Shift+F5
18 | Shift+F6
19 | Shift+F7
20 | Shift+F8
21 | Shift+F9
22 | Shift+Ctrl+0
23 | Shift+F11
24 | Shift+F12
25 | Ctrl+F1
26 | Ctrl+F2
27 | Ctrl+F3
28 | Ctrl+F4
29 | Ctrl+F5
30 | Ctrl+F6
31 | Ctrl+F7
32 | Ctrl+F8
33 | Ctrl+F9
34 | Ctrl+F10
35 | Ctrl+F11
36 | Ctrl+F12
37 | Ctrl+Shift+F1
38 | Ctrl+Shift+F2
39 | Ctrl+Shift+F3
40 | Ctrl+Shift+F4
41 | Ctrl+Shift+F5
42 | Ctrl+Shift+F6
43 | Ctrl+Shift+F7
44 | Ctrl+Shift+F8
45 | Ctrl+Shift+F9
46 | Ctrl+Shift+F10
47 | Ctrl+Shift+F11
48 | Ctrl+Shift+F12
70 | Ctrl+E
71 | Ctrl+F
72 | Ctrl+/
73 | Ctrl+\
74 | Ctrl+N
75 | Ctrl+O
76 | Ctrl+X
77 | Ctrl+C
78 | Ctrl+V
79 | Ctrl+Z
80 | Ctrl+PageUp
81 | PageUp
82 | PageDown
83 | Ctrl+PageDown
84 | Ctrl+G
85 | Ctrl+R
86 | Ctrl+P

See Also

GuiMainWindow Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiMainWindow Object


ShowMessageBox Method

ShowMessageBox Method
Title
Title of the message box.
Text
Text message in the message box.
MsgIcon
Value from the GuiMessageBoxType enumeration.
MsgType
Value from the GuiMessageBoxOption enumeration.

Description

This method displays a message box. It may be used in scripting environments where there is no built-in function to display a message box, such as JScript. In Visual Basic Script the Windows Script Host supports the MsgBox function.

Syntax

Visual Basic
Public Function ShowMessageBox( _
   ByVal Title As String, _
   ByVal Text As String, _
   ByVal MsgIcon As Long, _
   ByVal MsgType As Long _
) As Long

Parameters

Title
Title of the message box.
Text
Text message in the message box.
MsgIcon
Value from the GuiMessageBoxType enumeration.
MsgType
Value from the GuiMessageBoxOption enumeration.

See Also

GuiMainWindow Object


TabBackward Method

TabBackward Method

Description

Execute the Shift+Tab key on the window to jump backward one element.

Syntax

Visual Basic
Public Sub TabBackward()

See Also

GuiMainWindow Object


TabForward Method

TabForward Method

Description

Execute the Tab key on the window to jump forward one element.

Syntax

Visual Basic
Public Sub TabForward()

See Also

GuiMainWindow Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiMainWindow Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiMainWindow Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiMainWindow Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiMainWindow Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiMainWindow Object


ButtonbarVisible Property

ButtonbarVisible Property

Description

This property it True if the application toolbar, the lower toolbar within SAP GUI, is visible. Setting this property to False will hide the application toolbar.

Property type

Read-write property

Syntax

Visual Basic
Public Property ButtonbarVisible() As Byte

See Also

GuiMainWindow Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiMainWindow Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiMainWindow Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiMainWindow Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiMainWindow Object


ElementVisualizationMode Property

ElementVisualizationMode Property

Property type

Read-write property

Syntax

Visual Basic
Public Property ElementVisualizationMode() As Byte

See Also

GuiMainWindow Object


GuiFocus Property

GuiFocus Property

Description

The GuiFocus is the element within SAP GUI that currently has the focus. This may not be the same element as the one pointed to by SystemFocus.

GuiFocus can be any element within SAP GUI, including elements that do not exist in the server model, such as toolbar buttons or the command field.

Property type

Read-only property

Syntax

Visual Basic
Public Property GuiFocus() As GuiVComponent

See Also

GuiMainWindow Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiMainWindow Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiMainWindow Object


Iconic Property

Iconic Property

Description

This property is True if the main window is currently minimized.

Property type

Read-only property

Syntax

Visual Basic
Public Property Iconic() As Byte

See Also

GuiMainWindow Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiMainWindow Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiMainWindow Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiMainWindow Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiMainWindow Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiMainWindow Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiMainWindow Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiMainWindow Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiMainWindow Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiMainWindow Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiMainWindow Object


StatusbarVisible Property

StatusbarVisible Property

Property type

Read-write property

Syntax

Visual Basic
Public Property StatusbarVisible() As Byte

See Also

GuiMainWindow Object


SystemFocus Property

SystemFocus Property

Description

SystemFocus is the element within SAP GUI that has the focus from the server application's perspective. This may only be an element which exists in the server model, such as dynpro or list elements.

Property type

Read-only property

Syntax

Visual Basic
Public Property SystemFocus() As GuiVComponent

Remarks

It is possible for the SystemFocus to be on a dynpro element, while at the same time the GuiFocus is on the command field or a toolbar button, for example.

See Also

GuiMainWindow Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiMainWindow Object


TitlebarVisible Property

TitlebarVisible Property

Description

This property it True if the title bar is visible. Setting this property to False will hide the title bar.

Property type

Read-write property

Syntax

Visual Basic
Public Property TitlebarVisible() As Byte

Remarks

The title bar is only available in New Visual Design, not in Classic Design.

See Also

GuiMainWindow Object


ToolbarVisible Property

ToolbarVisible Property

Description

This property it True if the systen toolbar, the upper toolbar within SAP GUI, is visible. Setting this property to False will hide the system toolbar.

Property type

Read-write property

Syntax

Visual Basic
Public Property ToolbarVisible() As Byte

See Also

GuiMainWindow Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiMainWindow Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiMainWindow Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiMainWindow Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiMainWindow Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiMainWindow Object


WorkingPaneHeight Property

WorkingPaneHeight Property

Property type

Read-only property

Syntax

Visual Basic
Public Property WorkingPaneHeight() As Long

See Also

GuiMainWindow Object


WorkingPaneWidth Property

WorkingPaneWidth Property

Property type

Read-only property

Syntax

Visual Basic
Public Property WorkingPaneWidth() As Long

See Also

GuiMainWindow Object


GuiMap Object

GuiMap Object
See Also Members

Description

For the map control only basic members from GuiShell are available. Recording and playback is not possible.

Object Model

See Also

GuiMap Members


GuiMap Object Members

GuiMap Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiMap Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiMap Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiMap Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiMap Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiMap Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiMap Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiMap Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiMap Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiMap Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiMap Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiMap Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiMap Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiMap Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiMap Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiMap Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiMap Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiMap Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiMap Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiMap Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiMap Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiMap Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiMap Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiMap Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiMap Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiMap Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiMap Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiMap Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiMap Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiMap Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiMap Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiMap Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiMap Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiMap Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiMap Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiMap Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiMap Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiMap Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiMap Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiMap Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiMap Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiMap Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiMap Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiMap Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiMap Object


GuiMenu Object

GuiMenu Object
See Also Members

Description

A GuiMenu may have other GuiMenu objects as children. GuiMenu extends GuiVContainer. The type prefix is menu, the name is the text of the menu item. If the item does not have a text, which is the case for separators, then the name is the last part of the id, menu[n].

Object Model

See Also

GuiMenu Members


GuiMenu Object Members

GuiMenu Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method Select | Select the menu.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiMenu Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiMenu Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiMenu Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiMenu Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiMenu Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiMenu Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiMenu Object


Select Method

Select Method

Description

Select the menu.

Syntax

Visual Basic
Public Sub Select()

See Also

GuiMenu Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiMenu Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiMenu Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiMenu Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiMenu Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiMenu Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiMenu Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiMenu Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiMenu Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiMenu Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiMenu Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiMenu Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiMenu Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiMenu Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiMenu Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiMenu Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiMenu Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiMenu Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiMenu Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiMenu Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiMenu Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiMenu Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiMenu Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiMenu Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiMenu Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiMenu Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiMenu Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiMenu Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiMenu Object


GuiMenubar Object

GuiMenubar Object
See Also Members

Description

Only the main window has a menubar. The children of the menubar are menus. GuiMenubar extends GuiVContainer. The type prefix and name are mbar.

Object Model

See Also

GuiMenubar Members


GuiMenubar Object Members

GuiMenubar Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiMenubar Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiMenubar Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiMenubar Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiMenubar Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiMenubar Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiMenubar Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiMenubar Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiMenubar Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiMenubar Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiMenubar Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiMenubar Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiMenubar Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiMenubar Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiMenubar Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiMenubar Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiMenubar Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiMenubar Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiMenubar Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiMenubar Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiMenubar Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiMenubar Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiMenubar Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiMenubar Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiMenubar Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiMenubar Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiMenubar Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiMenubar Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiMenubar Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiMenubar Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiMenubar Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiMenubar Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiMenubar Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiMenubar Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiMenubar Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiMenubar Object


GuiMessageWindow Object

GuiMessageWindow Object
See Also Members

Object Model

See Also

GuiMessageWindow Members


GuiMessageWindow Object Members

GuiMessageWindow Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property FocusedButton |
Public Property Height | Height of the component in pixels.
Public Property HelpButtonHelpText |
Public Property HelpButtonText |
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property MessageText |
Public Property MessageType |
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OKButtonHelpText |
Public Property OKButtonText |
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Visible |
Public Property Width | Width of the component in pixels.

See Also

GuiMessageWindow Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiMessageWindow Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiMessageWindow Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiMessageWindow Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiMessageWindow Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiMessageWindow Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiMessageWindow Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiMessageWindow Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiMessageWindow Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiMessageWindow Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiMessageWindow Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiMessageWindow Object


FocusedButton Property

FocusedButton Property

Property type

Read-write property

Syntax

Visual Basic
Public Property FocusedButton() As Long

See Also

GuiMessageWindow Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiMessageWindow Object


HelpButtonHelpText Property

HelpButtonHelpText Property

Property type

Read-write property

Syntax

Visual Basic
Public Property HelpButtonHelpText() As String

See Also

GuiMessageWindow Object


HelpButtonText Property

HelpButtonText Property

Property type

Read-write property

Syntax

Visual Basic
Public Property HelpButtonText() As String

See Also

GuiMessageWindow Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiMessageWindow Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiMessageWindow Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiMessageWindow Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiMessageWindow Object


MessageText Property

MessageText Property

Property type

Read-write property

Syntax

Visual Basic
Public Property MessageText() As String

See Also

GuiMessageWindow Object


MessageType Property

MessageType Property

Property type

Read-write property

Syntax

Visual Basic
Public Property MessageType() As Long

See Also

GuiMessageWindow Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiMessageWindow Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiMessageWindow Object


OKButtonHelpText Property

OKButtonHelpText Property

Property type

Read-write property

Syntax

Visual Basic
Public Property OKButtonHelpText() As String

See Also

GuiMessageWindow Object


OKButtonText Property

OKButtonText Property

Property type

Read-write property

Syntax

Visual Basic
Public Property OKButtonText() As String

See Also

GuiMessageWindow Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiMessageWindow Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiMessageWindow Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiMessageWindow Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiMessageWindow Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiMessageWindow Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiMessageWindow Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiMessageWindow Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiMessageWindow Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiMessageWindow Object


Visible Property

Visible Property

Property type

Read-write property

Syntax

Visual Basic
Public Property Visible() As Byte

See Also

GuiMessageWindow Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiMessageWindow Object


GuiModalWindow Object

GuiModalWindow Object
See Also Members

Description

A GuiModalWindow is a dialog pop-up.

GuiModalWindow extends GuiFrameWindow.

Object Model

See Also

GuiModalWindow Members


GuiModalWindow Object Members

GuiModalWindow Object Members
See Also Overview

Public Methods

Public Method Close |
Public Method CompBitmap |
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method HardCopy |
Public Method HardCopyToMemory |
Public Method Iconify |
Public Method IsVKeyAllowed |
Public Method JumpBackward | Execute the Ctrl+Shift+Tab key on the window to jump backward one block.
Public Method JumpForward | Execute the Ctrl+Tab key on the window to jump forward one block.
Public Method Maximize |
Public Method Restore |
Public Method SendVKey |
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowMessageBox |
Public Method TabBackward | Execute the Shift+Tab key on the window to jump backward one element.
Public Method TabForward | Execute the Tab key on the window to jump forward one element.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property ElementVisualizationMode
Public Property GuiFocus
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property Iconic
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsPopupDialog Some modal windows represent popup dialogs. In this case the IsPopupDialog property is True. Popup dialogs are identified by checking the ABAP source name and dynpro number.

Currently the following are supported:

  • SAPLSPO1 / 500 (Function module Popup_To_Confirm)
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property PopupDialogText
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SystemFocus
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.
Public Property WorkingPaneHeight
Public Property WorkingPaneWidth

See Also

GuiModalWindow Overview


Close Method

Close Method

Syntax

Visual Basic
Public Sub Close()

See Also

GuiModalWindow Object


CompBitmap Method

CompBitmap Method
Filename1
Filename2

Syntax

Visual Basic
Public Function CompBitmap( _
   ByVal Filename1 As String, _
   ByVal Filename2 As String _
) As Long

Parameters

Filename1
Filename2

See Also

GuiModalWindow Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiModalWindow Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiModalWindow Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiModalWindow Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiModalWindow Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiModalWindow Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiModalWindow Object


HardCopy Method

HardCopy Method
Filename
ImageType
xPos
yPos
nWidth
nHeight

Syntax

Visual Basic
Public Function HardCopy( _
   ByVal Filename As String, _
   Optional ByVal ImageType As Variant, _
   Optional ByVal xPos As Variant, _
   Optional ByVal yPos As Variant, _
   Optional ByVal nWidth As Variant, _
   Optional ByVal nHeight As Variant _
) As String

Parameters

Filename
ImageType
xPos
yPos
nWidth
nHeight

See Also

GuiModalWindow Object


HardCopyToMemory Method

HardCopyToMemory Method
ImageType

Syntax

Visual Basic
Public Function HardCopyToMemory( _
   Optional ByVal ImageType As Variant _
) As Variant

Parameters

ImageType

See Also

GuiModalWindow Object


Iconify Method

Iconify Method

Syntax

Visual Basic
Public Sub Iconify()

See Also

GuiModalWindow Object


IsVKeyAllowed Method

IsVKeyAllowed Method
VKey

Syntax

Visual Basic
Public Function IsVKeyAllowed( _
   ByVal VKey As Integer _
) As Byte

Parameters

VKey

See Also

GuiModalWindow Object


JumpBackward Method

JumpBackward Method

Description

Execute the Ctrl+Shift+Tab key on the window to jump backward one block.

Syntax

Visual Basic
Public Sub JumpBackward()

See Also

GuiModalWindow Object


JumpForward Method

JumpForward Method

Description

Execute the Ctrl+Tab key on the window to jump forward one block.

Syntax

Visual Basic
Public Sub JumpForward()

See Also

GuiModalWindow Object


Maximize Method

Maximize Method

Syntax

Visual Basic
Public Sub Maximize()

See Also

GuiModalWindow Object


Restore Method

Restore Method

Syntax

Visual Basic
Public Sub Restore()

See Also

GuiModalWindow Object


SendVKey Method

SendVKey Method
VKey

Syntax

Visual Basic
Public Sub SendVKey( _
   ByVal VKey As Integer _
)

Parameters

VKey

See Also

GuiModalWindow Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiModalWindow Object


ShowMessageBox Method

ShowMessageBox Method
Title
Text
MsgIcon
MsgType

Syntax

Visual Basic
Public Function ShowMessageBox( _
   ByVal Title As String, _
   ByVal Text As String, _
   ByVal MsgIcon As Long, _
   ByVal MsgType As Long _
) As Long

Parameters

Title
Text
MsgIcon
MsgType

See Also

GuiModalWindow Object


TabBackward Method

TabBackward Method

Description

Execute the Shift+Tab key on the window to jump backward one element.

Syntax

Visual Basic
Public Sub TabBackward()

See Also

GuiModalWindow Object


TabForward Method

TabForward Method

Description

Execute the Tab key on the window to jump forward one element.

Syntax

Visual Basic
Public Sub TabForward()

See Also

GuiModalWindow Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiModalWindow Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiModalWindow Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiModalWindow Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiModalWindow Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiModalWindow Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiModalWindow Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiModalWindow Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiModalWindow Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiModalWindow Object


ElementVisualizationMode Property

ElementVisualizationMode Property

Property type

Read-write property

Syntax

Visual Basic
Public Property ElementVisualizationMode() As Byte

See Also

GuiModalWindow Object


GuiFocus Property

GuiFocus Property

Property type

Read-only property

Syntax

Visual Basic
Public Property GuiFocus() As GuiVComponent

See Also

GuiModalWindow Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiModalWindow Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiModalWindow Object


Iconic Property

Iconic Property

Property type

Read-only property

Syntax

Visual Basic
Public Property Iconic() As Byte

See Also

GuiModalWindow Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiModalWindow Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiModalWindow Object


IsPopupDialog Property

IsPopupDialog Property

Description

Some modal windows represent popup dialogs. In this case the IsPopupDialog property is True. Popup dialogs are identified by checking the ABAP source name and dynpro number.

Currently the following are supported:

  • SAPLSPO1 / 500 (Function module Popup_To_Confirm)

Property type

Read-write property

Syntax

Visual Basic
Public Property IsPopupDialog() As Byte

See Also

GuiModalWindow Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiModalWindow Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiModalWindow Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiModalWindow Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiModalWindow Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiModalWindow Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiModalWindow Object


PopupDialogText Property

PopupDialogText Property

Property type

Read-write property

Syntax

Visual Basic
Public Property PopupDialogText() As String

See Also

GuiModalWindow Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiModalWindow Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiModalWindow Object


SystemFocus Property

SystemFocus Property

Property type

Read-only property

Syntax

Visual Basic
Public Property SystemFocus() As GuiVComponent

See Also

GuiModalWindow Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiModalWindow Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiModalWindow Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiModalWindow Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiModalWindow Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiModalWindow Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiModalWindow Object


WorkingPaneHeight Property

WorkingPaneHeight Property

Property type

Read-only property

Syntax

Visual Basic
Public Property WorkingPaneHeight() As Long

See Also

GuiModalWindow Object


WorkingPaneWidth Property

WorkingPaneWidth Property

Property type

Read-only property

Syntax

Visual Basic
Public Property WorkingPaneWidth() As Long

See Also

GuiModalWindow Object


GuiNetChart Object

GuiNetChart Object
See Also Members

Description

The GuiNetChart is a powerful tool to display and modify entity relationship diagrams. It is of a very technical nature and shoud only be used for recording and playback, as most of the parameters can not be determined in any other way.

Object Model

Example

See Also

GuiNetChart Members


GuiNetChart Object Members

GuiNetChart Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method GetLinkContent | Returns the content of the link.
Public Method GetNodeContent | Returns the content of the node.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SendData | This function emulates the output of each action triggered at the control side. The result of the action is sent to the server. It’s currently not possible to select – deselect single objects at the client-side and to replay/script these “local” actions.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property LinkCount | Number of links in the net.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property NodeCount | Number of Nodes in the net.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “sapnetz”
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiNetChart Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiNetChart Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiNetChart Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiNetChart Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiNetChart Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiNetChart Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiNetChart Object


GetLinkContent Method

GetLinkContent Method
linkId
Index of the link.
textId
Internal value, do be determined during recording.

Description

Returns the content of the link.

Syntax

Visual Basic
Public Function GetLinkContent( _
   ByVal linkId As Long, _
   ByVal textId As Long _
) As String

Parameters

linkId
Index of the link.
textId
Internal value, do be determined during recording.

See Also

GuiNetChart Object


GetNodeContent Method

GetNodeContent Method
nodeId
Index of the node.
textId
Internal value, do be determined during recording.

Description

Returns the content of the node.

Syntax

Visual Basic
Public Function GetNodeContent( _
   ByVal nodeId As Long, _
   ByVal textId As Long _
) As String

Parameters

nodeId
Index of the node.
textId
Internal value, do be determined during recording.

See Also

GuiNetChart Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiNetChart Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiNetChart Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiNetChart Object


SendData Method

SendData Method
Data
Internal data stream. To be determined during recording.

Description

This function emulates the output of each action triggered at the control side. The result of the action is sent to the server.

It’s currently not possible to select – deselect single objects at the client-side and to replay/script these “local” actions.

Syntax

Visual Basic
Public Sub SendData( _
   ByVal Data As String _
)

Parameters

Data
Internal data stream. To be determined during recording.

See Also

GuiNetChart Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiNetChart Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiNetChart Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiNetChart Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiNetChart Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiNetChart Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiNetChart Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiNetChart Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiNetChart Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiNetChart Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiNetChart Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiNetChart Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiNetChart Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiNetChart Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiNetChart Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiNetChart Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiNetChart Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiNetChart Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiNetChart Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiNetChart Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiNetChart Object


LinkCount Property

LinkCount Property

Description

Number of links in the net.

Property type

Read-only property

Syntax

Visual Basic
Public Property LinkCount() As Long

See Also

GuiNetChart Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiNetChart Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiNetChart Object


NodeCount Property

NodeCount Property

Description

Number of Nodes in the net.

Property type

Read-only property

Syntax

Visual Basic
Public Property NodeCount() As Long

See Also

GuiNetChart Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiNetChart Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiNetChart Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiNetChart Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiNetChart Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiNetChart Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “sapnetz”

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiNetChart Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiNetChart Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiNetChart Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiNetChart Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiNetChart Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiNetChart Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiNetChart Object


GuiOfficeIntegration Object

GuiOfficeIntegration Object
See Also Members

Object Model

See Also

GuiOfficeIntegration Members


GuiOfficeIntegration Object Members

GuiOfficeIntegration Object Members
See Also Overview

Public Methods

Public Method AppendRow | This function appends a new row to a table specified by the parameter name in the table collection. The parameter row is the base64 representation of the binary row.
Public Method CloseDocument | This function sends the close event of the document specified by the parameter cookie to the server.
Public Method CustomEvent | This function sends the custom event eventName to the server. The document specified by the parameter cookie is the source.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method RemoveContent | This function removes the content of a table in the table collection. The parameter name is the name of the table.
Public Method SaveDocument | This function sends the save event of the document specified by the parameter cookie to the server.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetDocument | This function replaces or adds a new document with the specified index. The parameter document is the base64-representation of the binary document.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Document |
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property HostedApplication |
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “OfficeIntegration”.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiOfficeIntegration Overview


AppendRow Method

AppendRow Method
Name
Row

Description

This function appends a new row to a table specified by the parameter name in the table collection. The parameter row is the base64 representation of the binary row.

Syntax

Visual Basic
Public Sub AppendRow( _
   ByVal Name As String, _
   ByVal Row As String _
)

Parameters

Name
Row

See Also

GuiOfficeIntegration Object


CloseDocument Method

CloseDocument Method
Cookie
EverChanged
ChangedAfterSave

Description

This function sends the close event of the document specified by the parameter cookie to the server.

Syntax

Visual Basic
Public Sub CloseDocument( _
   ByVal Cookie As Long, _
   ByVal EverChanged As Byte, _
   ByVal ChangedAfterSave As Byte _
)

Parameters

Cookie
EverChanged
ChangedAfterSave

See Also

GuiOfficeIntegration Object


CustomEvent Method

CustomEvent Method
Cookie
EventName
ParamCount
Par1
Par2
Par3
Par4
Par5
Par6
Par7
Par8
Par9
Par10
Par11
Par12

Description

This function sends the custom event eventName to the server. The document specified by the parameter cookie is the source.

Syntax

Visual Basic
Public Sub CustomEvent( _
   ByVal Cookie As Long, _
   ByVal EventName As String, _
   ByVal ParamCount As Long, _
   Optional ByVal Par1 As Variant, _
   Optional ByVal Par2 As Variant, _
   Optional ByVal Par3 As Variant, _
   Optional ByVal Par4 As Variant, _
   Optional ByVal Par5 As Variant, _
   Optional ByVal Par6 As Variant, _
   Optional ByVal Par7 As Variant, _
   Optional ByVal Par8 As Variant, _
   Optional ByVal Par9 As Variant, _
   Optional ByVal Par10 As Variant, _
   Optional ByVal Par11 As Variant, _
   Optional ByVal Par12 As Variant _
)

Parameters

Cookie
EventName
ParamCount
Par1
Par2
Par3
Par4
Par5
Par6
Par7
Par8
Par9
Par10
Par11
Par12

See Also

GuiOfficeIntegration Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiOfficeIntegration Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiOfficeIntegration Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiOfficeIntegration Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiOfficeIntegration Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiOfficeIntegration Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiOfficeIntegration Object


RemoveContent Method

RemoveContent Method
Name

Description

This function removes the content of a table in the table collection. The parameter name is the name of the table.

Syntax

Visual Basic
Public Sub RemoveContent( _
   ByVal Name As String _
)

Parameters

Name

See Also

GuiOfficeIntegration Object


SaveDocument Method

SaveDocument Method
Cookie
Changed

Description

This function sends the save event of the document specified by the parameter cookie to the server.

Syntax

Visual Basic
Public Sub SaveDocument( _
   ByVal Cookie As Long, _
   ByVal Changed As Byte _
)

Parameters

Cookie
Changed

See Also

GuiOfficeIntegration Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiOfficeIntegration Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiOfficeIntegration Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiOfficeIntegration Object


SetDocument Method

SetDocument Method
Index
Document

Description

This function replaces or adds a new document with the specified index. The parameter document is the base64-representation of the binary document.

Syntax

Visual Basic
Public Sub SetDocument( _
   ByVal Index As Long, _
   ByVal Document As String _
)

Parameters

Index
Document

See Also

GuiOfficeIntegration Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiOfficeIntegration Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiOfficeIntegration Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiOfficeIntegration Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiOfficeIntegration Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiOfficeIntegration Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiOfficeIntegration Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiOfficeIntegration Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiOfficeIntegration Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiOfficeIntegration Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiOfficeIntegration Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiOfficeIntegration Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiOfficeIntegration Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiOfficeIntegration Object


Document Property

Document Property

Property type

Read-only property

Syntax

Visual Basic
Public Property Document() As Object

See Also

GuiOfficeIntegration Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiOfficeIntegration Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiOfficeIntegration Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiOfficeIntegration Object


HostedApplication Property

HostedApplication Property

Property type

Read-only property

Syntax

Visual Basic
Public Property HostedApplication() As Long

See Also

GuiOfficeIntegration Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiOfficeIntegration Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiOfficeIntegration Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiOfficeIntegration Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiOfficeIntegration Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiOfficeIntegration Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiOfficeIntegration Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiOfficeIntegration Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiOfficeIntegration Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiOfficeIntegration Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiOfficeIntegration Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiOfficeIntegration Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “OfficeIntegration”.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiOfficeIntegration Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiOfficeIntegration Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiOfficeIntegration Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiOfficeIntegration Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiOfficeIntegration Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiOfficeIntegration Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiOfficeIntegration Object


GuiOkCodeField Object

GuiOkCodeField Object
See Also Members

Description

The GuiOkCodeField is placed on the upper toolbar of the main window. It is a combo box into which commands can be entered. Setting the text of GuiOkCodeField will not execute the command until server communication is started, for example by emulating the Enter key (VKey 0). GuiOkCodeField extends GuiVComponent. The type prefix is okcd, the name is empty.

Object Model

Example

See Also

GuiOkCodeField Members


GuiOkCodeField Object Members

GuiOkCodeField Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method PressF1 | Emulate pressing the F1 key while the focus is on the GuiOkCodeField.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Opened | In New Visual Design the GuiOkCodeField can be collapsed using the arrow button to the right of it.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiOkCodeField Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiOkCodeField Object


PressF1 Method

PressF1 Method

Description

Emulate pressing the F1 key while the focus is on the GuiOkCodeField.

Syntax

Visual Basic
Public Sub PressF1()

See Also

GuiOkCodeField Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiOkCodeField Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiOkCodeField Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiOkCodeField Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiOkCodeField Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiOkCodeField Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiOkCodeField Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiOkCodeField Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiOkCodeField Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiOkCodeField Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiOkCodeField Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiOkCodeField Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiOkCodeField Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiOkCodeField Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiOkCodeField Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiOkCodeField Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiOkCodeField Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiOkCodeField Object


Opened Property

Opened Property

Description

In New Visual Design the GuiOkCodeField can be collapsed using the arrow button to the right of it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Opened() As Byte

Example

Open:

Closed:

See Also

GuiOkCodeField Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiOkCodeField Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiOkCodeField Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiOkCodeField Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiOkCodeField Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiOkCodeField Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiOkCodeField Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiOkCodeField Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiOkCodeField Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiOkCodeField Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiOkCodeField Object


GuiPasswordField Object

GuiPasswordField Object
See Also Members

Description

The only difference between GuiTextField and GuiPasswordField is that the Text property can not be read for a password field. The returned text is always empty. GuiPasswordField extends GuiTextField. The type prefix is pwd, the name is the fieldname taken from the SAP data dictionary.

Object Model

See Also

GuiPasswordField Members


GuiPasswordField Object Members

GuiPasswordField Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property CaretPosition | Position of the text caret in the input field.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DisplayedText | This property contains the text as it is displayed on the screen, including preceding or trailing blanks. These blanks are stripped from the text property.
Public Property Height | Height of the component in pixels.
Public Property Highlighted | This property is True if the Highlighted flag is set in the screen painter for the dynpro element.
Public Property HistoryCurEntry | Text of the currently focussed entry in the history list box.
Public Property HistoryCurIndex | Currently focussed index in the history dropdown list box.
Public Property HistoryIsActive | This property is True if the local input field history drop down is currently open.
Public Property HistoryList | List of entries in the local history list box.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsHotspot | Dynpro elements such as labels may be configured to cause a round trip when they are clicked. In that case the mouse cursor changes to the hand shape. This is called a hot spot.
Public Property IsLeftLabel | This property is True if the component has the 'assign left' flag.
Public Property IsOField | OField is a special ABAP dynpro element, the Output Field. These fields can be set programmatically to a value at runtime. In this respect they differ from labels. However they can not be used to enter data, so they are not input fields.
Public Property IsRightLabel | This property is True if the component has the 'assign right' flag.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property LeftLabel | Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.
Public Property MaxLength | Maximum length of the input field in number of characters.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Numerical | This property is True if the component is an input field that only accepts numeric characters.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property Required | This property is True if the component is a required value for the screen.
Public Property RightLabel | Right label of the component. This property is set in screenpainter using the 'assign right' flag.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiPasswordField Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiPasswordField Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiPasswordField Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiPasswordField Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiPasswordField Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiPasswordField Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiPasswordField Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiPasswordField Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiPasswordField Object


CaretPosition Property

CaretPosition Property

Description

Position of the text caret in the input field.

Property type

Read-write property

Syntax

Visual Basic
Public Property CaretPosition() As Long

See Also

GuiPasswordField Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiPasswordField Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiPasswordField Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiPasswordField Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiPasswordField Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiPasswordField Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiPasswordField Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiPasswordField Object


DisplayedText Property

DisplayedText Property

Description

This property contains the text as it is displayed on the screen, including preceding or trailing blanks. These blanks are stripped from the text property.

Property type

Read-only property

Syntax

Visual Basic
Public Property DisplayedText() As String

See Also

GuiPasswordField Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiPasswordField Object


Highlighted Property

Highlighted Property

Description

This property is True if the Highlighted flag is set in the screen painter for the dynpro element.

Property type

Read-only property

Syntax

Visual Basic
Public Property Highlighted() As Byte

See Also

GuiPasswordField Object


HistoryCurEntry Property

HistoryCurEntry Property

Description

Text of the currently focussed entry in the history list box.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryCurEntry() As String

See Also

GuiPasswordField Object


HistoryCurIndex Property

HistoryCurIndex Property

Description

Currently focussed index in the history dropdown list box.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryCurIndex() As Long

See Also

GuiPasswordField Object


HistoryIsActive Property

HistoryIsActive Property

Description

This property is True if the local input field history drop down is currently open.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryIsActive() As Byte

See Also

GuiPasswordField Object


HistoryList Property

HistoryList Property

Description

List of entries in the local history list box.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryList() As GuiCollection

See Also

GuiPasswordField Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiPasswordField Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiPasswordField Object


IsHotspot Property

IsHotspot Property

Description

Dynpro elements such as labels may be configured to cause a round trip when they are clicked. In that case the mouse cursor changes to the hand shape. This is called a hot spot.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsHotspot() As Byte

See Also

GuiPasswordField Object


IsLeftLabel Property

IsLeftLabel Property

Description

This property is True if the component has the 'assign left' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsLeftLabel() As Byte

See Also

GuiPasswordField Object


IsOField Property

IsOField Property

Description

OField is a special ABAP dynpro element, the Output Field. These fields can be set programmatically to a value at runtime. In this respect they differ from labels. However they can not be used to enter data, so they are not input fields.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsOField() As Byte

See Also

GuiPasswordField Object


IsRightLabel Property

IsRightLabel Property

Description

This property is True if the component has the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsRightLabel() As Byte

See Also

GuiPasswordField Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiPasswordField Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiPasswordField Object


LeftLabel Property

LeftLabel Property

Description

Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.

Property type

Read-only property

Syntax

Visual Basic
Public Property LeftLabel() As GuiVComponent

See Also

GuiPasswordField Object


MaxLength Property

MaxLength Property

Description

Maximum length of the input field in number of characters.

Property type

Read-only property

Syntax

Visual Basic
Public Property MaxLength() As Long

See Also

GuiPasswordField Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiPasswordField Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiPasswordField Object


Numerical Property

Numerical Property

Description

This property is True if the component is an input field that only accepts numeric characters.

Property type

Read-only property

Syntax

Visual Basic
Public Property Numerical() As Byte

See Also

GuiPasswordField Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiPasswordField Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiPasswordField Object


Required Property

Required Property

Description

This property is True if the component is a required value for the screen.

Property type

Read-only property

Syntax

Visual Basic
Public Property Required() As Byte

See Also

GuiPasswordField Object


RightLabel Property

RightLabel Property

Description

Right label of the component. This property is set in screenpainter using the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property RightLabel() As GuiVComponent

See Also

GuiPasswordField Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiPasswordField Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiPasswordField Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiPasswordField Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiPasswordField Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiPasswordField Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiPasswordField Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiPasswordField Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiPasswordField Object


GuiPicture Object

GuiPicture Object
See Also Members

Description

The picture control displays a picture on a SAP GUI screen. GuiPicture extends GuiShell.

Object Model

Example

See Also

GuiPicture Members


GuiPicture Object Members

GuiPicture Object Members
See Also Overview

Public Methods

Public Method Click | This function emulates a single mouse click on a picture.
Public Method ClickControlArea | The function emulates a click on a given position. The coordinates should be given in pixels with respect to the picture control as it is displayed on the screen.
Public Method ClickPictureArea | The function emulates a click on a given position. The coordinates should be given in pixels with respect to the original picture file. They may differ from the pixel coordinates of the displayed picture because of scaling.
Public Method ContextMenu | The function opens a context menu on the given position. The coordinates should be given in pixels with respect to the picture control as it is displayed on the screen.
Public Method DoubleClick | This function emulates a double click on a picture.
Public Method DoubleClickControlArea | The function emulates a double click on a given position. The coordinates should be given in pixels with respect to the picture control as it is displayed on the screen.
Public Method DoubleClickPictureArea | The function emulates a double click on a given position. The coordinates should be given in pixels with respect to the original picture file. They may differ from the pixel coordinates of the displayed picture because of scaling.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property AltText
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DisplayMode Possible values of this property are:
  • ”Normal”: This value indicated that the picture is shown in its original size. If the picture’s size is larger than the size of the control, the control provides scrollbars. If the picture’s size is smaller than the size of the control, the picture is shown in the upper left corner of the control.
  • “Stretch”: The picture is resized in a way that it always occupies the complete area of the control.
  • “Fit”: The picture is resized on way that it fits into the control area without havin the need to show scrollbars. In contrast to “Strech” the mode “Fit” preserves the ratio of width and height of the picture.
  • “NormalCenter”: Like “Normal” except that the picture is not shown in the upper left corner but in the center of the control.
  • “FitCenter”: Like “Fit” except that the picture is not shown in the upper left corner but in the center of the control.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property Icon | Returns the SAPGUI icon code (e.g. “@01@”) of the displayed icon. If no icon is displayed, the property contains an empty string.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Picture”
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Url | Returns the URL of the displayed picture. If an icon is displayed (see property “icon”), the property contains an empty string. Depending in the application that used the control the URL may contain temporary URL parts (e.g. UUIDs).
Public Property Width | Width of the component in pixels.

See Also

GuiPicture Overview


Click Method

Click Method

Description

This function emulates a single mouse click on a picture.

Syntax

Visual Basic
Public Sub Click()

See Also

GuiPicture Object


ClickControlArea Method

ClickControlArea Method
x
y

Description

The function emulates a click on a given position. The coordinates should be given in pixels with respect to the picture control as it is displayed on the screen.

Syntax

Visual Basic
Public Sub ClickControlArea( _
   ByVal x As Long, _
   ByVal y As Long _
)

Parameters

x
y

See Also

GuiPicture Object


ClickPictureArea Method

ClickPictureArea Method
x
y

Description

The function emulates a click on a given position. The coordinates should be given in pixels with respect to the original picture file. They may differ from the pixel coordinates of the displayed picture because of scaling.

Syntax

Visual Basic
Public Sub ClickPictureArea( _
   ByVal x As Long, _
   ByVal y As Long _
)

Parameters

x
y

See Also

GuiPicture Object


ContextMenu Method

ContextMenu Method
x
y

Description

The function opens a context menu on the given position. The coordinates should be given in pixels with respect to the picture control as it is displayed on the screen.

Syntax

Visual Basic
Public Sub ContextMenu( _
   ByVal x As Long, _
   ByVal y As Long _
)

Parameters

x
y

See Also

GuiPicture Object


DoubleClick Method

DoubleClick Method

Description

This function emulates a double click on a picture.

Syntax

Visual Basic
Public Sub DoubleClick()

See Also

GuiPicture Object


DoubleClickControlArea Method

DoubleClickControlArea Method
x
y

Description

The function emulates a double click on a given position. The coordinates should be given in pixels with respect to the picture control as it is displayed on the screen.

Syntax

Visual Basic
Public Sub DoubleClickControlArea( _
   ByVal x As Long, _
   ByVal y As Long _
)

Parameters

x
y

See Also

GuiPicture Object


DoubleClickPictureArea Method

DoubleClickPictureArea Method
x
y

Description

The function emulates a double click on a given position. The coordinates should be given in pixels with respect to the original picture file. They may differ from the pixel coordinates of the displayed picture because of scaling.

Syntax

Visual Basic
Public Sub DoubleClickPictureArea( _
   ByVal x As Long, _
   ByVal y As Long _
)

Parameters

x
y

See Also

GuiPicture Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiPicture Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiPicture Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiPicture Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiPicture Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiPicture Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiPicture Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiPicture Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiPicture Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiPicture Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiPicture Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiPicture Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiPicture Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiPicture Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiPicture Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiPicture Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiPicture Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiPicture Object


AltText Property

AltText Property

Property type

Read-only property

Syntax

Visual Basic
Public Property AltText() As String

See Also

GuiPicture Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiPicture Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiPicture Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiPicture Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiPicture Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiPicture Object


DisplayMode Property

DisplayMode Property

Description

Possible values of this property are:

  • ”Normal”: This value indicated that the picture is shown in its original size. If the picture’s size is larger than the size of the control, the control provides scrollbars. If the picture’s size is smaller than the size of the control, the picture is shown in the upper left corner of the control.
  • “Stretch”: The picture is resized in a way that it always occupies the complete area of the control.
  • “Fit”: The picture is resized on way that it fits into the control area without havin the need to show scrollbars. In contrast to “Strech” the mode “Fit” preserves the ratio of width and height of the picture.
  • “NormalCenter”: Like “Normal” except that the picture is not shown in the upper left corner but in the center of the control.
  • “FitCenter”: Like “Fit” except that the picture is not shown in the upper left corner but in the center of the control.

Property type

Read-only property

Syntax

Visual Basic
Public Property DisplayMode() As String

See Also

GuiPicture Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiPicture Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiPicture Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiPicture Object


Icon Property

Icon Property

Description

Returns the SAPGUI icon code (e.g. “@01@”) of the displayed icon. If no icon is displayed, the property contains an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property Icon() As String

See Also

GuiPicture Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiPicture Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiPicture Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiPicture Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiPicture Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiPicture Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiPicture Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiPicture Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiPicture Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiPicture Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiPicture Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiPicture Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Picture”

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiPicture Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiPicture Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiPicture Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiPicture Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiPicture Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiPicture Object


Url Property

Url Property

Description

Returns the URL of the displayed picture. If an icon is displayed (see property “icon”), the property contains an empty string. Depending in the application that used the control the URL may contain temporary URL parts (e.g. UUIDs).

Property type

Read-only property

Syntax

Visual Basic
Public Property Url() As String

See Also

GuiPicture Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiPicture Object


GuiRadioButton Object

GuiRadioButton Object
See Also Members

Description

GuiRadioButton extends GuiVComponent. The type prefix is rad, the name is the fieldname taken from the SAP data dictionary.

Object Model

See Also

GuiRadioButton Members


GuiRadioButton Object Members

GuiRadioButton Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method Select | Selecting a radio button automatically deselects all the other buttons within that group. This may cause a server roundtrip, depending on the definition of the button in the screen painter.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Flushing | Some components such as radio buttons or check boxes may cause a round trip when their value is changed. If this is the case, the Flushing property is True.
Public Property GroupCount |
Public Property GroupMembers |
Public Property GroupPos |
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsLeftLabel | This property is True if the component has the 'assign left' flag.
Public Property IsRightLabel | This property is True if the component has the 'assign right' flag.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property LeftLabel | Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property RightLabel | Right label of the component. This property is set in screenpainter using the 'assign right' flag.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Selected | This property is True if the radio button is selected.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiRadioButton Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiRadioButton Object


Select Method

Select Method

Description

Selecting a radio button automatically deselects all the other buttons within that group. This may cause a server roundtrip, depending on the definition of the button in the screen painter.

Syntax

Visual Basic
Public Sub Select()

Example

In this example selecting the radio button ‘Other…’ causes the SAP server to enable the text field.

See Also

GuiRadioButton Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiRadioButton Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiRadioButton Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiRadioButton Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiRadioButton Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiRadioButton Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiRadioButton Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiRadioButton Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiRadioButton Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiRadioButton Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiRadioButton Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiRadioButton Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiRadioButton Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiRadioButton Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiRadioButton Object


Flushing Property

Flushing Property

Description

Some components such as radio buttons or check boxes may cause a round trip when their value is changed. If this is the case, the Flushing property is True.

Property type

Read-only property

Syntax

Visual Basic
Public Property Flushing() As Byte

See Also

GuiRadioButton Object


GroupCount Property

GroupCount Property

Property type

Read-only property

Syntax

Visual Basic
Public Property GroupCount() As Long

See Also

GuiRadioButton Object


GroupMembers Property

GroupMembers Property

Property type

Read-only property

Syntax

Visual Basic
Public Property GroupMembers() As GuiComponentCollection

Example

Set GroupMembers = session.findById("wnd[0]/usr/radRB2").GroupMembers
For Each GroupMember In GroupMembers
MsgBox GroupMember.Text
Next

See Also

GuiRadioButton Object


GroupPos Property

GroupPos Property

Property type

Read-only property

Syntax

Visual Basic
Public Property GroupPos() As Long

See Also

GuiRadioButton Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiRadioButton Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiRadioButton Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiRadioButton Object


IsLeftLabel Property

IsLeftLabel Property

Description

This property is True if the component has the 'assign left' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsLeftLabel() As Byte

See Also

GuiRadioButton Object


IsRightLabel Property

IsRightLabel Property

Description

This property is True if the component has the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsRightLabel() As Byte

See Also

GuiRadioButton Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiRadioButton Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiRadioButton Object


LeftLabel Property

LeftLabel Property

Description

Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'.

Property type

Read-only property

Syntax

Visual Basic
Public Property LeftLabel() As GuiVComponent

See Also

GuiRadioButton Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiRadioButton Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiRadioButton Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiRadioButton Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiRadioButton Object


RightLabel Property

RightLabel Property

Description

Right label of the component. This property is set in screenpainter using the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property RightLabel() As GuiVComponent

See Also

GuiRadioButton Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiRadioButton Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiRadioButton Object


Selected Property

Selected Property

Description

This property is True if the radio button is selected.

Property type

Read-write property

Syntax

Visual Basic
Public Property Selected() As Byte

See Also

GuiRadioButton Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiRadioButton Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiRadioButton Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiRadioButton Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiRadioButton Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiRadioButton Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiRadioButton Object


GuiSapChart Object

GuiSapChart Object
See Also Members

Description

For the SAP chart control only basic members from GuiShell are available. Recording and playback is not possible.

Object Model

See Also

GuiSapChart Members


GuiSapChart Object Members

GuiSapChart Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiSapChart Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiSapChart Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiSapChart Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiSapChart Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiSapChart Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiSapChart Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiSapChart Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiSapChart Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiSapChart Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiSapChart Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiSapChart Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiSapChart Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiSapChart Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiSapChart Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiSapChart Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiSapChart Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiSapChart Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiSapChart Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiSapChart Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiSapChart Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiSapChart Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiSapChart Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiSapChart Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiSapChart Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiSapChart Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiSapChart Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiSapChart Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiSapChart Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiSapChart Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiSapChart Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiSapChart Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiSapChart Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiSapChart Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiSapChart Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiSapChart Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiSapChart Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiSapChart Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiSapChart Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiSapChart Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiSapChart Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiSapChart Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiSapChart Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiSapChart Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiSapChart Object


GuiScrollbar Object

GuiScrollbar Object
See Also Members

Description

The GuiScrollbar class is a utility class used for example in GuiScrollContainer or GuiTableControl.

See Also

GuiScrollbar Members


GuiScrollbar Object Members

GuiScrollbar Object Members
See Also Overview

Public Properties

Public Property Maximum | This is the maximum position of the scrollbar.
Public Property Minimum | This is the minimum position of the scrollbar.
Public Property PageSize | When the user scrolls down a page, position will be increased by the value of pageSize.
Public Property Position | The position of the thumb of the scrollbar can be set to values from minimum to maximum.

See Also

GuiScrollbar Overview


Maximum Property

Maximum Property

Description

This is the maximum position of the scrollbar.

Property type

Read-only property

Syntax

Visual Basic
Public Property Maximum() As Long

See Also

GuiScrollbar Object


Minimum Property

Minimum Property

Description

This is the minimum position of the scrollbar.

Property type

Read-only property

Syntax

Visual Basic
Public Property Minimum() As Long

See Also

GuiScrollbar Object


PageSize Property

PageSize Property

Description

When the user scrolls down a page, position will be increased by the value of pageSize.

Property type

Read-only property

Syntax

Visual Basic
Public Property PageSize() As Long

See Also

GuiScrollbar Object


Position Property

Position Property

Description

The position of the thumb of the scrollbar can be set to values from minimum to maximum.

Property type

Read-write property

Syntax

Visual Basic
Public Property Position() As Long

See Also

GuiScrollbar Object


GuiScrollContainer Object

GuiScrollContainer Object
See Also Members

Description

This container represents scrollable subscreens. A subscreen may be scrollable without actually having a scrollbar, because the existence of a scrollbar depends on the amount of data displayed and the size of the GuiUserArea. GuiScrollContainer extends GuiVContainer. The type prefix is ssub, the name is generated from the data dictionary settings.

Object Model

See Also

GuiScrollContainer Members


GuiScrollContainer Object Members

GuiScrollContainer Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property HorizontalScrollbar |
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property VerticalScrollbar |
Public Property Width | Width of the component in pixels.

See Also

GuiScrollContainer Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiScrollContainer Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiScrollContainer Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiScrollContainer Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiScrollContainer Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiScrollContainer Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiScrollContainer Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiScrollContainer Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiScrollContainer Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiScrollContainer Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiScrollContainer Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiScrollContainer Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiScrollContainer Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiScrollContainer Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiScrollContainer Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiScrollContainer Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiScrollContainer Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiScrollContainer Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiScrollContainer Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiScrollContainer Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiScrollContainer Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiScrollContainer Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiScrollContainer Object


HorizontalScrollbar Property

HorizontalScrollbar Property

Property type

Read-write property

Syntax

Visual Basic
Public Property HorizontalScrollbar() As GuiScrollbar

See Also

GuiScrollContainer Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiScrollContainer Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiScrollContainer Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiScrollContainer Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiScrollContainer Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiScrollContainer Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiScrollContainer Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiScrollContainer Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiScrollContainer Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiScrollContainer Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiScrollContainer Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiScrollContainer Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiScrollContainer Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiScrollContainer Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiScrollContainer Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiScrollContainer Object


VerticalScrollbar Property

VerticalScrollbar Property

Property type

Read-write property

Syntax

Visual Basic
Public Property VerticalScrollbar() As GuiScrollbar

See Also

GuiScrollContainer Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiScrollContainer Object


GuiSession Object

GuiSession Object
See Also Members

Description

The GuiSession provides the context in which a user performs a certain task such as working with a transaction. It is therefore the access point for applications which record a user’s actions regarding a specific task or play back those actions. GuiSession extends GuiContainer. The type prefix is ses, the name is ses plus the session number in square brackets.

Object Model

Remarks

GuiSession is self-contained in that ids within the context of a session remain valid independently of other connections or sessions being open at the same time. Usually an external application will first determine with which session to interact. Once that is clear, the application will work more or less exclusively on that session.
Traversing the object hierarchy from the GuiApplication to the user interface elements, it is the session among whose children the highest level visible objects can be found. In contrast to objects like buttons or text fields, the session remains valid until the corresponding main window has been closed, whereas buttons, for example, are destroyed during each server communication .

See Also

GuiSession Members


GuiSession Object Members

GuiSession Object Members
See Also Overview

Public Methods

Public Method AsStdNumberFormat | Depending on the system's number format the minus sign of numbers may be placed to the right of the number. Using this function the minus sign is moved to the left.
Public Method ClearErrorList | This method clears the list of errors that may be created when ActiveX controls are found on a screen that do not support SAP GUI Scripting. Otherwise the list is cleared after an error event was raised. This happens at the end of a round trip.
Public Method CreateSession | This function opens a new session, which is then visualized by a new main window. This resembles the “/o” command that can be executed from the command field.
Public Method EnableJawsEvents |
Public Method EndTransaction | Calling this function has the same effect as SendCommand("/n").
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByPosition | This method can be used to do a hittest on a SAP GUI session. The parameters x and y should be given in screen coordinates. If no component is found an exception is raised unless raise is set to False. In that case a Null/Nothing object is returned.
Public Method GetIconResourceName | In SAP GUI icons are often described as text in the format @nn@ where nn is a number. The function getIconResourceName translates the @nn@ notation into the name of the resource in sapbtmp.dll. For example the string @36@ is translated into B_TVARS, which is the resource name for the icon [image] .
Public Method GetVKeyDescription | When a script is recorded, it will often contain sendVKey(n) calls, where n is a number. The method getVKeyDescription translates these numbers into a readable text. For example the number 0 is translated into the text “Enter”.
Public Method LockSessionUI | This method locks the session so that no user interaction is possible until the session is unlocked using UnlockSessionUI.
Public Method SendCommand | Using this function you can execute any command string, which could otherwise be entered in the command field combo box indicated below.
Public Method StartTransaction | Calling this function with parameter "xyz" has the same effect as SendCommand("/nxyz").
Public Method UnlockSessionUI | This method unlocks the session after it was locked using LockSessionUI.

Public Properties

Public Property AccEnhancedTabChain
Public Property AccSymbolReplacement
Public Property ActiveWindow | All windows can be found in the children collection of GuiSession. However, most of the time an application will access the currently activated window of the session, as that is the window with which a user will probably interact. This property is intended as a shortcut to this window.
Public Property Busy While SAP GUI is waiting for data from the server, any Scripting call will not return, which blocks the executing thread. This may not be acceptable for advanced applications.

A way to prevent this is to check the busy property of the session. If this property is True, then a subsequent Scripting call will wait for the server communication to be finished.

Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property ErrorList
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property Info | Info is of type GuiSessionInfo. It contains technical information about the current connection, the login data, the running SAP application and more.
Public Property IsActive | TRUE if the session window is active. FALSE overwise.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property PassportPreSystemId | The pre-system ID. Part of the passport information.
Public Property PassportSystemId | The system ID. Part of the passport information.
Public Property PassportTransactionId | The unique ID of the transaction. Part of the passport information.
Public Property Record | Setting this property to True enables the recording mode of the session. In this mode changes to elements of the user interface are recorded within SAP GUI and sent to a recording application using the Change event described later.
Public Property RecordFile | A simple way to record a script it to set the recordFile property to a valid filename and then enable the record property. A Visual Basic Script file of the given name will be created in the SapWorkDir on the client PC.
Public Property SaveAsUnicode | If this property is set to TRUE, the recorded scripts will be saved in UNICODE encoding. Overwise is the current system codepage.
Public Property ShowDropdownKeys | If this property is TRUE, the dropdowns show not only the text of dropdown entries, but also the keys.
Public Property TestToolMode During internal tests some aspects of the user interface proved to be difficult to handle with test tools using the Scripting API to automate SAP GUI. For this reason a special mode has been added in which the following changes are administered.
  • While success (S), warning (W) and error (E) messages are always displayed in the statusbar, information (I) and abort (A) messages are displayed as pop-up windows unless testToolMode is set.
  • The update mode of the application server is changed to immediate mode for the connection.
  • System messages are ignored so that they do not interrupt the recording or playback of scripts.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Events

Public Event Activated
Public Event AutomationFCode | The event is only fired when using the SAP Workplace. It notifies the listener that SAP GUI executes a function code that was set by the Workplace framework.
Public Event Change | In record mode, the session collects changes to elements of the user interface and sends these changes to a listening application whenever server communication is about to start or if the record mode is turned off. The change events are raised immediately before the startRequest event. There is at least one event for every modified element in the recorded session.
Public Event ContextMenu The contextMenu event is fired when SAP GUI is about to display a context menu. There are currently the following limitations:
  • Only context menus of controls of type GuiShell are supported.
  • The event is not fired for “cached” context menus, which are not retrieved from the server when being opened.
Public Event Destroy | This event is raised before a session is destroyed.
Public Event EndRequest | endRequest is called immediately after the session is unlocked after server communication.
Public Event Error | An error event is currently only raised, if the wrapper library required to access a SAP GUI ActiveX control from a script is not available. error events from all sessions are also available at the GuiApplication.
Public Event FocusChanged
Public Event Hit The hit event is only raised when elementVisualizationMode is set to True, which turns on the hit test mode of SAP GUI. If in this mode a SAP GUI component is identified, the hit event is raised. The parameters of this event are
  • The session on which the component was hit
  • The component that was hit
  • A description of an inner object of the component if an inner object was hit
Public Event StartRequest | The startRequest event is raised before the session is locked during server communication. At this point user input can be checked before it is sent to the server. It is not possible to prevent server communication from this event.

See Also

GuiSession Overview


AsStdNumberFormat Method

AsStdNumberFormat Method
Number

Description

Depending on the system's number format the minus sign of numbers may be placed to the right of the number. Using this function the minus sign is moved to the left.

Syntax

Visual Basic
Public Function AsStdNumberFormat( _
   ByVal Number As String _
) As String

Parameters

Number

See Also

GuiSession Object


ClearErrorList Method

ClearErrorList Method

Description

This method clears the list of errors that may be created when ActiveX controls are found on a screen that do not support SAP GUI Scripting. Otherwise the list is cleared after an error event was raised. This happens at the end of a round trip.

Syntax

Visual Basic
Public Sub ClearErrorList()

See Also

GuiSession Object


CreateSession Method

CreateSession Method

Description

This function opens a new session, which is then visualized by a new main window. This resembles the “/o” command that can be executed from the command field.

Syntax

Visual Basic
Public Sub CreateSession()

See Also

GuiSession Object


EnableJawsEvents Method

EnableJawsEvents Method

Syntax

Visual Basic
Public Sub EnableJawsEvents()

See Also

GuiSession Object


EndTransaction Method

EndTransaction Method

Description

Calling this function has the same effect as SendCommand("/n").

Syntax

Visual Basic
Public Sub EndTransaction()

See Also

GuiSession Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiSession Object


FindByPosition Method

FindByPosition Method
x
y
Raise

Description

This method can be used to do a hittest on a SAP GUI session. The parameters x and y should be given in screen coordinates. If no component is found an exception is raised unless raise is set to False. In that case a Null/Nothing object is returned.

Syntax

Visual Basic
Public Function FindByPosition( _
   ByVal x As Long, _
   ByVal y As Long, _
   Optional ByVal Raise As Variant _
) As GuiCollection

Parameters

x
y
Raise

Remarks

If a component is found, the collection contains 2 strings: The Id of the component and the description string for the inner object, which is only set for some complex components such as GuiCtrlGridView.

See Also

GuiSession Object


GetIconResourceName Method

GetIconResourceName Method
Text

Description

In SAP GUI icons are often described as text in the format @nn@ where nn is a number. The function getIconResourceName translates the @nn@ notation into the name of the resource in sapbtmp.dll.
For example the string @36@ is translated into B_TVARS, which is the resource name for the icon [image].

Syntax

Visual Basic
Public Function GetIconResourceName( _
   ByVal Text As String _
) As String

Parameters

Text

See Also

GuiSession Object


GetVKeyDescription Method

GetVKeyDescription Method
VKey

Description

When a script is recorded, it will often contain sendVKey(n) calls, where n is a number. The method getVKeyDescription translates these numbers into a readable text. For example the number 0 is translated into the text “Enter”.

Syntax

Visual Basic
Public Function GetVKeyDescription( _
   ByVal VKey As Long _
) As String

Parameters

VKey

See Also

GuiSession Object


LockSessionUI Method

LockSessionUI Method

Description

This method locks the session so that no user interaction is possible until the session is unlocked using UnlockSessionUI.

Syntax

Visual Basic
Public Sub LockSessionUI()

See Also

GuiSession Object


SendCommand Method

SendCommand Method
Command

Description

Using this function you can execute any command string, which could otherwise be entered in the command field combo box indicated below.

Syntax

Visual Basic
Public Sub SendCommand( _
   ByVal Command As String _
)

Parameters

Command

See Also

GuiSession Object


StartTransaction Method

StartTransaction Method
Transaction

Description

Calling this function with parameter "xyz" has the same effect as SendCommand("/nxyz").

Syntax

Visual Basic
Public Sub StartTransaction( _
   ByVal Transaction As String _
)

Parameters

Transaction

See Also

GuiSession Object


UnlockSessionUI Method

UnlockSessionUI Method

Description

This method unlocks the session after it was locked using LockSessionUI.

Syntax

Visual Basic
Public Sub UnlockSessionUI()

See Also

GuiSession Object


AccEnhancedTabChain Property

AccEnhancedTabChain Property

Property type

Read-write property

Syntax

Visual Basic
Public Property AccEnhancedTabChain() As Byte

See Also

GuiSession Object


AccSymbolReplacement Property

AccSymbolReplacement Property

Property type

Read-write property

Syntax

Visual Basic
Public Property AccSymbolReplacement() As Byte

See Also

GuiSession Object


ActiveWindow Property

ActiveWindow Property

Description

All windows can be found in the children collection of GuiSession. However, most of the time an application will access the currently activated window of the session, as that is the window with which a user will probably interact. This property is intended as a shortcut to this window.

Property type

Read-only property

Syntax

Visual Basic
Public Property ActiveWindow() As GuiFrameWindow

See Also

GuiSession Object


Busy Property

Busy Property

Description

While SAP GUI is waiting for data from the server, any Scripting call will not return, which blocks the executing thread. This may not be acceptable for advanced applications.

A way to prevent this is to check the busy property of the session. If this property is True, then a subsequent Scripting call will wait for the server communication to be finished.

Property type

Read-write property

Syntax

Visual Basic
Public Property Busy() As Byte

See Also

GuiSession Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiSession Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiSession Object


ErrorList Property

ErrorList Property

Property type

Read-write property

Syntax

Visual Basic
Public Property ErrorList() As GuiCollection

See Also

GuiSession Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiSession Object


Info Property

Info Property

Description

Info is of type GuiSessionInfo. It contains technical information about the current connection, the login data, the running SAP application and more.

Property type

Read-only property

Syntax

Visual Basic
Public Property Info() As GuiSessionInfo

See Also

GuiSession Object


IsActive Property

IsActive Property

Description

TRUE if the session window is active. FALSE overwise.

Property type

Read-write property

Syntax

Visual Basic
Public Property IsActive() As Byte

See Also

GuiSession Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiSession Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiSession Object


PassportPreSystemId Property

PassportPreSystemId Property

Description

The pre-system ID. Part of the passport information.

Property type

Read-write property

Syntax

Visual Basic
Public Property PassportPreSystemId() As String

See Also

GuiSession Object


PassportSystemId Property

PassportSystemId Property

Description

The system ID. Part of the passport information.

Property type

Read-write property

Syntax

Visual Basic
Public Property PassportSystemId() As String

See Also

GuiSession Object


PassportTransactionId Property

PassportTransactionId Property

Description

The unique ID of the transaction. Part of the passport information.

Property type

Read-write property

Syntax

Visual Basic
Public Property PassportTransactionId() As String

See Also

GuiSession Object


Record Property

Record Property

Description

Setting this property to True enables the recording mode of the session. In this mode changes to elements of the user interface are recorded within SAP GUI and sent to a recording application using the Change event described later.

Property type

Read-write property

Syntax

Visual Basic
Public Property Record() As Byte

Remarks

Some elements of the user interface may behave differently in record mode than during playback or manual interaction.

  • The F4 help dialog is always displayed as a modal window.
  • Drag & Drop is disabled.

See Also

GuiSession Object


RecordFile Property

RecordFile Property

Description

A simple way to record a script it to set the recordFile property to a valid filename and then enable the record property. A Visual Basic Script file of the given name will be created in the SapWorkDir on the client PC.

Property type

Read-write property

Syntax

Visual Basic
Public Property RecordFile() As String

Remarks

This property only accepts simple filenames without path information.

See Also

GuiSession Object


SaveAsUnicode Property

SaveAsUnicode Property

Description

If this property is set to TRUE, the recorded scripts will be saved in UNICODE encoding. Overwise is the current system codepage.

Property type

Read-write property

Syntax

Visual Basic
Public Property SaveAsUnicode() As Byte

See Also

GuiSession Object


ShowDropdownKeys Property

ShowDropdownKeys Property

Description

If this property is TRUE, the dropdowns show not only the text of dropdown entries, but also the keys.

Property type

Read-write property

Syntax

Visual Basic
Public Property ShowDropdownKeys() As Byte

See Also

GuiSession Object


TestToolMode Property

TestToolMode Property

Description

During internal tests some aspects of the user interface proved to be difficult to handle with test tools using the Scripting API to automate SAP GUI. For this reason a special mode has been added in which the following changes are administered.

  • While success (S), warning (W) and error (E) messages are always displayed in the statusbar, information (I) and abort (A) messages are displayed as pop-up windows unless testToolMode is set.
  • The update mode of the application server is changed to immediate mode for the connection.
  • System messages are ignored so that they do not interrupt the recording or playback of scripts.

Property type

Read-write property

Syntax

Visual Basic
Public Property TestToolMode() As Long

Remarks

The test tool mode requires one of the following versions of the SAP kernel:

  • 6.20 Patch level 29 and all following kernel versions
  • 4.6D Patch level 1208, see note 511310.

Currently only the following values are allowed for this property:

  • 0: Disable testToolMode
  • 1: Enable testToolMode

See Also

GuiSession Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiSession Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiSession Object


Activated Event

Activated Event
Session

Syntax

Visual Basic
Public Event Activated( _
   ByVal Session As GuiSession _
)

Parameters

Session

See Also

GuiSession Object


AutomationFCode Event

AutomationFCode Event
Session
FunctionCode

Description

The event is only fired when using the SAP Workplace. It notifies the listener that SAP GUI executes a function code that was set by the Workplace framework.

Syntax

Visual Basic
Public Event AutomationFCode( _
   ByVal Session As GuiSession, _
   ByVal FunctionCode As String _
)

Parameters

Session
FunctionCode

See Also

GuiSession Object


Change Event

Change Event
Session
Component
CommandArray

Description

In record mode, the session collects changes to elements of the user interface and sends these changes to a listening application whenever server communication is about to start or if the record mode is turned off. The change events are raised immediately before the startRequest event. There is at least one event for every modified element in the recorded session.

Syntax

Visual Basic
Public Event Change( _
   ByVal Session As GuiSession, _
   ByVal Component As GuiComponent, _
   ByVal CommandArray As Variant _
)

Parameters

Session
Component
CommandArray

Remarks

Only changes made at the SAP GUI level are recorded. Transactions may preset some of the entry fields with values from parameters stored in the SAP system. If these data are not changed in SAP GUI, they will not be recorded. This may cause problems during playback of scripts, if the entry fields are preset with different values.

If any of the following techniques is used in a transaction, the user should manually modify all the entries he wants to see recorded:

  • Usage of SAP parameters
  • Variants
  • Hold Data, from the menu System -> User Profile

Playback of the changes will only work, if the order of the calls is the same as during recording.

Each event represents one line of script code. The Component parameter specifies the object on which to invoke a method or property. Therefore the first thing to record is Component.id for later use with findById. The recorder may however also decide to record other properties of Component. If, for example, a line in a table control or list is selected, it may be prudent not to record the position of the line, but rather the values in it. That way, a script can be generated that is more robust with respect to changes in the number, and therefore in the position, of lines.

If new function modules have been added, selecting a line from the list might return the wrong function module.

Type | Method/Property name | Parameters
"SP" | "Text" | "Hello World"

This sets the parameter Text to value “Hello World”.

Type | Method/Property name | Parameters
"SP" | "RecordMode" | True

This sets the parameter RecordMode to the Boolean value True. It is up to the recorder to generate a script line with a valid textual representation of Boolean values, such as “true”, “True” or “TRUE” for example.

Type | Method/Property name | Parameters
"SP" | "TestToolMode" | 0

This sets the parameter TestToolMode to value 0.

Type | Method/Property name | Parameters
"M" | "Resize" | 96
 |  | 32
 |  | False

The method Resize is called with three parameters. In this case the third member of the CommandArray is an array with 3 elements.

There are cases in which the CommandArray contains more than one line.

If a row is selected in this table control, two entries are added to the generated Change event’s CommandArray parameter.

Type | Method/Property name | Parameters
"M" | "getAbsoluteRow" | 1
"SP" | "selected" | True

The script code required to select this line should then look like this:
Session.findById("wnd[0]/usr/tblSAPMBIBSTC537").getAbsoluteRow("1").selected = "True"

See Also

GuiSession Object


ContextMenu Event

ContextMenu Event
Session
Component

Description

The contextMenu event is fired when SAP GUI is about to display a context menu. There are currently the following limitations:

  • Only context menus of controls of type GuiShell are supported.
  • The event is not fired for “cached” context menus, which are not retrieved from the server when being opened.

Syntax

Visual Basic
Public Event ContextMenu( _
   ByVal Session As GuiSession, _
   ByVal Component As GuiVComponent _
)

Parameters

Session
Component

See Also

GuiSession Object


Destroy Event

Destroy Event
Session

Description

This event is raised before a session is destroyed.

Syntax

Visual Basic
Public Event Destroy( _
   ByVal Session As GuiSession _
)

Parameters

Session

See Also

GuiSession Object


EndRequest Event

EndRequest Event
Session

Description

endRequest is called immediately after the session is unlocked after server communication.

Syntax

Visual Basic
Public Event EndRequest( _
   ByVal Session As GuiSession _
)

Parameters

Session

See Also

GuiSession Object


Error Event

Error Event
Session
ErrorId
Desc1
Desc2
Desc3
Desc4

Description

An error event is currently only raised, if the wrapper library required to access a SAP GUI ActiveX control from a script is not available. error events from all sessions are also available at the GuiApplication.

Syntax

Visual Basic
Public Event Error( _
   ByVal Session As GuiSession, _
   ByVal ErrorId As Long, _
   ByVal Desc1 As String, _
   ByVal Desc2 As String, _
   ByVal Desc3 As String, _
   ByVal Desc4 As String _
)

Parameters

Session
ErrorId
Desc1
Desc2
Desc3
Desc4

See Also

GuiSession Object


FocusChanged Event

FocusChanged Event
Session
NewFocusedControl

Syntax

Visual Basic
Public Event FocusChanged( _
   ByVal Session As GuiSession, _
   ByVal NewFocusedControl As GuiVComponent _
)

Parameters

Session
NewFocusedControl

See Also

GuiSession Object


Hit Event

Hit Event
Session
Component
InnerObject

Description

The hit event is only raised when elementVisualizationMode is set to True, which turns on the hit test mode of SAP GUI. If in this mode a SAP GUI component is identified, the hit event is raised. The parameters of this event are

  • The session on which the component was hit
  • The component that was hit
  • A description of an inner object of the component if an inner object was hit

Syntax

Visual Basic
Public Event Hit( _
   ByVal Session As GuiSession, _
   ByVal Component As GuiComponent, _
   ByVal InnerObject As String _
)

Parameters

Session
Component
InnerObject

See Also

GuiSession Object


StartRequest Event

StartRequest Event
Session

Description

The startRequest event is raised before the session is locked during server communication. At this point user input can be checked before it is sent to the server. It is not possible to prevent server communication from this event.

Syntax

Visual Basic
Public Event StartRequest( _
   ByVal Session As GuiSession _
)

Parameters

Session

See Also

GuiSession Object


GuiSessionInfo Object

GuiSessionInfo Object
See Also Members

Description

GuiSessionInfo is a member of all GuiSession objects. It makes available technical information about the session. Some of its properties are displayed in the right corner of the SAP GUI status line.

See Also

GuiSessionInfo Members


GuiSessionInfo Object Members

GuiSessionInfo Object Members
See Also Overview

Public Properties

Public Property ApplicationServer | The name of the application server is set only if the session belongs to a connection that was started without load balancing, by specifying an application server.
Public Property Client | The client selected on the login screen.
Public Property Codepage | The codepage specified in SAPlogon in the properties of the connection.
Public Property Flushes | The property flushes counts the number of flushes in the automation queue during server communication.
Public Property Group | The login group information is available only if the session belongs to a connection which was started using load balancing.
Public Property GuiCodepage | A list of codepages is available in table TCP00A of the SAP system. On a client running Microsoft Windows with codepage 1252 (Latin I) the property guiCodepage is 1160.
Public Property I18NMode | The I18N mode of SAP GUI is required for multi-byte character sets.
Public Property InterpretationTime | The interpretation time begins after the data have arrived from the server. It comprises the parsing of the data and distribution to the SAP GUI elements. The unit is milliseconds.
Public Property IsLowSpeedConnection | The property is True if the connection to which the session belongs runs with the low speed connection flag. This flag can be set on the advanced connection properties page of the SAPLogon dialog. The SAP GUI Scripting support is very limited for low speed connections, because information required to identify SAP GUI objects is not being sent.
Public Property Language | The language specified on the login screen.
Public Property MessageServer | The message server information is available only if the session belongs to a connection which was started using load balancing.
Public Property Program | The name of the source program that is currently being executed.
Public Property ResponseTime | This is the time that is spent on network communication from the moment data are sent to the server to the moment the server response arrives. The unit is milliseconds.
Public Property RoundTrips | Before SAP GUI sends data to the server it locks the user interface. In many cases it will not unlock the interface once data arrive from the server, but instead will send a new request to the server immediately. Controls in particular use this technology to load the data they need for visualization. The count of these token switches between SAP GUI and the server is the roundTrips property.
Public Property ScreenNumber | The number of the screen currently displayed.
Public Property ScriptingModeReadOnly The read only mode can be enabled using an application server profile parameter. In this mode the state of SAP applications can not be changed through the Scripting API, which means:
  • Properties can only be read, but not set
  • Functions can only be called if they do not change the control’s state.
Public Property ScriptingModeRecordingDisabled | The recording disabled mode can be enabled using an application server profile parameter. In this mode SAP GUI Scripting does not fire any events. This implies that user interaction can not be recorded. However data can be read from SAP GUI and scripts can be used to run transactions.
Public Property SessionNumber | The number of the session is also displayed in SAP GUI on the statusbar.
Public Property SystemName | This is the name of the SAP system.
Public Property SystemNumber | The system number is set only if the session belongs to a connection that was started without load balancing, by specifying an application server.
Public Property SystemSessionId | All SAP GUI sessions of the same connection are represented on the server with the same SystemSessionId. Using SystemSessionId and SessionNumber, it is possible to find a matching SAP GUI session from an ABAP application.
Public Property Transaction | The transaction that is currently being executed.
Public Property User | The SAP name of the user logged into the system.

See Also

GuiSessionInfo Overview


ApplicationServer Property

ApplicationServer Property

Description

The name of the application server is set only if the session belongs to a connection that was started without load balancing, by specifying an application server.

Property type

Read-only property

Syntax

Visual Basic
Public Property ApplicationServer() As String

See Also

GuiSessionInfo Object


Client Property

Client Property

Description

The client selected on the login screen.

Property type

Read-only property

Syntax

Visual Basic
Public Property Client() As String

See Also

GuiSessionInfo Object


Codepage Property

Codepage Property

Description

The codepage specified in SAPlogon in the properties of the connection.

Property type

Read-only property

Syntax

Visual Basic
Public Property Codepage() As Long

See Also

GuiSessionInfo Object


Flushes Property

Flushes Property

Description

The property flushes counts the number of flushes in the automation queue during server communication.

Property type

Read-only property

Syntax

Visual Basic
Public Property Flushes() As Long

See Also

GuiSessionInfo Object


Group Property

Group Property

Description

The login group information is available only if the session belongs to a connection which was started using load balancing.

Property type

Read-only property

Syntax

Visual Basic
Public Property Group() As String

See Also

GuiSessionInfo Object


GuiCodepage Property

GuiCodepage Property

Description

A list of codepages is available in table TCP00A of the SAP system. On a client running Microsoft Windows with codepage 1252 (Latin I) the property guiCodepage is 1160.

Property type

Read-only property

Syntax

Visual Basic
Public Property GuiCodepage() As Long

See Also

GuiSessionInfo Object


I18NMode Property

I18NMode Property

Description

The I18N mode of SAP GUI is required for multi-byte character sets.

Property type

Read-only property

Syntax

Visual Basic
Public Property I18NMode() As Byte

See Also

GuiSessionInfo Object


InterpretationTime Property

InterpretationTime Property

Description

The interpretation time begins after the data have arrived from the server. It comprises the parsing of the data and distribution to the SAP GUI elements. The unit is milliseconds.

Property type

Read-only property

Syntax

Visual Basic
Public Property InterpretationTime() As Long

See Also

GuiSessionInfo Object


IsLowSpeedConnection Property

IsLowSpeedConnection Property

Description

The property is True if the connection to which the session belongs runs with the low speed connection flag. This flag can be set on the advanced connection properties page of the SAPLogon dialog. The SAP GUI Scripting support is very limited for low speed connections, because information required to identify SAP GUI objects is not being sent.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsLowSpeedConnection() As Byte

See Also

GuiSessionInfo Object


Language Property

Language Property

Description

The language specified on the login screen.

Property type

Read-only property

Syntax

Visual Basic
Public Property Language() As String

See Also

GuiSessionInfo Object


MessageServer Property

MessageServer Property

Description

The message server information is available only if the session belongs to a connection which was started using load balancing.

Property type

Read-only property

Syntax

Visual Basic
Public Property MessageServer() As String

See Also

GuiSessionInfo Object


Program Property

Program Property

Description

The name of the source program that is currently being executed.

Property type

Read-only property

Syntax

Visual Basic
Public Property Program() As String

See Also

GuiSessionInfo Object


ResponseTime Property

ResponseTime Property

Description

This is the time that is spent on network communication from the moment data are sent to the server to the moment the server response arrives. The unit is milliseconds.

Property type

Read-only property

Syntax

Visual Basic
Public Property ResponseTime() As Long

See Also

GuiSessionInfo Object


RoundTrips Property

RoundTrips Property

Description

Before SAP GUI sends data to the server it locks the user interface. In many cases it will not unlock the interface once data arrive from the server, but instead will send a new request to the server immediately. Controls in particular use this technology to load the data they need for visualization. The count of these token switches between SAP GUI and the server is the roundTrips property.

Property type

Read-only property

Syntax

Visual Basic
Public Property RoundTrips() As Long

See Also

GuiSessionInfo Object


ScreenNumber Property

ScreenNumber Property

Description

The number of the screen currently displayed.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenNumber() As Long

See Also

GuiSessionInfo Object


ScriptingModeReadOnly Property

ScriptingModeReadOnly Property

Description

The read only mode can be enabled using an application server profile parameter. In this mode the state of SAP applications can not be changed through the Scripting API, which means:

  • Properties can only be read, but not set
  • Functions can only be called if they do not change the control’s state.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScriptingModeReadOnly() As Byte

Remarks

In this mode scripts can be recorded and information about the application can be read from SAP GUI. However a transaction can not be run from a script. Additional documentation is available is OSS note 692245 and in the SAP GUI Scripting security documentation on the service market place.

See Also

GuiSessionInfo Object


ScriptingModeRecordingDisabled Property

ScriptingModeRecordingDisabled Property

Description

The recording disabled mode can be enabled using an application server profile parameter. In this mode SAP GUI Scripting does not fire any events. This implies that user interaction can not be recorded. However data can be read from SAP GUI and scripts can be used to run transactions.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScriptingModeRecordingDisabled() As Byte

Remarks

Additional documentation is available is OSS note 692245 and in the SAP GUI Scripting security documentation on the service market place.

See Also

GuiSessionInfo Object


SessionNumber Property

SessionNumber Property

Description

The number of the session is also displayed in SAP GUI on the statusbar.

Property type

Read-only property

Syntax

Visual Basic
Public Property SessionNumber() As Long

See Also

GuiSessionInfo Object


SystemName Property

SystemName Property

Description

This is the name of the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property SystemName() As String

See Also

GuiSessionInfo Object


SystemNumber Property

SystemNumber Property

Description

The system number is set only if the session belongs to a connection that was started without load balancing, by specifying an application server.

Property type

Read-only property

Syntax

Visual Basic
Public Property SystemNumber() As Long

See Also

GuiSessionInfo Object


SystemSessionId Property

SystemSessionId Property

Description

All SAP GUI sessions of the same connection are represented on the server with the same SystemSessionId. Using SystemSessionId and SessionNumber, it is possible to find a matching SAP GUI session from an ABAP application.

Property type

Read-only property

Syntax

Visual Basic
Public Property SystemSessionId() As String

See Also

GuiSessionInfo Object


Transaction Property

Transaction Property

Description

The transaction that is currently being executed.

Property type

Read-only property

Syntax

Visual Basic
Public Property Transaction() As String

See Also

GuiSessionInfo Object


User Property

User Property

Description

The SAP name of the user logged into the system.

Property type

Read-only property

Syntax

Visual Basic
Public Property User() As String

See Also

GuiSessionInfo Object


GuiShell Object

GuiShell Object
See Also Members

Description

GuiShell is an abstract object whose interface is supported by all the controls. GuiShell extends GuiVContainer. The type prefix is shell, the name is is the last part of the id, shell[n].

Object Model

See Also

GuiShell Members


GuiShell Object Members

GuiShell Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiShell Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiShell Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiShell Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiShell Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiShell Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiShell Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiShell Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiShell Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiShell Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

Example

In the following example the text to use as parameter of this function would be "Submenu|Submenu - Entry 1".

See Also

GuiShell Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiShell Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiShell Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiShell Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiShell Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiShell Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiShell Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiShell Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiShell Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiShell Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiShell Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiShell Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiShell Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiShell Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiShell Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiShell Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiShell Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiShell Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiShell Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiShell Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiShell Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiShell Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiShell Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiShell Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiShell Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiShell Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiShell Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiShell Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiShell Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiShell Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiShell Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiShell Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiShell Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiShell Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiShell Object


GuiSimpleContainer Object

GuiSimpleContainer Object
See Also Members

Description

This container represents non-scrollable subscreens. It does not have any functionality apart from to the inherited interfaces. GuiSimpleContainer extends GuiVContainer. The type prefix is sub, the name is is generated from the data dictionary settings.

Object Model

See Also

GuiSimpleContainer Members


GuiSimpleContainer Object Members

GuiSimpleContainer Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method GetListProperty | This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes.
Public Method GetListPropertyNonRec | This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes. In contrast to the method GetListProperty, GetListPropertyNonRec will only return information that is set for the specific element, and ignore list properties set for parent elements.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsListElement | This property is True if the element is on an ABAP list, not a dynpro screen.
Public Property IsStepLoop | This property is True if the container is a step loop container.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property LoopColCount | If the container is a step loop container, then this property contains the number of columns in the step loop.
Public Property LoopCurrentCol | If the container is a step loop container, then this property contains the current row number in the step loop.
Public Property LoopCurrentRow | If the container is a step loop container, then this property contains the current column number in the step loop.
Public Property LoopRowCount | If the container is a step loop container, then this property contains the number of rows in the step loop.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiSimpleContainer Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiSimpleContainer Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiSimpleContainer Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiSimpleContainer Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiSimpleContainer Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiSimpleContainer Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiSimpleContainer Object


GetListProperty Method

GetListProperty Method
Property

Description

This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes.

Syntax

Visual Basic
Public Function GetListProperty( _
   ByVal Property As String _
) As String

Parameters

Property

See Also

GuiSimpleContainer Object


GetListPropertyNonRec Method

GetListPropertyNonRec Method
Property

Description

This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes. In contrast to the method GetListProperty, GetListPropertyNonRec will only return information that is set for the specific element, and ignore list properties set for parent elements.

Syntax

Visual Basic
Public Function GetListPropertyNonRec( _
   ByVal Property As String _
) As String

Parameters

Property

See Also

GuiSimpleContainer Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiSimpleContainer Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiSimpleContainer Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiSimpleContainer Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiSimpleContainer Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiSimpleContainer Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiSimpleContainer Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiSimpleContainer Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiSimpleContainer Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiSimpleContainer Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiSimpleContainer Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiSimpleContainer Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiSimpleContainer Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiSimpleContainer Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiSimpleContainer Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiSimpleContainer Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiSimpleContainer Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiSimpleContainer Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiSimpleContainer Object


IsListElement Property

IsListElement Property

Description

This property is True if the element is on an ABAP list, not a dynpro screen.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsListElement() As Byte

See Also

GuiSimpleContainer Object


IsStepLoop Property

IsStepLoop Property

Description

This property is True if the container is a step loop container.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsStepLoop() As Byte

See Also

GuiSimpleContainer Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiSimpleContainer Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiSimpleContainer Object


LoopColCount Property

LoopColCount Property

Description

If the container is a step loop container, then this property contains the number of columns in the step loop.

Property type

Read-only property

Syntax

Visual Basic
Public Property LoopColCount() As Long

See Also

GuiSimpleContainer Object


LoopCurrentCol Property

LoopCurrentCol Property

Description

If the container is a step loop container, then this property contains the current row number in the step loop.

Property type

Read-only property

Syntax

Visual Basic
Public Property LoopCurrentCol() As Long

See Also

GuiSimpleContainer Object


LoopCurrentRow Property

LoopCurrentRow Property

Description

If the container is a step loop container, then this property contains the current column number in the step loop.

Property type

Read-only property

Syntax

Visual Basic
Public Property LoopCurrentRow() As Long

See Also

GuiSimpleContainer Object


LoopRowCount Property

LoopRowCount Property

Description

If the container is a step loop container, then this property contains the number of rows in the step loop.

Property type

Read-only property

Syntax

Visual Basic
Public Property LoopRowCount() As Long

See Also

GuiSimpleContainer Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiSimpleContainer Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiSimpleContainer Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiSimpleContainer Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiSimpleContainer Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiSimpleContainer Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiSimpleContainer Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiSimpleContainer Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiSimpleContainer Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiSimpleContainer Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiSimpleContainer Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiSimpleContainer Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiSimpleContainer Object


GuiSplit Object

GuiSplit Object
See Also Members

Description

GuiSplit extends GuiShell.

Object Model

See Also

GuiSplit Members


GuiSplit Object Members

GuiSplit Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method GetColSize |
Public Method GetRowSize |
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetColSize |
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method SetRowSize |
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property IsVertical |
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Splitter”.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiSplit Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiSplit Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiSplit Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiSplit Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiSplit Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiSplit Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiSplit Object


GetColSize Method

GetColSize Method
Id

Syntax

Visual Basic
Public Function GetColSize( _
   ByVal Id As Long _
) As Long

Parameters

Id

See Also

GuiSplit Object


GetRowSize Method

GetRowSize Method
Id

Syntax

Visual Basic
Public Function GetRowSize( _
   ByVal Id As Long _
) As Long

Parameters

Id

See Also

GuiSplit Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiSplit Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiSplit Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiSplit Object


SetColSize Method

SetColSize Method
Id
Size

Syntax

Visual Basic
Public Sub SetColSize( _
   ByVal Id As Long, _
   ByVal Size As Long _
)

Parameters

Id
Size

See Also

GuiSplit Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiSplit Object


SetRowSize Method

SetRowSize Method
Id
Size

Syntax

Visual Basic
Public Sub SetRowSize( _
   ByVal Id As Long, _
   ByVal Size As Long _
)

Parameters

Id
Size

See Also

GuiSplit Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiSplit Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiSplit Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiSplit Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiSplit Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiSplit Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiSplit Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiSplit Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiSplit Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiSplit Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiSplit Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiSplit Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiSplit Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiSplit Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiSplit Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiSplit Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiSplit Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiSplit Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiSplit Object


IsVertical Property

IsVertical Property

Property type

Read-only property

Syntax

Visual Basic
Public Property IsVertical() As Long

See Also

GuiSplit Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiSplit Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiSplit Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiSplit Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiSplit Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiSplit Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiSplit Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiSplit Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiSplit Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Splitter”.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiSplit Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiSplit Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiSplit Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiSplit Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiSplit Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiSplit Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiSplit Object


GuiSplitterContainer Object

GuiSplitterContainer Object
See Also Members

Description

The GuiSplitterContainer represents the dynpro splitter element, which was introduced in the Web Application Server ABAP in NetWeaver 7.1. The dynpro splitter element is similar to the activeX based splitter control, but it is a plain dynpro element.

Object Model

See Also

GuiSplitterContainer Members


GuiSplitterContainer Object Members

GuiSplitterContainer Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiSplitterContainer Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiSplitterContainer Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiSplitterContainer Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiSplitterContainer Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiSplitterContainer Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiSplitterContainer Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiSplitterContainer Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiSplitterContainer Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiSplitterContainer Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiSplitterContainer Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiSplitterContainer Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiSplitterContainer Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiSplitterContainer Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiSplitterContainer Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiSplitterContainer Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiSplitterContainer Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiSplitterContainer Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiSplitterContainer Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiSplitterContainer Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiSplitterContainer Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiSplitterContainer Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiSplitterContainer Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiSplitterContainer Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiSplitterContainer Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiSplitterContainer Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiSplitterContainer Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiSplitterContainer Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiSplitterContainer Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiSplitterContainer Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiSplitterContainer Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiSplitterContainer Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiSplitterContainer Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiSplitterContainer Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiSplitterContainer Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiSplitterContainer Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiSplitterContainer Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiSplitterContainer Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiSplitterContainer Object


GuiStage Object

GuiStage Object
See Also Members

Description

For the stage control only basic members from GuiShell are available. Recording and playback is not possible.

Object Model

See Also

GuiStage Members


GuiStage Object Members

GuiStage Object Members
See Also Overview

Public Methods

Public Method ContextMenu |
Public Method DoubleClick |
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SelectItems |
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiStage Overview


ContextMenu Method

ContextMenu Method
strId

Syntax

Visual Basic
Public Sub ContextMenu( _
   ByVal strId As String _
)

Parameters

strId

See Also

GuiStage Object


DoubleClick Method

DoubleClick Method
strId

Syntax

Visual Basic
Public Sub DoubleClick( _
   ByVal strId As String _
)

Parameters

strId

See Also

GuiStage Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiStage Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiStage Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiStage Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiStage Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiStage Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiStage Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiStage Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiStage Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiStage Object


SelectItems Method

SelectItems Method
strItems

Syntax

Visual Basic
Public Sub SelectItems( _
   ByVal strItems As String _
)

Parameters

strItems

See Also

GuiStage Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiStage Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiStage Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiStage Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiStage Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiStage Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiStage Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiStage Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiStage Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiStage Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiStage Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiStage Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiStage Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiStage Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiStage Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiStage Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiStage Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiStage Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiStage Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiStage Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiStage Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiStage Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiStage Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiStage Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiStage Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiStage Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiStage Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiStage Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiStage Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiStage Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiStage Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiStage Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiStage Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiStage Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiStage Object


GuiStatusbar Object

GuiStatusbar Object
See Also Members

Description

GuiStatusbar represents the message displaying part of the statusbar on the bottom of the SAP GUI window. It does not include the system and login information displayed in the rightmost area of the statusbar as these are available from the GuiSessionInfo object. GuiStatusbar extends GuiVComponent. The type prefix is sbar.

Object Model

See Also

GuiStatusbar Members


GuiStatusbar Object Members

GuiStatusbar Object Members
See Also Overview

Public Methods

Public Method DoubleClick | When a message is displayed in the GuiStatusbar, this message can be double clicked. This will usually open the SAP performance assistant.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property MessageAsPopup | Some messages may be displayed not only on the statusbar but also as a pop-up window. In such cases, this property is set to True so that a script knows it has to close a pop-up to continue.
Public Property MessageId | This is the name of the message class used in the ABAP message call.
Public Property MessageNumber | This is the name of the message number used in the ABAP message call. It will usually be a number, but this is not enforced by the system.
Public Property MessageParameter | These are the values of the parameters used to expand the placeholders in the message text definition in the data dictionary. The text property of the GuiStatusbar already contains the expanded text of the message. A maximum of 8 parameter values can be provided in the ABAP coding, so index should be in the range from 0 to 7.
Public Property MessageType This property may have any of the following values:

Value | Description
S | Success
W | Warning
E | Error
A | Abort
I | Information

Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiStatusbar Overview


DoubleClick Method

DoubleClick Method

Description

When a message is displayed in the GuiStatusbar, this message can be double clicked. This will usually open the SAP performance assistant.

Syntax

Visual Basic
Public Sub DoubleClick()

See Also

GuiStatusbar Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiStatusbar Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiStatusbar Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiStatusbar Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiStatusbar Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiStatusbar Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiStatusbar Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiStatusbar Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiStatusbar Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiStatusbar Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiStatusbar Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiStatusbar Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiStatusbar Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiStatusbar Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiStatusbar Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiStatusbar Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiStatusbar Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiStatusbar Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiStatusbar Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiStatusbar Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiStatusbar Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiStatusbar Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiStatusbar Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiStatusbar Object


MessageAsPopup Property

MessageAsPopup Property

Description

Some messages may be displayed not only on the statusbar but also as a pop-up window. In such cases, this property is set to True so that a script knows it has to close a pop-up to continue.

Property type

Read-only property

Syntax

Visual Basic
Public Property MessageAsPopup() As Byte

See Also

GuiStatusbar Object


MessageId Property

MessageId Property

Description

This is the name of the message class used in the ABAP message call.

Property type

Read-only property

Syntax

Visual Basic
Public Property MessageId() As String

See Also

GuiStatusbar Object


MessageNumber Property

MessageNumber Property

Description

This is the name of the message number used in the ABAP message call. It will usually be a number, but this is not enforced by the system.

Property type

Read-only property

Syntax

Visual Basic
Public Property MessageNumber() As String

See Also

GuiStatusbar Object


MessageParameter Property

MessageParameter Property
Index

Description

These are the values of the parameters used to expand the placeholders in the message text definition in the data dictionary. The text property of the GuiStatusbar already contains the expanded text of the message. A maximum of 8 parameter values can be provided in the ABAP coding, so index should be in the range from 0 to 7.

Property type

Read-only property

Syntax

Visual Basic
Public Property MessageParameter( _
   ByVal Index As Long _
) As String

Parameters

Index

Example

The ABAP language line
message e319(01) with 'test1' 'test2' 'test3' 'test4'.

will result in the following property values:
Text = E: test1 test2 test3 test4
Type = E
Id = 01
Number = 319
Parameter 0 = test1
Parameter 1 = test2
Parameter 2 = test3
Parameter 3 = test4
Parameter 4 =
Parameter 5 =
Parameter 6 =
Parameter 7 =
as Popup = False

The message 319 in message class 01 is defined as ‘ & & & &’, with ‘&’ being a placeholder.

See Also

GuiStatusbar Object


MessageType Property

MessageType Property

Description

This property may have any of the following values:

Value | Description
S | Success
W | Warning
E | Error
A | Abort
I | Information

Property type

Read-only property

Syntax

Visual Basic
Public Property MessageType() As String

See Also

GuiStatusbar Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiStatusbar Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiStatusbar Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiStatusbar Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiStatusbar Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiStatusbar Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiStatusbar Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiStatusbar Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiStatusbar Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiStatusbar Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiStatusbar Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiStatusbar Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiStatusbar Object


GuiStatusPane Object

GuiStatusPane Object
See Also Members

Object Model

See Also

GuiStatusPane Members


GuiStatusPane Object Members

GuiStatusPane Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiStatusPane Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiStatusPane Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiStatusPane Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiStatusPane Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiStatusPane Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiStatusPane Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiStatusPane Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiStatusPane Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiStatusPane Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiStatusPane Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiStatusPane Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiStatusPane Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiStatusPane Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiStatusPane Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiStatusPane Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiStatusPane Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiStatusPane Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiStatusPane Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiStatusPane Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiStatusPane Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiStatusPane Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiStatusPane Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiStatusPane Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiStatusPane Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiStatusPane Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiStatusPane Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiStatusPane Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiStatusPane Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiStatusPane Object


GuiTab Object

GuiTab Object
See Also Members

Description

The GuiTab objects are the children of a GuiTabStrip object. GuiTab extends GuiVContainer. The type prefix is tabp, the name is the id of the tab’s button taken from SAP data dictionary.

Object Model

See Also

GuiTab Members


GuiTab Object Members

GuiTab Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method ScrollToLeft | ScrollToLeft shifts the tabs so that a certain tab becomes the leftTab of the tab strip.
Public Method Select | This function sets the tab to be the tab strip’s selected tab. Changing the selected tab of a tab strip may cause server communication.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiTab Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiTab Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTab Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTab Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiTab Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiTab Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiTab Object


ScrollToLeft Method

ScrollToLeft Method

Description

ScrollToLeft shifts the tabs so that a certain tab becomes the leftTab of the tab strip.

Syntax

Visual Basic
Public Sub ScrollToLeft()

See Also

GuiTab Object


Select Method

Select Method

Description

This function sets the tab to be the tab strip’s selected tab. Changing the selected tab of a tab strip may cause server communication.

Syntax

Visual Basic
Public Sub Select()

See Also

GuiTab Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiTab Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiTab Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiTab Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiTab Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiTab Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiTab Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiTab Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiTab Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiTab Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiTab Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiTab Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiTab Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiTab Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiTab Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiTab Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiTab Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiTab Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiTab Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiTab Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiTab Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiTab Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiTab Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiTab Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiTab Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiTab Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiTab Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiTab Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiTab Object


GuiTableColumn Collection

GuiTableColumn Collection
See Also Members

Description

GuiTableColumn extends GuiComponentCollection.

Object Model

See Also

GuiTableColumn Members


GuiTableColumn Collection Members

GuiTableColumn Collection Members
See Also Overview

Public Methods

Public Method ElementAt
Public Method Item

Public Properties

Public Property Count |
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Fixed | Some columns may be fixed, which means that they will not be scrolled with the rest of the columns.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Length |
Public Property NewEnum |
Public Property Selected |
Public Property Title | This is the caption of the column.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

See Also

GuiTableColumn Overview


ElementAt Method

ElementAt Method
Index

Syntax

Visual Basic
Public Function ElementAt( _
   ByVal Index As Long _
) As GuiComponent

Parameters

Index

See Also

GuiTableColumn Collection


Item Method

Item Method
Index

Syntax

Visual Basic
Public Function Item( _
   ByVal Index As Variant _
) As GuiComponent

Parameters

Index

See Also

GuiTableColumn Collection


Count Property

Count Property

Property type

Read-only property

Syntax

Visual Basic
Public Property Count() As Long

See Also

GuiTableColumn Collection


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiTableColumn Collection


Fixed Property

Fixed Property

Description

Some columns may be fixed, which means that they will not be scrolled with the rest of the columns.

Property type

Read-only property

Syntax

Visual Basic
Public Property Fixed() As Byte

Example

In the following example the column ‘User’ is selected:

See Also

GuiTableColumn Collection


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiTableColumn Collection


Length Property

Length Property

Property type

Read-only property

Syntax

Visual Basic
Public Property Length() As Long

See Also

GuiTableColumn Collection


NewEnum Property

NewEnum Property

Property type

Read-only property

Syntax

Visual Basic
Public Property NewEnum() As Unknown

See Also

GuiTableColumn Collection


Selected Property

Selected Property

Property type

Read-write property

Syntax

Visual Basic
Public Property Selected() As Byte

See Also

GuiTableColumn Collection


Title Property

Title Property

Description

This is the caption of the column.

Property type

Read-only property

Syntax

Visual Basic
Public Property Title() As String

Example

In the example above the script
MsgBox session.findById ("wnd[0]/usr/tblSAPMBIBSTC535").columns(3).title
displays the text ‘Account’.

See Also

GuiTableColumn Collection


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiTableColumn Collection


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiTableColumn Collection


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiTableColumn Collection


GuiTableControl Object

GuiTableControl Object
See Also Members

Description

The table control is a standard dynpro element, in contrast to the GuiCtrlGridView, which looks similar. GuiTableControl extends GuiVContainer. The type prefix is tbl, the name is the fieldname taken from the SAP data dictionary.

Object Model

Example

See Also

GuiTableControl Members


GuiTableControl Object Members

GuiTableControl Object Members
See Also Overview

Public Methods

Public Method ConfigureLayout | In the configuration dialog the layout of the table can be changed. This dialog is a GuiModalWindow.
Public Method DeselectAllColumns | This function can be used for table controls with a button that allows to de-select all columns in one step.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method GetAbsoluteRow | Unlike the rows collection, the indexing supported by this function does not reset the index after scrolling, but counts the rows starting with the first row with respect to the first scroll position. If the selected row is not currently visible then an exception is raised.
Public Method GetCell | This method returns a given table cell. It is more efficient than accessing a single cell using the rows or columns collections.
Public Method ReorderTable | The parameter permutation describes a new ordering of the columns. For example “1 3 2” will move column 3 to second position.
Public Method SelectAllColumns | This function can be used for table controls with a button that allows to select all columns in one step.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property Children | This collection contains all direct children of the object.
Public Property ColSelectMode | There are three different modes for selecting columns or rows, which are defined in the enumeration type GuiTableSelectionType.
Public Property Columns | The members of this collection are of GuiTableColumn type. Therefore they do not support properties like id or name.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentCol | Zero-based index of the current column.
Public Property CurrentRow | Zero-based index of the current row.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property HorizontalScrollbar | The horizontal scrollbar of the table control.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property RowCount | Number of rows in the table. This includes invisible rows. For the number of visible rows the property VisibleRowCount is available.
Public Property Rows | The members of this collection are of GuiTableRow type. Indexing starts with 0 for the first visible row, independent of the current position of the horizontal scrollbar. After scrolling, a different row will have the index 0.
Public Property RowSelectMode | There are three different modes for selecting columns or rows, which are defined in the enumeration type GuiTableSelectionType.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property TableFieldName | The name property of the table control contains the ABAP program name in addition to the plain field name. This property contains just the field name.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property VerticalScrollbar | The vertical scrollbar of the table control.
Public Property VisibleRowCount | Number of visible rows in the table. For the number of all rows the property RowCount is available.
Public Property Width | Width of the component in pixels.

See Also

GuiTableControl Overview


ConfigureLayout Method

ConfigureLayout Method

Description

In the configuration dialog the layout of the table can be changed. This dialog is a GuiModalWindow.

Syntax

Visual Basic
Public Sub ConfigureLayout()

Example

See Also

GuiTableControl Object


DeselectAllColumns Method

DeselectAllColumns Method

Description

This function can be used for table controls with a button that allows to de-select all columns in one step.

Syntax

Visual Basic
Public Sub DeselectAllColumns()

See Also

GuiTableControl Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiTableControl Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTableControl Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTableControl Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiTableControl Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiTableControl Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiTableControl Object


GetAbsoluteRow Method

GetAbsoluteRow Method
Index

Description

Unlike the rows collection, the indexing supported by this function does not reset the index after scrolling, but counts the rows starting with the first row with respect to the first scroll position. If the selected row is not currently visible then an exception is raised.

Syntax

Visual Basic
Public Function GetAbsoluteRow( _
   ByVal Index As Long _
) As GuiTableRow

Parameters

Index

See Also

GuiTableControl Object


GetCell Method

GetCell Method
Row
Zero-based index of the row.
Column
Zero-based index of the column.

Description

This method returns a given table cell. It is more efficient than accessing a single cell using the rows or columns collections.

Syntax

Visual Basic
Public Function GetCell( _
   ByVal Row As Long, _
   ByVal Column As Long _
) As GuiVComponent

Parameters

Row
Zero-based index of the row.
Column
Zero-based index of the column.

See Also

GuiTableControl Object


ReorderTable Method

ReorderTable Method
Permutation

Description

The parameter permutation describes a new ordering of the columns. For example “1 3 2” will move column 3 to second position.

Syntax

Visual Basic
Public Sub ReorderTable( _
   ByVal Permutation As String _
)

Parameters

Permutation

See Also

GuiTableControl Object


SelectAllColumns Method

SelectAllColumns Method

Description

This function can be used for table controls with a button that allows to select all columns in one step.

Syntax

Visual Basic
Public Sub SelectAllColumns()

See Also

GuiTableControl Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiTableControl Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiTableControl Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiTableControl Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiTableControl Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiTableControl Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiTableControl Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiTableControl Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiTableControl Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiTableControl Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiTableControl Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiTableControl Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiTableControl Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiTableControl Object


ColSelectMode Property

ColSelectMode Property

Description

There are three different modes for selecting columns or rows, which are defined in the enumeration type GuiTableSelectionType.

Property type

Read-only property

Syntax

Visual Basic
Public Property ColSelectMode() As GuiTableSelectionType

See Also

GuiTableControl Object


Columns Property

Columns Property

Description

The members of this collection are of GuiTableColumn type. Therefore they do not support properties like id or name.

Property type

Read-only property

Syntax

Visual Basic
Public Property Columns() As GuiCollection

See Also

GuiTableControl Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiTableControl Object


CurrentCol Property

CurrentCol Property

Description

Zero-based index of the current column.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentCol() As Long

See Also

GuiTableControl Object


CurrentRow Property

CurrentRow Property

Description

Zero-based index of the current row.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentRow() As Long

See Also

GuiTableControl Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiTableControl Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiTableControl Object


HorizontalScrollbar Property

HorizontalScrollbar Property

Description

The horizontal scrollbar of the table control.

Property type

Read-only property

Syntax

Visual Basic
Public Property HorizontalScrollbar() As GuiScrollbar

See Also

GuiTableControl Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiTableControl Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiTableControl Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiTableControl Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiTableControl Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiTableControl Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiTableControl Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiTableControl Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiTableControl Object


RowCount Property

RowCount Property

Description

Number of rows in the table. This includes invisible rows. For the number of visible rows the property VisibleRowCount is available.

Property type

Read-only property

Syntax

Visual Basic
Public Property RowCount() As Long

See Also

GuiTableControl Object


Rows Property

Rows Property

Description

The members of this collection are of GuiTableRow type. Indexing starts with 0 for the first visible row, independent of the current position of the horizontal scrollbar. After scrolling, a different row will have the index 0.

Property type

Read-only property

Syntax

Visual Basic
Public Property Rows() As GuiCollection

See Also

GuiTableControl Object


RowSelectMode Property

RowSelectMode Property

Description

There are three different modes for selecting columns or rows, which are defined in the enumeration type GuiTableSelectionType.

Property type

Read-only property

Syntax

Visual Basic
Public Property RowSelectMode() As GuiTableSelectionType

See Also

GuiTableControl Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiTableControl Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiTableControl Object


TableFieldName Property

TableFieldName Property

Description

The name property of the table control contains the ABAP program name in addition to the plain field name. This property contains just the field name.

Property type

Read-only property

Syntax

Visual Basic
Public Property TableFieldName() As String

See Also

GuiTableControl Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiTableControl Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiTableControl Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiTableControl Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiTableControl Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiTableControl Object


VerticalScrollbar Property

VerticalScrollbar Property

Description

The vertical scrollbar of the table control.

Property type

Read-only property

Syntax

Visual Basic
Public Property VerticalScrollbar() As GuiScrollbar

See Also

GuiTableControl Object


VisibleRowCount Property

VisibleRowCount Property

Description

Number of visible rows in the table. For the number of all rows the property RowCount is available.

Property type

Read-only property

Syntax

Visual Basic
Public Property VisibleRowCount() As Long

See Also

GuiTableControl Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiTableControl Object


GuiTableRow Collection

GuiTableRow Collection
See Also Members

Description

GuiTableRow extends GuiComponentCollection.

Object Model

See Also

GuiTableRow Members


GuiTableRow Collection Members

GuiTableRow Collection Members
See Also Overview

Public Methods

Public Method ElementAt
Public Method Item

Public Properties

Public Property Count | Number of cells in the row.
Public Property Length | Number of cells in the row.
Public Property NewEnum | Property for VB collection handling.
Public Property Selectable | This propergy is True if the row can be selected.
Public Property Selected | This property is true if the row is selected.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

See Also

GuiTableRow Overview


ElementAt Method

ElementAt Method
Index

Syntax

Visual Basic
Public Function ElementAt( _
   ByVal Index As Long _
) As GuiComponent

Parameters

Index

See Also

GuiTableRow Collection


Item Method

Item Method
Index

Syntax

Visual Basic
Public Function Item( _
   ByVal Index As Variant _
) As GuiComponent

Parameters

Index

See Also

GuiTableRow Collection


Count Property

Count Property

Description

Number of cells in the row.

Property type

Read-only property

Syntax

Visual Basic
Public Property Count() As Long

See Also

GuiTableRow Collection


Length Property

Length Property

Description

Number of cells in the row.

Property type

Read-only property

Syntax

Visual Basic
Public Property Length() As Long

See Also

GuiTableRow Collection


NewEnum Property

NewEnum Property

Description

Property for VB collection handling.

Property type

Read-only property

Syntax

Visual Basic
Public Property NewEnum() As Unknown

See Also

GuiTableRow Collection


Selectable Property

Selectable Property

Description

This propergy is True if the row can be selected.

Property type

Read-write property

Syntax

Visual Basic
Public Property Selectable() As Byte

See Also

GuiTableRow Collection


Selected Property

Selected Property

Description

This property is true if the row is selected.

Property type

Read-write property

Syntax

Visual Basic
Public Property Selected() As Byte

Example

In this example multiple lines are selected.

See Also

GuiTableRow Collection


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiTableRow Collection


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiTableRow Collection


GuiTabStrip Object

GuiTabStrip Object
See Also Members

Description

A tab strip is a container whose children are of type GuiTab. GuiTabStrip extends GuiVContainer. The type prefix is tabs, the name is the fieldname taken from the SAP data dictionary.

Object Model

Example

The children of the tab strip are the tabs. While all tabs are available at any given time, only the children of the selected tab exist in the object hierarchy for server driven tab strips. So in this example, the text field ‘Applicant no.’ can only be found if the tab labelled ‘General data’ has been selected.

In some transactions there are local tabs strips where all tabs are available without further server access being required.

See Also

GuiTabStrip Members


GuiTabStrip Object Members

GuiTabStrip Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property LeftTab | This is the left most tab whose caption is visible. In the example above it is the one with text ‘Period closing’. The leftTab property can be changed by calling the ScrollToLeft method of a different GuiTab, as described below.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SelectedTab | The selected tab is the one whose descendants are currently visualized, in the example above it is the ‘General data’ tab. The selected tab has exactly one child, which is a GuiScrollContainer.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiTabStrip Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiTabStrip Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTabStrip Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTabStrip Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiTabStrip Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiTabStrip Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiTabStrip Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiTabStrip Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiTabStrip Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiTabStrip Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiTabStrip Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiTabStrip Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiTabStrip Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiTabStrip Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiTabStrip Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiTabStrip Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiTabStrip Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiTabStrip Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiTabStrip Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiTabStrip Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiTabStrip Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiTabStrip Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiTabStrip Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiTabStrip Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiTabStrip Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiTabStrip Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiTabStrip Object


LeftTab Property

LeftTab Property

Description

This is the left most tab whose caption is visible. In the example above it is the one with text ‘Period closing’. The leftTab property can be changed by calling the ScrollToLeft method of a different GuiTab, as described below.

Property type

Read-only property

Syntax

Visual Basic
Public Property LeftTab() As GuiTab

See Also

GuiTabStrip Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiTabStrip Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiTabStrip Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiTabStrip Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiTabStrip Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiTabStrip Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiTabStrip Object


SelectedTab Property

SelectedTab Property

Description

The selected tab is the one whose descendants are currently visualized, in the example above it is the ‘General data’ tab. The selected tab has exactly one child, which is a GuiScrollContainer.

Property type

Read-only property

Syntax

Visual Basic
Public Property SelectedTab() As GuiTab

See Also

GuiTabStrip Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiTabStrip Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiTabStrip Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiTabStrip Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiTabStrip Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiTabStrip Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiTabStrip Object


GuiTextedit Object

GuiTextedit Object
See Also Members

Description

The TextEdit control is a multiline edit control offering a number of possible benefits. With regard to scripting, the possibility of protecting text parts against editing by the user is especially useful.

Object Model

See Also

GuiTextedit Members


GuiTextedit Object Members

GuiTextedit Object Members
See Also Overview

Public Methods

Public Method ContextMenu | Calling ContextMenu emulates the context menu request.
Public Method DoubleClick | This function emulates a mouse double click. For setting the selection, the function setSelectionIndexes can be called in advance.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method GetLineText | Returns the text of the specified line.
Public Method GetUnprotectedTextPart | This function retrieves the content of an unprotected text part using the zero based index part.
Public Method IsBreakpointLine | Returns TRUE if the specified line contains a breakpoint .
Public Method IsCommentLine | Returns TRUE if the specified line is a comment line.
Public Method IsHighlightedLine | Returns TRUE if the specified line is highlighted.
Public Method IsProtectedLine | Returns TRUE if the specified line is protected.
Public Method IsSelectedLine | Returns TRUE if the specified line is selected.
Public Method ModifiedStatusChanged | This function emulates the change of the modified status.
Public Method MultipleFilesDropped | Emulate a Drag&Drop operation, in which several files are dropped on the textedit control. The collection contains for each file the fully qualified file name as a string.
Public Method PressF1 | This function emulates pressing the F1 key on the keyboard.
Public Method PressF4 | This function emulates pressing the F4 key on the keyboard.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method SetSelectionIndexes | This function sets the visually selected text range. start and end are absolute, zero based character indexes. start corresponds to the position where the selection begins and end is the position of the first character following the selection. Note that setting start equal to end results in setting the cursor on this position.
Public Method SetUnprotectedTextPart | This function assigns the content of text to the unprotected text part with zero based index part. The function returns True if it was possible to perform the assignment. Otherwise, False is returned.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method SingleFileDropped | This function emulates the drop of a single file with the directory path fileName.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentColumn | The number of the column in which the text caret is currently positioned.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property CurrentLine | The number of the line in which the text caret is currently positioned.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property FirstVisibleLine | The first visible line is visualized at the top border of the control.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property LastVisibleLine | The number of the last line that is currently visible.
Public Property Left | Left position of the element in screen coordinates
Public Property LineCount | The number of all lines in the current document.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property NumberOfUnprotectedTextParts | The number of unprotected text parts which are contained.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SelectedText | The currently selected text.
Public Property SelectionEndColumn | The number of the column in which the current selection ends.
Public Property SelectionEndLine | The number of the line in which the current selection ends.
Public Property SelectionIndexEnd | Retrieves the absolute, zero based character index of the ending point from the visually selected text range, i.e. the position where the selection ends. Note that a selection can be degenerated, i.e. selectionIndexStart is equal to selectionIndexEnd.
Public Property SelectionIndexStart | Retrieves the absolute, zero based character index of the starting point from the visually selected text range, i.e. the position, where the selection begins. Note that a selection can be degenerated, i.e. selectionIndexStart is equal to selectionIndexEnd.
Public Property SelectionStartColumn | The number of the column in which the current selection starts.
Public Property SelectionStartLine | The number of the line in which the current selection starts.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “TextEdit”.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it. The value of this property represents the text contained in the control. Note that setting the text is denied if the control is in read only mode or a certain text part is protected.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiTextedit Overview


ContextMenu Method

ContextMenu Method

Description

Calling ContextMenu emulates the context menu request.

Syntax

Visual Basic
Public Sub ContextMenu()

See Also

GuiTextedit Object


DoubleClick Method

DoubleClick Method

Description

This function emulates a mouse double click. For setting the selection, the function setSelectionIndexes can be called in advance.

Syntax

Visual Basic
Public Sub DoubleClick()

See Also

GuiTextedit Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiTextedit Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTextedit Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTextedit Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiTextedit Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiTextedit Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiTextedit Object


GetLineText Method

GetLineText Method
nLine
Index of the line

Description

Returns the text of the specified line.

Syntax

Visual Basic
Public Function GetLineText( _
   ByVal nLine As Long _
) As String

Parameters

nLine
Index of the line

See Also

GuiTextedit Object


GetUnprotectedTextPart Method

GetUnprotectedTextPart Method
Part

Description

This function retrieves the content of an unprotected text part using the zero based index part.

Syntax

Visual Basic
Public Function GetUnprotectedTextPart( _
   ByVal Part As Long _
) As String

Parameters

Part

See Also

GuiTextedit Object


IsBreakpointLine Method

IsBreakpointLine Method
nLine

Description

Returns TRUE if the specified line contains a breakpoint .

Syntax

Visual Basic
Public Function IsBreakpointLine( _
   ByVal nLine As Long _
) As Byte

Parameters

nLine

See Also

GuiTextedit Object


IsCommentLine Method

IsCommentLine Method
nLine

Description

Returns TRUE if the specified line is a comment line.

Syntax

Visual Basic
Public Function IsCommentLine( _
   ByVal nLine As Long _
) As Byte

Parameters

nLine

See Also

GuiTextedit Object


IsHighlightedLine Method

IsHighlightedLine Method
nLine

Description

Returns TRUE if the specified line is highlighted.

Syntax

Visual Basic
Public Function IsHighlightedLine( _
   ByVal nLine As Long _
) As Byte

Parameters

nLine

See Also

GuiTextedit Object


IsProtectedLine Method

IsProtectedLine Method
nLine

Description

Returns TRUE if the specified line is protected.

Syntax

Visual Basic
Public Function IsProtectedLine( _
   ByVal nLine As Long _
) As Byte

Parameters

nLine

See Also

GuiTextedit Object


IsSelectedLine Method

IsSelectedLine Method
nLine

Description

Returns TRUE if the specified line is selected.

Syntax

Visual Basic
Public Function IsSelectedLine( _
   ByVal nLine As Long _
) As Byte

Parameters

nLine

See Also

GuiTextedit Object


ModifiedStatusChanged Method

ModifiedStatusChanged Method
Status

Description

This function emulates the change of the modified status.

Syntax

Visual Basic
Public Sub ModifiedStatusChanged( _
   ByVal Status As Boolean _
)

Parameters

Status

See Also

GuiTextedit Object


MultipleFilesDropped Method

MultipleFilesDropped Method

Description

Emulate a Drag&Drop operation, in which several files are dropped on the textedit control. The collection contains for each file the fully qualified file name as a string.

Syntax

Visual Basic
Public Sub MultipleFilesDropped()

See Also

GuiTextedit Object


PressF1 Method

PressF1 Method

Description

This function emulates pressing the F1 key on the keyboard.

Syntax

Visual Basic
Public Sub PressF1()

See Also

GuiTextedit Object


PressF4 Method

PressF4 Method

Description

This function emulates pressing the F4 key on the keyboard.

Syntax

Visual Basic
Public Sub PressF4()

See Also

GuiTextedit Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiTextedit Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiTextedit Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiTextedit Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiTextedit Object


SetSelectionIndexes Method

SetSelectionIndexes Method
Start
End

Description

This function sets the visually selected text range. start and end are absolute, zero based character indexes. start corresponds to the position where the selection begins and end is the position of the first character following the selection. Note that setting start equal to end results in setting the cursor on this position.

Syntax

Visual Basic
Public Sub SetSelectionIndexes( _
   ByVal Start As Long, _
   ByVal End As Long _
)

Parameters

Start
End

See Also

GuiTextedit Object


SetUnprotectedTextPart Method

SetUnprotectedTextPart Method
Part
Text

Description

This function assigns the content of text to the unprotected text part with zero based index part. The function returns True if it was possible to perform the assignment. Otherwise, False is returned.

Syntax

Visual Basic
Public Function SetUnprotectedTextPart( _
   ByVal Part As Long, _
   ByVal Text As String _
) As Byte

Parameters

Part
Text

See Also

GuiTextedit Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiTextedit Object


SingleFileDropped Method

SingleFileDropped Method
Filename

Description

This function emulates the drop of a single file with the directory path fileName.

Syntax

Visual Basic
Public Sub SingleFileDropped( _
   ByVal Filename As String _
)

Parameters

Filename

See Also

GuiTextedit Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiTextedit Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiTextedit Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiTextedit Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiTextedit Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiTextedit Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiTextedit Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiTextedit Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiTextedit Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiTextedit Object


CurrentColumn Property

CurrentColumn Property

Description

The number of the column in which the text caret is currently positioned.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentColumn() As Long

See Also

GuiTextedit Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiTextedit Object


CurrentLine Property

CurrentLine Property

Description

The number of the line in which the text caret is currently positioned.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentLine() As Long

See Also

GuiTextedit Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiTextedit Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiTextedit Object


FirstVisibleLine Property

FirstVisibleLine Property

Description

The first visible line is visualized at the top border of the control.

Property type

Read-write property

Syntax

Visual Basic
Public Property FirstVisibleLine() As Long

See Also

GuiTextedit Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiTextedit Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiTextedit Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiTextedit Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiTextedit Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiTextedit Object


LastVisibleLine Property

LastVisibleLine Property

Description

The number of the last line that is currently visible.

Property type

Read-only property

Syntax

Visual Basic
Public Property LastVisibleLine() As Long

See Also

GuiTextedit Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiTextedit Object


LineCount Property

LineCount Property

Description

The number of all lines in the current document.

Property type

Read-only property

Syntax

Visual Basic
Public Property LineCount() As Long

See Also

GuiTextedit Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiTextedit Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiTextedit Object


NumberOfUnprotectedTextParts Property

NumberOfUnprotectedTextParts Property

Description

The number of unprotected text parts which are contained.

Property type

Read-only property

Syntax

Visual Basic
Public Property NumberOfUnprotectedTextParts() As Long

See Also

GuiTextedit Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiTextedit Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiTextedit Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiTextedit Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiTextedit Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiTextedit Object


SelectedText Property

SelectedText Property

Description

The currently selected text.

Property type

Read-only property

Syntax

Visual Basic
Public Property SelectedText() As String

See Also

GuiTextedit Object


SelectionEndColumn Property

SelectionEndColumn Property

Description

The number of the column in which the current selection ends.

Property type

Read-only property

Syntax

Visual Basic
Public Property SelectionEndColumn() As Long

See Also

GuiTextedit Object


SelectionEndLine Property

SelectionEndLine Property

Description

The number of the line in which the current selection ends.

Property type

Read-only property

Syntax

Visual Basic
Public Property SelectionEndLine() As Long

See Also

GuiTextedit Object


SelectionIndexEnd Property

SelectionIndexEnd Property

Description

Retrieves the absolute, zero based character index of the ending point from the visually selected text range, i.e. the position where the selection ends. Note that a selection can be degenerated, i.e. selectionIndexStart is equal to selectionIndexEnd.

Property type

Read-only property

Syntax

Visual Basic
Public Property SelectionIndexEnd() As Long

See Also

GuiTextedit Object


SelectionIndexStart Property

SelectionIndexStart Property

Description

Retrieves the absolute, zero based character index of the starting point from the visually selected text range, i.e. the position, where the selection begins. Note that a selection can be degenerated, i.e. selectionIndexStart is equal to selectionIndexEnd.

Property type

Read-only property

Syntax

Visual Basic
Public Property SelectionIndexStart() As Long

See Also

GuiTextedit Object


SelectionStartColumn Property

SelectionStartColumn Property

Description

The number of the column in which the current selection starts.

Property type

Read-only property

Syntax

Visual Basic
Public Property SelectionStartColumn() As Long

See Also

GuiTextedit Object


SelectionStartLine Property

SelectionStartLine Property

Description

The number of the line in which the current selection starts.

Property type

Read-only property

Syntax

Visual Basic
Public Property SelectionStartLine() As Long

See Also

GuiTextedit Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “TextEdit”.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiTextedit Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it. The value of this property represents the text contained in the control. Note that setting the text is denied if the control is in read only mode or a certain text part is protected.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiTextedit Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiTextedit Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiTextedit Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiTextedit Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiTextedit Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiTextedit Object


GuiTextField Object

GuiTextField Object
See Also Members

Description

GuiTextField extends GuiVComponent. The type prefix is txt, the name is the fieldname taken from the SAP data dictionary.

Object Model

See Also

GuiTextField Members


GuiTextField Object Members

GuiTextField Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method GetListProperty | This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes.
Public Method GetListPropertyNonRec | This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes. In contrast to the method GetListProperty, GetListPropertyNonRec will only return information that is set for the specific element, and ignore list properties set for parent elements.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property CaretPosition | Position of the text caret in the input field. The position of the caret within a text field may be checked by the ABAP application to determine which word the caret is in. Among other things this is useful for context sensitive help.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property CharHeight | Height of the dynpro element in character metric.
Public Property CharLeft | Left coordinate of the dynpro element in character metric.
Public Property CharTop | Top coordinate of the dynpro element in character metric.
Public Property CharWidth | Width of the dynpro element in character metric.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DisplayedText | This property contains the text as it is displayed on the screen, including preceding or trailing blanks. These blanks are stripped from the text property.
Public Property Height | Height of the component in pixels.
Public Property Highlighted | This property is True if the Highlighted flag is set in the screen painter for the dynpro element. See GuiLabel for an example.
Public Property HistoryCurEntry | Text of the currently focussed entry in the history list box.
Public Property HistoryCurIndex | Currently focussed index in the history dropdown list box.
Public Property HistoryIsActive | This property is True if the local input field history drop down is currently open.
Public Property HistoryList | List of entries in the local history list box.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsHotspot | Dynpro elements such as labels may be configured to cause a round trip when they are clicked. In that case the mouse cursor changes to the hand shape. This is called a hot spot.
Public Property IsLeftLabel | This property is True if the component has the 'assign left' flag.
Public Property IsListElement | This property is True if the element is on an ABAP list, not a dynpro screen.
Public Property IsOField | OField is a special ABAP dynpro element, the Output Field. These fields can be set programmatically to a value at runtime. In this respect they differ from labels. However they can not be used to enter data, so they are not input fields.
Public Property IsRightLabel | This property is True if the component has the 'assign right' flag.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property LeftLabel | Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'. This label has been defined in ABAP Screen Painter to be the left label of the control.
Public Property MaxLength | Maximum length of the input field in number of characters. The maximum length of text that can be written in a text field is counted in code units. On non-Unicode clients these are equivalent to bytes.
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Numerical | This property is True if the component is an input field that only accepts numeric characters. If this flag is set only numbers and special characters may be written into the text field.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property Required | This property is True if the component is a required value for the screen.
Public Property RightLabel | Right label of the component. This property is set in screenpainter using the 'assign right' flag. This label has been defined in ABAP Screen Painter to be the right label of the control.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiTextField Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiTextField Object


GetListProperty Method

GetListProperty Method
Property

Description

This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes.

Syntax

Visual Basic
Public Function GetListProperty( _
   ByVal Property As String _
) As String

Parameters

Property

See Also

GuiTextField Object


GetListPropertyNonRec Method

GetListPropertyNonRec Method
Property

Description

This method returns information that is compiled on the server to enhance the ABAP lists with accessibility information. See GuiLabel::GetListProperty for a description of available attributes. In contrast to the method GetListProperty, GetListPropertyNonRec will only return information that is set for the specific element, and ignore list properties set for parent elements.

Syntax

Visual Basic
Public Function GetListPropertyNonRec( _
   ByVal Property As String _
) As String

Parameters

Property

See Also

GuiTextField Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiTextField Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiTextField Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiTextField Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiTextField Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiTextField Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiTextField Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiTextField Object


CaretPosition Property

CaretPosition Property

Description

Position of the text caret in the input field. The position of the caret within a text field may be checked by the ABAP application to determine which word the caret is in. Among other things this is useful for context sensitive help.

Property type

Read-write property

Syntax

Visual Basic
Public Property CaretPosition() As Long

See Also

GuiTextField Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiTextField Object


CharHeight Property

CharHeight Property

Description

Height of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharHeight() As Long

See Also

GuiTextField Object


CharLeft Property

CharLeft Property

Description

Left coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharLeft() As Long

See Also

GuiTextField Object


CharTop Property

CharTop Property

Description

Top coordinate of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharTop() As Long

See Also

GuiTextField Object


CharWidth Property

CharWidth Property

Description

Width of the dynpro element in character metric.

Property type

Read-only property

Syntax

Visual Basic
Public Property CharWidth() As Long

See Also

GuiTextField Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiTextField Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiTextField Object


DisplayedText Property

DisplayedText Property

Description

This property contains the text as it is displayed on the screen, including preceding or trailing blanks. These blanks are stripped from the text property.

Property type

Read-only property

Syntax

Visual Basic
Public Property DisplayedText() As String

See Also

GuiTextField Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiTextField Object


Highlighted Property

Highlighted Property

Description

This property is True if the Highlighted flag is set in the screen painter for the dynpro element. See GuiLabel for an example.

Property type

Read-only property

Syntax

Visual Basic
Public Property Highlighted() As Byte

See Also

GuiTextField Object


HistoryCurEntry Property

HistoryCurEntry Property

Description

Text of the currently focussed entry in the history list box.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryCurEntry() As String

See Also

GuiTextField Object


HistoryCurIndex Property

HistoryCurIndex Property

Description

Currently focussed index in the history dropdown list box.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryCurIndex() As Long

See Also

GuiTextField Object


HistoryIsActive Property

HistoryIsActive Property

Description

This property is True if the local input field history drop down is currently open.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryIsActive() As Byte

See Also

GuiTextField Object


HistoryList Property

HistoryList Property

Description

List of entries in the local history list box.

Property type

Read-only property

Syntax

Visual Basic
Public Property HistoryList() As GuiCollection

See Also

GuiTextField Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiTextField Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiTextField Object


IsHotspot Property

IsHotspot Property

Description

Dynpro elements such as labels may be configured to cause a round trip when they are clicked. In that case the mouse cursor changes to the hand shape. This is called a hot spot.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsHotspot() As Byte

See Also

GuiTextField Object


IsLeftLabel Property

IsLeftLabel Property

Description

This property is True if the component has the 'assign left' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsLeftLabel() As Byte

See Also

GuiTextField Object


IsListElement Property

IsListElement Property

Description

This property is True if the element is on an ABAP list, not a dynpro screen.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsListElement() As Byte

See Also

GuiTextField Object


IsOField Property

IsOField Property

Description

OField is a special ABAP dynpro element, the Output Field. These fields can be set programmatically to a value at runtime. In this respect they differ from labels. However they can not be used to enter data, so they are not input fields.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsOField() As Byte

See Also

GuiTextField Object


IsRightLabel Property

IsRightLabel Property

Description

This property is True if the component has the 'assign right' flag.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsRightLabel() As Byte

See Also

GuiTextField Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiTextField Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiTextField Object


LeftLabel Property

LeftLabel Property

Description

Left label of the component. The label is assigned in the screenpainter, using the flag 'assign left'. This label has been defined in ABAP Screen Painter to be the left label of the control.

Property type

Read-only property

Syntax

Visual Basic
Public Property LeftLabel() As GuiVComponent

See Also

GuiTextField Object


MaxLength Property

MaxLength Property

Description

Maximum length of the input field in number of characters. The maximum length of text that can be written in a text field is counted in code units. On non-Unicode clients these are equivalent to bytes.

Property type

Read-only property

Syntax

Visual Basic
Public Property MaxLength() As Long

See Also

GuiTextField Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiTextField Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiTextField Object


Numerical Property

Numerical Property

Description

This property is True if the component is an input field that only accepts numeric characters. If this flag is set only numbers and special characters may be written into the text field.

Property type

Read-only property

Syntax

Visual Basic
Public Property Numerical() As Byte

See Also

GuiTextField Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiTextField Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiTextField Object


Required Property

Required Property

Description

This property is True if the component is a required value for the screen.

Property type

Read-only property

Syntax

Visual Basic
Public Property Required() As Byte

Example

The following example shows the required text field for the user name, in both New Visual Design and in classic mode.

See Also

GuiTextField Object


RightLabel Property

RightLabel Property

Description

Right label of the component. This property is set in screenpainter using the 'assign right' flag. This label has been defined in ABAP Screen Painter to be the right label of the control.

Property type

Read-only property

Syntax

Visual Basic
Public Property RightLabel() As GuiVComponent

See Also

GuiTextField Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiTextField Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiTextField Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiTextField Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiTextField Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiTextField Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiTextField Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiTextField Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiTextField Object


GuiTitlebar Object

GuiTitlebar Object
See Also Members

Description

The titlebar is only displayed and exposed as a separate object in New Visual Design mode. GuiTitlebar extends GuiVContainer. The type prefix and name of GuiTitlebar are titl.

Object Model

Remarks

In some transactions the titlebar may contain objects of GuiGosShell type.

See Also

GuiTitlebar Members


GuiTitlebar Object Members

GuiTitlebar Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiTitlebar Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiTitlebar Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTitlebar Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTitlebar Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiTitlebar Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiTitlebar Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiTitlebar Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiTitlebar Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiTitlebar Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiTitlebar Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiTitlebar Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiTitlebar Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiTitlebar Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiTitlebar Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiTitlebar Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiTitlebar Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiTitlebar Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiTitlebar Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiTitlebar Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiTitlebar Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiTitlebar Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiTitlebar Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiTitlebar Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiTitlebar Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiTitlebar Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiTitlebar Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiTitlebar Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiTitlebar Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiTitlebar Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiTitlebar Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiTitlebar Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiTitlebar Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiTitlebar Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiTitlebar Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiTitlebar Object


GuiToolbar Object

GuiToolbar Object
See Also Members

Description

Every GuiFrameWindow has a GuiToolbar. The GuiMainWindow has two toolbars unless the second has been turned off by the ABAP application. The upper toolbar is the system toolbar, while the second toolbar is the application toolbar.

The children of a GuiToolbar are buttons. The indexes for toolbar buttons are determined by the virtual key values defined for the button.

GuiToolbar extends GuiVContainer. The type prefix and name are tbar.

Object Model

See Also

GuiToolbar Members


GuiToolbar Object Members

GuiToolbar Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiToolbar Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiToolbar Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiToolbar Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiToolbar Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiToolbar Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiToolbar Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiToolbar Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiToolbar Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiToolbar Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiToolbar Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiToolbar Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiToolbar Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiToolbar Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiToolbar Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiToolbar Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiToolbar Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiToolbar Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiToolbar Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiToolbar Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiToolbar Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiToolbar Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiToolbar Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiToolbar Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiToolbar Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiToolbar Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiToolbar Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiToolbar Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiToolbar Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiToolbar Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiToolbar Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiToolbar Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiToolbar Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiToolbar Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiToolbar Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiToolbar Object


GuiToolbarControl Object

GuiToolbarControl Object
See Also Members

Description

GuiToolbarControl extends GuiShell.

Object Model

See Also

GuiToolbarControl Members


GuiToolbarControl Object Members

GuiToolbarControl Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method GetButtonChecked | Returns if the button is currently checked (pressed).
Public Method GetButtonEnabled | Indicates if the button can be pressed.
Public Method GetButtonIcon | Returns the name of the icon of the specified toolbar button.
Public Method GetButtonId | Returns the ID of the specified toolbar button.
Public Method GetButtonText | Returns the text of the specified toolbar button.
Public Method GetButtonTooltip | Returns the tooltip of the specified toolbar button.
Public Method GetButtonType | Returns the type of the specified toolbar button. Possible values are: "Button", "ButtonAndMenu", "Menu", "Separator", "Group", "CheckBox"
Public Method GetMenuItemIdFromPosition | This function returns the identifier of the menu item with index Position.
Public Method PressButton | This function emulates pressing the button with the given id.
Public Method PressContextButton | This function emulates pressing the context button with the given id.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SelectMenuItem | This function emulates selecting the menu item with the given id.
Public Method SelectMenuItemByText | This function emulates selecting the menu item by menu item text.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property ButtonCount | The number of toolbar buttons including separators.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property FocusedButton | Zero-based index of the button that currently has the focus.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Toolbar”.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiToolbarControl Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiToolbarControl Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiToolbarControl Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiToolbarControl Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiToolbarControl Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiToolbarControl Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiToolbarControl Object


GetButtonChecked Method

GetButtonChecked Method
ButtonPos

Description

Returns if the button is currently checked (pressed).

Syntax

Visual Basic
Public Function GetButtonChecked( _
   ByVal ButtonPos As Long _
) As Byte

Parameters

ButtonPos

See Also

GuiToolbarControl Object


GetButtonEnabled Method

GetButtonEnabled Method
ButtonPos

Description

Indicates if the button can be pressed.

Syntax

Visual Basic
Public Function GetButtonEnabled( _
   ByVal ButtonPos As Long _
) As Byte

Parameters

ButtonPos

See Also

GuiToolbarControl Object


GetButtonIcon Method

GetButtonIcon Method
ButtonPos

Description

Returns the name of the icon of the specified toolbar button.

Syntax

Visual Basic
Public Function GetButtonIcon( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiToolbarControl Object


GetButtonId Method

GetButtonId Method
ButtonPos

Description

Returns the ID of the specified toolbar button.

Syntax

Visual Basic
Public Function GetButtonId( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiToolbarControl Object


GetButtonText Method

GetButtonText Method
ButtonPos

Description

Returns the text of the specified toolbar button.

Syntax

Visual Basic
Public Function GetButtonText( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiToolbarControl Object


GetButtonTooltip Method

GetButtonTooltip Method
ButtonPos

Description

Returns the tooltip of the specified toolbar button.

Syntax

Visual Basic
Public Function GetButtonTooltip( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiToolbarControl Object


GetButtonType Method

GetButtonType Method
ButtonPos

Description

Returns the type of the specified toolbar button. Possible values are:
"Button", "ButtonAndMenu", "Menu", "Separator", "Group", "CheckBox"

Syntax

Visual Basic
Public Function GetButtonType( _
   ByVal ButtonPos As Long _
) As String

Parameters

ButtonPos

See Also

GuiToolbarControl Object


GetMenuItemIdFromPosition Method

GetMenuItemIdFromPosition Method
Pos

Description

This function returns the identifier of the menu item with index Position.

Syntax

Visual Basic
Public Function GetMenuItemIdFromPosition( _
   ByVal Pos As Long _
) As String

Parameters

Pos

See Also

GuiToolbarControl Object


PressButton Method

PressButton Method
Id

Description

This function emulates pressing the button with the given id.

Syntax

Visual Basic
Public Sub PressButton( _
   ByVal Id As String _
)

Parameters

Id

See Also

GuiToolbarControl Object


PressContextButton Method

PressContextButton Method
Id

Description

This function emulates pressing the context button with the given id.

Syntax

Visual Basic
Public Sub PressContextButton( _
   ByVal Id As String _
)

Parameters

Id

See Also

GuiToolbarControl Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiToolbarControl Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiToolbarControl Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiToolbarControl Object


SelectMenuItem Method

SelectMenuItem Method
Id

Description

This function emulates selecting the menu item with the given id.

Syntax

Visual Basic
Public Sub SelectMenuItem( _
   ByVal Id As String _
)

Parameters

Id

See Also

GuiToolbarControl Object


SelectMenuItemByText Method

SelectMenuItemByText Method
strText

Description

This function emulates selecting the menu item by menu item text.

Syntax

Visual Basic
Public Sub SelectMenuItemByText( _
   ByVal strText As String _
)

Parameters

strText

See Also

GuiToolbarControl Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiToolbarControl Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiToolbarControl Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiToolbarControl Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiToolbarControl Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiToolbarControl Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiToolbarControl Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiToolbarControl Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiToolbarControl Object


ButtonCount Property

ButtonCount Property

Description

The number of toolbar buttons including separators.

Property type

Read-only property

Syntax

Visual Basic
Public Property ButtonCount() As Long

See Also

GuiToolbarControl Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiToolbarControl Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiToolbarControl Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiToolbarControl Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiToolbarControl Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiToolbarControl Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiToolbarControl Object


FocusedButton Property

FocusedButton Property

Description

Zero-based index of the button that currently has the focus.

Property type

Read-only property

Syntax

Visual Basic
Public Property FocusedButton() As Long

See Also

GuiToolbarControl Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiToolbarControl Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiToolbarControl Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiToolbarControl Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiToolbarControl Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiToolbarControl Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiToolbarControl Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiToolbarControl Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiToolbarControl Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiToolbarControl Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiToolbarControl Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiToolbarControl Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiToolbarControl Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiToolbarControl Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Toolbar”.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiToolbarControl Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiToolbarControl Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiToolbarControl Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiToolbarControl Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiToolbarControl Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiToolbarControl Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiToolbarControl Object


GuiTree Object

GuiTree Object
See Also Members

Object Model

Example

The Tree Control supports three Tree Types.

Simple Tree:

List Tree:

The List Tree can have a header:

Column Tree:

See Also

GuiTree Members


GuiTree Object Members

GuiTree Object Members
See Also Overview

Public Methods

Public Method ChangeCheckbox | This method emulates changing a checkbox state.
Public Method ClickLink | This function emulates triggering a link.
Public Method CollapseNode | This function closes the node with the key nodeKey.
Public Method DefaultContextMenu | This method requests a context menu for the whole Tree Control.
Public Method DoubleClickItem | This function emulates double clicking on a text item.
Public Method DoubleClickNode | This function emulates double clicking a node.
Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method EnsureVisibleHorizontalItem | This function scrolls the Tree horizontally until the Item is visible.
Public Method ExpandNode | This function expands the node with the key nodeKey.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method FindNodeKeyByPath
Public Method GetAbapImage
Public Method GetCheckBoxState | Retrieves the CheckBox state (1 = Checked, 0 = Unchecked).
Public Method GetColumnCol | The keys of all the items in the given column.
Public Method GetColumnHeaders | Collection of the titles of the columns.
Public Method GetColumnIndexFromName
Public Method GetColumnNames | Returns a collection of the column names.
Public Method GetColumnTitleFromName
Public Method GetColumnTitles
Public Method GetFocusedNodeKey
Public Method GetHierarchyLevel
Public Method GetHierarchyTitle | method GetHierarchyTitle
Public Method GetIsHighLighted
Public Method GetItemHeight | method GetItemHeight
Public Method GetItemLeft | method GetItemLeft
Public Method GetItemStyle
Public Method GetItemText | This function returns the text of the item specified by the key and name parameters.
Public Method GetItemTextColor
Public Method GetItemToolTip
Public Method GetItemTop | method GetItemTop
Public Method GetItemType Retrieves the column tree item type:
  • trvTreeStructureHierarchy = 0
  • trvTreeStructureImage = 1
  • trvTreeStructureText = 2
  • trvTreeStructureBool = 3
  • trvTreeStructureButton = 4
  • trvTreeStructureLink = 5
Public Method GetItemWidth | method GetItemWidth
Public Method GetListTreeNodeItemCount
Public Method GetNextNodeKey
Public Method GetNodeAbapImage
Public Method GetNodeChildrenCount
Public Method GetNodeChildrenCountByPath | This function returns the number of children of the node given by the path parameter.
Public Method GetNodeHeight | method GetNodeHeight
Public Method GetNodeIndex
Public Method GetNodeItemHeaders
Public Method GetNodeKeyByPath | Key of the node specified by the given path description.
Public Method GetNodeLeft | method GetNodeLeft
Public Method GetNodePathByKey | Given a node key, the path is retrieved (e.g. 2\1\2).
Public Method GetNodesCol | The collection contains the node keys of all the nodes in the tree.
Public Method GetNodeStyle
Public Method GetNodeTextByKey | This function returns the text of the node specified by the given key.
Public Method GetNodeTextByPath | The text of a node defined by the given path is returned.
Public Method GetNodeTextColor
Public Method GetNodeToolTip
Public Method GetNodeTop | method GetNodeTop
Public Method GetNodeWidth | method GetNodeWidth
Public Method GetParent | Key of the parent node of the node specified by the given key.
Public Method GetPreviousNodeKey
Public Method GetSelectedNodes
Public Method GetSelectionMode | The selection behaviour of a Tree Control instance is set once at the time of creation.
Public Method GetStyleDescription
Public Method GetSubNodesCol | Collection of the keys of all subnodes of the node specified by the given key.
Public Method GetTreeType The returned number has the following meaning:
  • 0 : Simple tree
  • 1 : List tree
  • 2 : Column tree
Public Method HeaderContextMenu | This method requests a context menu for a header.
Public Method IsFolder
Public Method IsFolderExpandable
Public Method IsFolderExpanded
Public Method ItemContextMenu | This method requests a context menu for an item.
Public Method NodeContextMenu | This method requests a context menu for a node.
Public Method PressButton | This method emulates pressing a button.
Public Method PressHeader | This method emulates clicking a header.
Public Method PressKey | This method emulates pressing a key.
Public Method SelectColumn | This function adds a column to the column selection. A node or item selection is removed.
Public Method SelectContextMenuItem | Select an item from the controls context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SelectedItemColumn
Public Method SelectedItemNode
Public Method SelectItem | This function emulates the selection of an item. This selection removes all other selections.
Public Method SelectNode | The node with the key nodeKey is added to the Node Selection.
Public Method SetCheckBoxState
Public Method SetColumnWidth | This function sets the width of a column in pixels.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method UnselectAll | All selections are removed.
Public Method UnselectColumn | This function removes a column from the column selection.
Public Method UnselectNode | The node with the key nodeKey is removed from the Node Selection.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccDescription | Accessibility description of the shell. This description can be used for shells that do not have a title element.
Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ColumnOrder | The property is used for working with a sequence of columns. The name of each column in the Column Tree must occur exactly once.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property DragDropSupported | This property is True if the shell allows drag and drop operations.
Public Property Handle | The window handle of the control that is connected to the GuiShell.
Public Property Height | Height of the component in pixels.
Public Property HierarchyHeaderWidth | The width of the Hierarchy Header in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property OcxEvents | Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property SelectedNode | This is the key of the currently selected node. Selecting a node removes other selections (that is Column Selection and Item Selection).
Public Property SubType | Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Tree”.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property TopNode | This property influences the vertical scrolling of the Tree Control. TopNode contains the key of the node that is located on the upper edge of the Tree Control. Setting a node x as top node is only possible if there are enough visible nodes below x to fill the display area of the Tree Control.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiTree Overview


ChangeCheckbox Method

ChangeCheckbox Method
NodeKey
ItemName
Checked

Description

This method emulates changing a checkbox state.

Syntax

Visual Basic
Public Sub ChangeCheckbox( _
   ByVal NodeKey As String, _
   ByVal ItemName As String, _
   ByVal Checked As Boolean _
)

Parameters

NodeKey
ItemName
Checked

See Also

GuiTree Object


ClickLink Method

ClickLink Method
NodeKey
ItemName

Description

This function emulates triggering a link.

Syntax

Visual Basic
Public Sub ClickLink( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
)

Parameters

NodeKey
ItemName

See Also

GuiTree Object


CollapseNode Method

CollapseNode Method
NodeKey

Description

This function closes the node with the key nodeKey.

Syntax

Visual Basic
Public Sub CollapseNode( _
   ByVal NodeKey As String _
)

Parameters

NodeKey

See Also

GuiTree Object


DefaultContextMenu Method

DefaultContextMenu Method

Description

This method requests a context menu for the whole Tree Control.

Syntax

Visual Basic
Public Sub DefaultContextMenu()

See Also

GuiTree Object


DoubleClickItem Method

DoubleClickItem Method
NodeKey
ItemName

Description

This function emulates double clicking on a text item.

Syntax

Visual Basic
Public Sub DoubleClickItem( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
)

Parameters

NodeKey
ItemName

See Also

GuiTree Object


DoubleClickNode Method

DoubleClickNode Method
NodeKey

Description

This function emulates double clicking a node.

Syntax

Visual Basic
Public Sub DoubleClickNode( _
   ByVal NodeKey As String _
)

Parameters

NodeKey

Remarks

If Item Selection is enabled, double clicking a node can only be performed by double clicking on the Folder/Leaf Symbol of the node.

See Also

GuiTree Object


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiTree Object


EnsureVisibleHorizontalItem Method

EnsureVisibleHorizontalItem Method
NodeKey
ItemName

Description

This function scrolls the Tree horizontally until the Item is visible.

Syntax

Visual Basic
Public Sub EnsureVisibleHorizontalItem( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
)

Parameters

NodeKey
ItemName

See Also

GuiTree Object


ExpandNode Method

ExpandNode Method
NodeKey

Description

This function expands the node with the key nodeKey.

Syntax

Visual Basic
Public Sub ExpandNode( _
   ByVal NodeKey As String _
)

Parameters

NodeKey

See Also

GuiTree Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTree Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiTree Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiTree Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiTree Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiTree Object


FindNodeKeyByPath Method

FindNodeKeyByPath Method
Path

Syntax

Visual Basic
Public Function FindNodeKeyByPath( _
   ByVal Path As String _
) As String

Parameters

Path

See Also

GuiTree Object


GetAbapImage Method

GetAbapImage Method
Key
Name

Syntax

Visual Basic
Public Function GetAbapImage( _
   ByVal Key As String, _
   ByVal Name As String _
) As String

Parameters

Key
Name

See Also

GuiTree Object


GetCheckBoxState Method

GetCheckBoxState Method
NodeKey
ItemName

Description

Retrieves the CheckBox state (1 = Checked, 0 = Unchecked).

Syntax

Visual Basic
Public Function GetCheckBoxState( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
) As Byte

Parameters

NodeKey
ItemName

See Also

GuiTree Object


GetColumnCol Method

GetColumnCol Method
colName

Description

The keys of all the items in the given column.

Syntax

Visual Basic
Public Function GetColumnCol( _
   ByVal colName As String _
) As Object

Parameters

colName

See Also

GuiTree Object


GetColumnHeaders Method

GetColumnHeaders Method

Description

Collection of the titles of the columns.

Syntax

Visual Basic
Public Function GetColumnHeaders() As Object

See Also

GuiTree Object


GetColumnIndexFromName Method

GetColumnIndexFromName Method
Key

Syntax

Visual Basic
Public Function GetColumnIndexFromName( _
   ByVal Key As String _
) As Long

Parameters

Key

See Also

GuiTree Object


GetColumnNames Method

GetColumnNames Method

Description

Returns a collection of the column names.

Syntax

Visual Basic
Public Function GetColumnNames() As Object

See Also

GuiTree Object


GetColumnTitleFromName Method

GetColumnTitleFromName Method
Key

Syntax

Visual Basic
Public Function GetColumnTitleFromName( _
   ByVal Key As String _
) As String

Parameters

Key

See Also

GuiTree Object


GetColumnTitles Method

GetColumnTitles Method

Syntax

Visual Basic
Public Function GetColumnTitles() As Object

See Also

GuiTree Object


GetFocusedNodeKey Method

GetFocusedNodeKey Method

Syntax

Visual Basic
Public Function GetFocusedNodeKey() As String

See Also

GuiTree Object


GetHierarchyLevel Method

GetHierarchyLevel Method
Key

Syntax

Visual Basic
Public Function GetHierarchyLevel( _
   ByVal Key As String _
) As Long

Parameters

Key

See Also

GuiTree Object


GetHierarchyTitle Method

GetHierarchyTitle Method

Description

method GetHierarchyTitle

Syntax

Visual Basic
Public Function GetHierarchyTitle() As String

See Also

GuiTree Object


GetIsHighLighted Method

GetIsHighLighted Method
NodeKey
ItemName

Syntax

Visual Basic
Public Function GetIsHighLighted( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
) As Byte

Parameters

NodeKey
ItemName

See Also

GuiTree Object


GetItemHeight Method

GetItemHeight Method
NodeKey
ItemName

Description

method GetItemHeight

Syntax

Visual Basic
Public Function GetItemHeight( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
) As Long

Parameters

NodeKey
ItemName

See Also

GuiTree Object


GetItemLeft Method

GetItemLeft Method
NodeKey
ItemName

Description

method GetItemLeft

Syntax

Visual Basic
Public Function GetItemLeft( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
) As Long

Parameters

NodeKey
ItemName

See Also

GuiTree Object


GetItemStyle Method

GetItemStyle Method
NodeKey
ItemName

Syntax

Visual Basic
Public Function GetItemStyle( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
) As Long

Parameters

NodeKey
ItemName

See Also

GuiTree Object


GetItemText Method

GetItemText Method
Key
Name

Description

This function returns the text of the item specified by the key and name parameters.

Syntax

Visual Basic
Public Function GetItemText( _
   ByVal Key As String, _
   ByVal Name As String _
) As String

Parameters

Key
Name

See Also

GuiTree Object


GetItemTextColor Method

GetItemTextColor Method
Key
Name

Syntax

Visual Basic
Public Function GetItemTextColor( _
   ByVal Key As String, _
   ByVal Name As String _
) As ULong

Parameters

Key
Name

See Also

GuiTree Object


GetItemToolTip Method

GetItemToolTip Method
Key
Name

Syntax

Visual Basic
Public Function GetItemToolTip( _
   ByVal Key As String, _
   ByVal Name As String _
) As String

Parameters

Key
Name

See Also

GuiTree Object


GetItemTop Method

GetItemTop Method
NodeKey
ItemName

Description

method GetItemTop

Syntax

Visual Basic
Public Function GetItemTop( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
) As Long

Parameters

NodeKey
ItemName

See Also

GuiTree Object


GetItemType Method

GetItemType Method
Key
Name

Description

Retrieves the column tree item type:

  • trvTreeStructureHierarchy = 0
  • trvTreeStructureImage = 1
  • trvTreeStructureText = 2
  • trvTreeStructureBool = 3
  • trvTreeStructureButton = 4
  • trvTreeStructureLink = 5

Syntax

Visual Basic
Public Function GetItemType( _
   ByVal Key As String, _
   ByVal Name As String _
) As Long

Parameters

Key
Name

See Also

GuiTree Object


GetItemWidth Method

GetItemWidth Method
NodeKey
ItemName

Description

method GetItemWidth

Syntax

Visual Basic
Public Function GetItemWidth( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
) As Long

Parameters

NodeKey
ItemName

See Also

GuiTree Object


GetListTreeNodeItemCount Method

GetListTreeNodeItemCount Method
NodeKey

Syntax

Visual Basic
Public Function GetListTreeNodeItemCount( _
   ByVal NodeKey As String _
) As Long

Parameters

NodeKey

See Also

GuiTree Object


GetNextNodeKey Method

GetNextNodeKey Method
NodeKey

Syntax

Visual Basic
Public Function GetNextNodeKey( _
   ByVal NodeKey As String _
) As String

Parameters

NodeKey

See Also

GuiTree Object


GetNodeAbapImage Method

GetNodeAbapImage Method
Key

Syntax

Visual Basic
Public Function GetNodeAbapImage( _
   ByVal Key As String _
) As String

Parameters

Key

See Also

GuiTree Object


GetNodeChildrenCount Method

GetNodeChildrenCount Method
Key

Syntax

Visual Basic
Public Function GetNodeChildrenCount( _
   ByVal Key As String _
) As Long

Parameters

Key

See Also

GuiTree Object


GetNodeChildrenCountByPath Method

GetNodeChildrenCountByPath Method
Path

Description

This function returns the number of children of the node given by the path parameter.

Syntax

Visual Basic
Public Function GetNodeChildrenCountByPath( _
   ByVal Path As String _
) As Long

Parameters

Path

See Also

GuiTree Object


GetNodeHeight Method

GetNodeHeight Method
Key

Description

method GetNodeHeight

Syntax

Visual Basic
Public Function GetNodeHeight( _
   ByVal Key As String _
) As Long

Parameters

Key

See Also

GuiTree Object


GetNodeIndex Method

GetNodeIndex Method
Key

Syntax

Visual Basic
Public Function GetNodeIndex( _
   ByVal Key As String _
) As Long

Parameters

Key

See Also

GuiTree Object


GetNodeItemHeaders Method

GetNodeItemHeaders Method
NodeKey

Syntax

Visual Basic
Public Function GetNodeItemHeaders( _
   ByVal NodeKey As String _
) As Object

Parameters

NodeKey

See Also

GuiTree Object


GetNodeKeyByPath Method

GetNodeKeyByPath Method
Path

Description

Key of the node specified by the given path description.

Syntax

Visual Basic
Public Function GetNodeKeyByPath( _
   ByVal Path As String _
) As String

Parameters

Path

See Also

GuiTree Object


GetNodeLeft Method

GetNodeLeft Method
Key

Description

method GetNodeLeft

Syntax

Visual Basic
Public Function GetNodeLeft( _
   ByVal Key As String _
) As Long

Parameters

Key

See Also

GuiTree Object


GetNodePathByKey Method

GetNodePathByKey Method
Key

Description

Given a node key, the path is retrieved (e.g. 2\1\2).

Syntax

Visual Basic
Public Function GetNodePathByKey( _
   ByVal Key As String _
) As String

Parameters

Key

See Also

GuiTree Object


GetNodesCol Method

GetNodesCol Method

Description

The collection contains the node keys of all the nodes in the tree.

Syntax

Visual Basic
Public Function GetNodesCol() As Object

See Also

GuiTree Object


GetNodeStyle Method

GetNodeStyle Method
NodeKey

Syntax

Visual Basic
Public Function GetNodeStyle( _
   ByVal NodeKey As String _
) As Long

Parameters

NodeKey

See Also

GuiTree Object


GetNodeTextByKey Method

GetNodeTextByKey Method
Path

Description

This function returns the text of the node specified by the given key.

Syntax

Visual Basic
Public Function GetNodeTextByKey( _
   ByVal Path As String _
) As String

Parameters

Path

See Also

GuiTree Object


GetNodeTextByPath Method

GetNodeTextByPath Method
Path

Description

The text of a node defined by the given path is returned.

Syntax

Visual Basic
Public Function GetNodeTextByPath( _
   ByVal Path As String _
) As String

Parameters

Path

See Also

GuiTree Object


GetNodeTextColor Method

GetNodeTextColor Method
Key

Syntax

Visual Basic
Public Function GetNodeTextColor( _
   ByVal Key As String _
) As ULong

Parameters

Key

See Also

GuiTree Object


GetNodeToolTip Method

GetNodeToolTip Method
NodeKey

Syntax

Visual Basic
Public Function GetNodeToolTip( _
   ByVal NodeKey As String _
) As String

Parameters

NodeKey

See Also

GuiTree Object


GetNodeTop Method

GetNodeTop Method
Key

Description

method GetNodeTop

Syntax

Visual Basic
Public Function GetNodeTop( _
   ByVal Key As String _
) As Long

Parameters

Key

See Also

GuiTree Object


GetNodeWidth Method

GetNodeWidth Method
Key

Description

method GetNodeWidth

Syntax

Visual Basic
Public Function GetNodeWidth( _
   ByVal Key As String _
) As Long

Parameters

Key

See Also

GuiTree Object


GetParent Method

GetParent Method
CKey

Description

Key of the parent node of the node specified by the given key.

Syntax

Visual Basic
Public Function GetParent( _
   ByVal CKey As String _
) As String

Parameters

CKey

See Also

GuiTree Object


GetPreviousNodeKey Method

GetPreviousNodeKey Method
NodeKey

Syntax

Visual Basic
Public Function GetPreviousNodeKey( _
   ByVal NodeKey As String _
) As String

Parameters

NodeKey

See Also

GuiTree Object


GetSelectedNodes Method

GetSelectedNodes Method

Syntax

Visual Basic
Public Function GetSelectedNodes() As Object

See Also

GuiTree Object


GetSelectionMode Method

GetSelectionMode Method

Description

The selection behaviour of a Tree Control instance is set once at the time of creation.

Syntax

Visual Basic
Public Function GetSelectionMode() As Integer

Return Type

  • 0: Single Node
  • 1: Multiple Node
  • 2: Single Item
  • 3: Multiple Item

Example

Node Selection Mode

  • SingleNodeSelection: Only one node can be selected.
  • MultipleNodeSelection: Several nodes may be selected.

Item Selection
If Item Selection is enabled, then just one item can be selected. Otherwise, only complete nodes can be selected. Item Selection is not available for the Simple Tree.

Column Selection
If Column Selection is enabled, one or more columns can be selected.

Node Selection, Item Selection and Column selection are mutually exclusive. For example, selecting an Item removes a Node Selection automatically.

See Also

GuiTree Object


GetStyleDescription Method

GetStyleDescription Method
nStyle

Syntax

Visual Basic
Public Function GetStyleDescription( _
   ByVal nStyle As Long _
) As String

Parameters

nStyle

See Also

GuiTree Object


GetSubNodesCol Method

GetSubNodesCol Method
Path

Description

Collection of the keys of all subnodes of the node specified by the given key.

Syntax

Visual Basic
Public Function GetSubNodesCol( _
   ByVal Path As String _
) As Object

Parameters

Path

See Also

GuiTree Object


GetTreeType Method

GetTreeType Method

Description

The returned number has the following meaning:

  • 0 : Simple tree
  • 1 : List tree
  • 2 : Column tree

Syntax

Visual Basic
Public Function GetTreeType() As Long

See Also

GuiTree Object


HeaderContextMenu Method

HeaderContextMenu Method
HeaderName

Description

This method requests a context menu for a header.

Syntax

Visual Basic
Public Sub HeaderContextMenu( _
   ByVal HeaderName As String _
)

Parameters

HeaderName

See Also

GuiTree Object


IsFolder Method

IsFolder Method
NodeKey

Syntax

Visual Basic
Public Function IsFolder( _
   ByVal NodeKey As String _
) As Byte

Parameters

NodeKey

See Also

GuiTree Object


IsFolderExpandable Method

IsFolderExpandable Method
NodeKey

Syntax

Visual Basic
Public Function IsFolderExpandable( _
   ByVal NodeKey As String _
) As Byte

Parameters

NodeKey

See Also

GuiTree Object


IsFolderExpanded Method

IsFolderExpanded Method
NodeKey

Syntax

Visual Basic
Public Function IsFolderExpanded( _
   ByVal NodeKey As String _
) As Byte

Parameters

NodeKey

See Also

GuiTree Object


ItemContextMenu Method

ItemContextMenu Method
NodeKey
ItemName

Description

This method requests a context menu for an item.

Syntax

Visual Basic
Public Sub ItemContextMenu( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
)

Parameters

NodeKey
ItemName

See Also

GuiTree Object


NodeContextMenu Method

NodeContextMenu Method
NodeKey

Description

This method requests a context menu for a node.

Syntax

Visual Basic
Public Sub NodeContextMenu( _
   ByVal NodeKey As String _
)

Parameters

NodeKey

See Also

GuiTree Object


PressButton Method

PressButton Method
NodeKey
ItemName

Description

This method emulates pressing a button.

Syntax

Visual Basic
Public Sub PressButton( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
)

Parameters

NodeKey
ItemName

See Also

GuiTree Object


PressHeader Method

PressHeader Method
HeaderName

Description

This method emulates clicking a header.

Syntax

Visual Basic
Public Sub PressHeader( _
   ByVal HeaderName As String _
)

Parameters

HeaderName

See Also

GuiTree Object


PressKey Method

PressKey Method
Key
Possible values are: F1, F4, Delete, Insert, Enter, Cut, Copy, and Paste

Description

This method emulates pressing a key.

Syntax

Visual Basic
Public Sub PressKey( _
   ByVal Key As String _
)

Parameters

Key
Possible values are: F1, F4, Delete, Insert, Enter, Cut, Copy, and Paste

See Also

GuiTree Object


SelectColumn Method

SelectColumn Method
ColumnName

Description

This function adds a column to the column selection. A node or item selection is removed.

Syntax

Visual Basic
Public Sub SelectColumn( _
   ByVal ColumnName As String _
)

Parameters

ColumnName

See Also

GuiTree Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiTree Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiTree Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiTree Object


SelectedItemColumn Method

SelectedItemColumn Method

Syntax

Visual Basic
Public Function SelectedItemColumn() As String

See Also

GuiTree Object


SelectedItemNode Method

SelectedItemNode Method

Syntax

Visual Basic
Public Function SelectedItemNode() As String

See Also

GuiTree Object


SelectItem Method

SelectItem Method
NodeKey
ItemName

Description

This function emulates the selection of an item. This selection removes all other selections.

Syntax

Visual Basic
Public Sub SelectItem( _
   ByVal NodeKey As String, _
   ByVal ItemName As String _
)

Parameters

NodeKey
ItemName

See Also

GuiTree Object


SelectNode Method

SelectNode Method
NodeKey

Description

The node with the key nodeKey is added to the Node Selection.

Syntax

Visual Basic
Public Sub SelectNode( _
   ByVal NodeKey As String _
)

Parameters

NodeKey

See Also

GuiTree Object


SetCheckBoxState Method

SetCheckBoxState Method
NodeKey
ItemName
state

Syntax

Visual Basic
Public Sub SetCheckBoxState( _
   ByVal NodeKey As String, _
   ByVal ItemName As String, _
   ByVal state As Long _
)

Parameters

NodeKey
ItemName
state

See Also

GuiTree Object


SetColumnWidth Method

SetColumnWidth Method
ColumnName
Width

Description

This function sets the width of a column in pixels.

Syntax

Visual Basic
Public Sub SetColumnWidth( _
   ByVal ColumnName As String, _
   ByVal Width As Long _
)

Parameters

ColumnName
Width

See Also

GuiTree Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiTree Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiTree Object


UnselectAll Method

UnselectAll Method

Description

All selections are removed.

Syntax

Visual Basic
Public Sub UnselectAll()

See Also

GuiTree Object


UnselectColumn Method

UnselectColumn Method
ColumnName

Description

This function removes a column from the column selection.

Syntax

Visual Basic
Public Sub UnselectColumn( _
   ByVal ColumnName As String _
)

Parameters

ColumnName

See Also

GuiTree Object


UnselectNode Method

UnselectNode Method
NodeKey

Description

The node with the key nodeKey is removed from the Node Selection.

Syntax

Visual Basic
Public Sub UnselectNode( _
   ByVal NodeKey As String _
)

Parameters

NodeKey

See Also

GuiTree Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiTree Object


AccDescription Property

AccDescription Property

Description

Accessibility description of the shell. This description can be used for shells that do not have a title element.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccDescription() As String

See Also

GuiTree Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiTree Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiTree Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiTree Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiTree Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiTree Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiTree Object


ColumnOrder Property

ColumnOrder Property

Description

The property is used for working with a sequence of columns. The name of each column in the Column Tree must occur exactly once.

Property type

Read-write property

Syntax

Visual Basic
Public Property ColumnOrder() As Object

Remarks

Preconditions: Tree is a Column Tree and the Column Order can be changed.

See Also

GuiTree Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiTree Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiTree Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiTree Object


DragDropSupported Property

DragDropSupported Property

Description

This property is True if the shell allows drag and drop operations.

Property type

Read-only property

Syntax

Visual Basic
Public Property DragDropSupported() As Byte

See Also

GuiTree Object


Handle Property

Handle Property

Description

The window handle of the control that is connected to the GuiShell.

Property type

Read-only property

Syntax

Visual Basic
Public Property Handle() As Long

See Also

GuiTree Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiTree Object


HierarchyHeaderWidth Property

HierarchyHeaderWidth Property

Description

The width of the Hierarchy Header in pixels.

Property type

Read-write property

Syntax

Visual Basic
Public Property HierarchyHeaderWidth() As Long

Remarks

Precondition: Tree is a Column Tree or a List Tree with Header

See Also

GuiTree Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiTree Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiTree Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiTree Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiTree Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiTree Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiTree Object


OcxEvents Property

OcxEvents Property

Description

Returns a collection containing the event ids of the ActiveX control. These are the events that the control may send to the server.

Property type

Read-only property

Syntax

Visual Basic
Public Property OcxEvents() As GuiCollection

See Also

GuiTree Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiTree Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiTree Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiTree Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiTree Object


SelectedNode Property

SelectedNode Property

Description

This is the key of the currently selected node. Selecting a node removes other selections (that is Column Selection and Item Selection).

Property type

Read-write property

Syntax

Visual Basic
Public Property SelectedNode() As String

Remarks

Precondition: Node Selection Mode is SingleNodeSelection

See Also

GuiTree Object


SubType Property

SubType Property

Description

Additional type information to identify the control represented by the shell, for example Picture, TextEdit, GridView This property has the constant value “Tree”.

Property type

Read-only property

Syntax

Visual Basic
Public Property SubType() As String

See Also

GuiTree Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiTree Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiTree Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiTree Object


TopNode Property

TopNode Property

Description

This property influences the vertical scrolling of the Tree Control. TopNode contains the key of the node that is located on the upper edge of the Tree Control. Setting a node x as top node is only possible if there are enough visible nodes below x to fill the display area of the Tree Control.

Property type

Read-write property

Syntax

Visual Basic
Public Property TopNode() As String

See Also

GuiTree Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiTree Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiTree Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiTree Object


GuiUserArea Object

GuiUserArea Object
See Also Members

Description

The GuiUserArea comprises the area between the toolbar and statusbar for windows of GuiMainWindow type and the area between the titlebar and toolbar for modal windows, and may also be limited by docker controls. The standard dynpro elements can be found only in this area, with the exception of buttons, which are also found in the toolbars.

GuiUserArea extends GuiVContainer. The type prefix and name are usr.

Object Model

See Also

GuiUserArea Members


GuiUserArea Object Members

GuiUserArea Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByLabel | A very simple method for finding an object is to search by specifying the text of the respective label.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SelectContextMenuItem | Select an item from the controls context menu. This function emulates the selection of an item from the user area’s context menu.
Public Method SelectContextMenuItemByPosition | This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.
Public Method SelectContextMenuItemByText | Select a menu item of a context menu using the text of the item and possible higher level menus.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property CurrentContextMenu | This property is only set when a context menu is available at the shell object.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property HorizontalScrollbar | The user area is defined to be scrollable even if the scrollbars are not always visible.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property VerticalScrollbar | The user area is defined to be scrollable even if the scrollbars are not always visible.
Public Property Width | Width of the component in pixels.

See Also

GuiUserArea Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiUserArea Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiUserArea Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiUserArea Object


FindById Method

FindById Method
Id
Raise

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiUserArea Object


FindByLabel Method

FindByLabel Method
Text
Type

Description

A very simple method for finding an object is to search by specifying the text of the respective label.

Syntax

Visual Basic
Public Function FindByLabel( _
   ByVal Text As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Text
Type

Example

In this case the upper text field can be found by searching for a GuiTextField with the label text ‘Normal’ describing it. This match is done through searching for a label with the given text and then checking if there is a matching object on the same line. This should be only used for simple dynpros.

See Also

GuiUserArea Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiUserArea Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiUserArea Object


SelectContextMenuItem Method

SelectContextMenuItem Method
FunctionCode

Description

Select an item from the controls context menu. This function emulates the selection of an item from the user area’s context menu.

Syntax

Visual Basic
Public Sub SelectContextMenuItem( _
   ByVal FunctionCode As String _
)

Parameters

FunctionCode

See Also

GuiUserArea Object


SelectContextMenuItemByPosition Method

SelectContextMenuItemByPosition Method
PositionDesc

Description

This method allows you to select a context menu item using the position of the item. It is therefore independent of the menu item text.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByPosition( _
   ByVal PositionDesc As String _
)

Parameters

PositionDesc

Remarks

The parameter is a string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|".

See Also

GuiUserArea Object


SelectContextMenuItemByText Method

SelectContextMenuItemByText Method
Text

Description

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

Visual Basic
Public Sub SelectContextMenuItemByText( _
   ByVal Text As String _
)

Parameters

Text

See Also

GuiUserArea Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiUserArea Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiUserArea Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiUserArea Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiUserArea Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiUserArea Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiUserArea Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiUserArea Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiUserArea Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiUserArea Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiUserArea Object


CurrentContextMenu Property

CurrentContextMenu Property

Description

This property is only set when a context menu is available at the shell object.

Property type

Read-only property

Syntax

Visual Basic
Public Property CurrentContextMenu() As GuiContextMenu

See Also

GuiUserArea Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiUserArea Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiUserArea Object


HorizontalScrollbar Property

HorizontalScrollbar Property

Description

The user area is defined to be scrollable even if the scrollbars are not always visible.

Property type

Read-only property

Syntax

Visual Basic
Public Property HorizontalScrollbar() As GuiScrollbar

See Also

GuiUserArea Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiUserArea Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiUserArea Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiUserArea Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiUserArea Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiUserArea Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiUserArea Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiUserArea Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiUserArea Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiUserArea Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiUserArea Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiUserArea Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiUserArea Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiUserArea Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiUserArea Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiUserArea Object


VerticalScrollbar Property

VerticalScrollbar Property

Description

The user area is defined to be scrollable even if the scrollbars are not always visible.

Property type

Read-only property

Syntax

Visual Basic
Public Property VerticalScrollbar() As GuiScrollbar

See Also

GuiUserArea Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiUserArea Object


GuiUtils Object

GuiUtils Object
See Also Members

See Also

GuiUtils Members


GuiUtils Object Members

GuiUtils Object Members
See Also Overview

Public Methods

Public Method CloseFile | This function closes a file that was opened using OpenFile.
Public Method OpenFile | The file will be created in the SapWorkDir.
Public Method ShowMessageBox | Shows a message box.
Public Method Write | Write text to an open file without a new line at the end.
Public Method WriteLine | Write text to an open file with a new line at the end.

Public Properties

Public Property MESSAGE_OPTION_OK
Public Property MESSAGE_OPTION_OKCANCEL
Public Property MESSAGE_OPTION_YESNO
Public Property MESSAGE_RESULT_CANCEL
Public Property MESSAGE_RESULT_NO
Public Property MESSAGE_RESULT_OK
Public Property MESSAGE_RESULT_YES
Public Property MESSAGE_TYPE_ERROR
Public Property MESSAGE_TYPE_INFORMATION
Public Property MESSAGE_TYPE_PLAIN
Public Property MESSAGE_TYPE_QUESTION
Public Property MESSAGE_TYPE_WARNING

See Also

GuiUtils Overview


CloseFile Method

CloseFile Method
File

Description

This function closes a file that was opened using OpenFile.

Syntax

Visual Basic
Public Sub CloseFile( _
   ByVal File As Long _
)

Parameters

File

See Also

GuiUtils Object


OpenFile Method

OpenFile Method
Name
Name of the text file to be created. For security reasons this name must not contain any path information.

Description

The file will be created in the SapWorkDir.

Syntax

Visual Basic
Public Function OpenFile( _
   ByVal Name As String _
) As Long

Parameters

Name
Name of the text file to be created. For security reasons this name must not contain any path information.

Return Type

The return value is a handle to the file.

See Also

GuiUtils Object


ShowMessageBox Method

ShowMessageBox Method
Title
Title of the message box
Text
Text of the message box.
MsgIcon
MsgIcon sets the icon to be used for the message box and should be set to one of the GuiMessageBoxType constants.
MsgType
MsgType sets the buttons available on the message box and should be set to one of the GuiMessageBoxOption constants.

Description

Shows a message box.

Syntax

Visual Basic
Public Function ShowMessageBox( _
   ByVal Title As String, _
   ByVal Text As String, _
   ByVal MsgIcon As Long, _
   ByVal MsgType As Long _
) As Long

Parameters

Title
Title of the message box
Text
Text of the message box.
MsgIcon
MsgIcon sets the icon to be used for the message box and should be set to one of the GuiMessageBoxType constants.
MsgType
MsgType sets the buttons available on the message box and should be set to one of the GuiMessageBoxOption constants.

Return Type

The return value will be one of the GuiMessageBoxResult constants.

See Also

GuiUtils Object


Write Method

Write Method
File
Text

Description

Write text to an open file without a new line at the end.

Syntax

Visual Basic
Public Sub Write( _
   ByVal File As Long, _
   ByVal Text As String _
)

Parameters

File
Text

See Also

GuiUtils Object


WriteLine Method

WriteLine Method
File
Text

Description

Write text to an open file with a new line at the end.

Syntax

Visual Basic
Public Sub WriteLine( _
   ByVal File As Long, _
   ByVal Text As String _
)

Parameters

File
Text

See Also

GuiUtils Object


MESSAGE_OPTION_OK Property

MESSAGE_OPTION_OK Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_OPTION_OK() As Long

See Also

GuiUtils Object


MESSAGE_OPTION_OKCANCEL Property

MESSAGE_OPTION_OKCANCEL Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_OPTION_OKCANCEL() As Long

See Also

GuiUtils Object


MESSAGE_OPTION_YESNO Property

MESSAGE_OPTION_YESNO Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_OPTION_YESNO() As Long

See Also

GuiUtils Object


MESSAGE_RESULT_CANCEL Property

MESSAGE_RESULT_CANCEL Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_RESULT_CANCEL() As Long

See Also

GuiUtils Object


MESSAGE_RESULT_NO Property

MESSAGE_RESULT_NO Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_RESULT_NO() As Long

See Also

GuiUtils Object


MESSAGE_RESULT_OK Property

MESSAGE_RESULT_OK Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_RESULT_OK() As Long

See Also

GuiUtils Object


MESSAGE_RESULT_YES Property

MESSAGE_RESULT_YES Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_RESULT_YES() As Long

See Also

GuiUtils Object


MESSAGE_TYPE_ERROR Property

MESSAGE_TYPE_ERROR Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_TYPE_ERROR() As Long

See Also

GuiUtils Object


MESSAGE_TYPE_INFORMATION Property

MESSAGE_TYPE_INFORMATION Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_TYPE_INFORMATION() As Long

See Also

GuiUtils Object


MESSAGE_TYPE_PLAIN Property

MESSAGE_TYPE_PLAIN Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_TYPE_PLAIN() As Long

See Also

GuiUtils Object


MESSAGE_TYPE_QUESTION Property

MESSAGE_TYPE_QUESTION Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_TYPE_QUESTION() As Long

See Also

GuiUtils Object


MESSAGE_TYPE_WARNING Property

MESSAGE_TYPE_WARNING Property

Property type

Read-only property

Syntax

Visual Basic
Public Property MESSAGE_TYPE_WARNING() As Long

See Also

GuiUtils Object


GuiVComponent Object

GuiVComponent Object
See Also Members

Description

The GuiVComponent interface is exposed by all visual objects, such as windows, buttons or text fields. Like GuiComponent, it is an abstract interface. Any object supporting the GuiVComponent interface also exposes the GuiComponent interface. GuiVComponent extends GuiComponent.

Object Model

See Also

GuiVComponent Members


GuiVComponent Object Members

GuiVComponent Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiVComponent Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiVComponent Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiVComponent Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiVComponent Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiVComponent Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiVComponent Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiVComponent Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiVComponent Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiVComponent Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiVComponent Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiVComponent Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiVComponent Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiVComponent Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiVComponent Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiVComponent Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiVComponent Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiVComponent Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiVComponent Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiVComponent Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiVComponent Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiVComponent Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiVComponent Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiVComponent Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiVComponent Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiVComponent Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiVComponent Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiVComponent Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiVComponent Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiVComponent Object


GuiVContainer Object

GuiVContainer Object
See Also Members

Description

An object exposes the GuiVContainer interface if it is both visible and can have children. It will then also expose GuiComponent and GuiVComponent. Examples of this interface are windows and subscreens, toolbars or controls having children, such as the splitter control. GuiVContainer extends GuiContainer and GuiVComponent.

Object Model

See Also

GuiVContainer Members


GuiVContainer Object Members

GuiVContainer Object Members
See Also Overview

Public Methods

Public Method DumpState | This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.
Public Method FindAllByName | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindAllByNameEx | The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.
Public Method FindById | Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.
Public Method FindByName | Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.
Public Method FindByNameEx | This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.
Public Method SetFocus | This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.
Public Method ShowContextMenu | Shows the context menu of the control.
Public Method Visualize | Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Public Properties

Public Property AccLabelCollection | The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.
Public Property AccText | An additional text for accessibility support.
Public Property AccTextOnRequest | An additional text for accessibility support.
Public Property AccTooltip | An additional tooltip text for accessibility support.
Public Property Changeable | An object is changeable if it is neither disabled nor read-only.
Public Property Children | This collection contains all direct children of the object.
Public Property ContainerType | This property is TRUE, if the object is a container and therefore has the children property.
Public Property DefaultTooltip | Tooltip text generated from the short text defined in the data dictionary for the given screen element type.
Public Property Height | Height of the component in pixels.
Public Property IconName | If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.
Public Property Id | An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.
Public Property IsSymbolFont | The property is TRUE if the component's text is visualized in the SAP symbol font.
Public Property Left | Left position of the element in screen coordinates
Public Property Modified | An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.
Public Property Name | The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.
Public Property Parent | The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.
Public Property ParentFrame | If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.
Public Property ScreenLeft | The y position of the component in screen coordinates.
Public Property ScreenTop | The x position of the component in screen coordinates.
Public Property Text | The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.
Public Property Tooltip | The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.
Public Property Top | Top coordinate of the element in screen coordinates.
Public Property Type | The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.
Public Property TypeAsNumber | While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.
Public Property Width | Width of the component in pixels.

See Also

GuiVContainer Overview


DumpState Method

DumpState Method
InnerObject

Description

This function dumps the state of the object. The parameter innerObject may be used to specify for which internal object the data should be dumped. Only the most complex components, such as the GuiCtrlGridView, support this parameter. All other components always dump their full state. All components that support this parameter have in common that they return general information about the controls state if the parameter innerObject contains an empty string.The format of the returned collection is described in the chapter DumpState Collection Format of the appendix. The available values for the innerObject parameter are specified as part of the class description for those components that support it.

Syntax

Visual Basic
Public Function DumpState( _
   ByVal InnerObject As String _
) As GuiCollection

Parameters

InnerObject

Remarks

The DumpState method returns a hierarchy of collections of type GuiCollection, which is three levels deep.

- The top (first) level collection contains a second level collection for every property that is to be dumped.

- The second level collection contains the complete information for one property. There is a third level collection for every sub-expression that might be required to access inner objects.

- Finally, the third level collection contains the OpCode, the property or method name, the parameter values and depending on the OpCode the return value to be checked.

The following OpCodes are used:

- GPR: Get property and compare return value.

- MR: Execute method and compare return value.

- GP: Get property and execute the next entry in the second level collection on the result.

- M: Execute the method and then execute the next entry in the second level collection on the result.

For example the calls

control.ItemCount = 42

control.GetItemValue(3, 2) = 'MyText'

control.GetItem('2','3').Property1.MethodY('XYZ').Text = 'ABC'

result in three entries of the top level collection:

First entry:

OpCode | Name | Parameter1/ Property-Value | Parameter2 | Parameter3
GPR | ItemCount | 42 |  |

Second entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3/ Property-Value
MR | GetItemValue | 3 | 2 | MyText

Third entry:

OpCode | Name | Parameter1 | Parameter2 | Parameter3
M | GetItem | 2 | 3 |
GP | Property1 |  |  |
M | MethodY | XYZ |  |
GPR | Text | ABC |  |

As you can see in this example, for calls that contain return values (MR, GPR) the last value in the third level collection is the return value.

See Also

GuiVContainer Object


FindAllByName Method

FindAllByName Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiVContainer Object


FindAllByNameEx Method

FindAllByNameEx Method
Name
Type

Description

The methods findByName and findByNameEx return only the first object with matching name and type. There may however be several matching objects, which will be returned as members of a collection when findAllByName or findAllByNameEx are used.

Syntax

Visual Basic
Public Function FindAllByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponentCollection

Parameters

Name
Type

See Also

GuiVContainer Object


FindById Method

FindById Method
Id
Raise
Default value is TRUE.

Description

Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found thefunction raises an exception unless the optional parameter raise is set to False.

Syntax

Visual Basic
Public Function FindById( _
   ByVal Id As String, _
   Optional ByVal Raise As Variant _
) As GuiComponent

Parameters

Id
Raise
Default value is TRUE.

Example

Unless there are several sessions or connections in use, the following calls are equivalent:
Set Comp = UserArea.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
Set Comp = UserArea.findById("txtHEADER-FBFOOTLINE")

See Also

GuiVContainer Object


FindByName Method

FindByName Method
Name
Type

Description

Unlike findById, this function does not guarantee a unique result. It will simply return the first descendant matching both the name and type parameters.This is a more natural description of the object than the complex id, but it only makes sense on dynpro objects as most other objects do not have a meaningfulname. If no descendant with matching name and type can be found, the function raises an exception.

Syntax

Visual Basic
Public Function FindByName( _
   ByVal Name As String, _
   ByVal Type As String _
) As GuiComponent

Parameters

Name
Type

Example

Set Comp = UserArea.findByName("HEADER-FBFOOTLINE", "GuiTextField")

See Also

GuiVContainer Object


FindByNameEx Method

FindByNameEx Method
Name
Type

Description

This function has been introduced for performance reasons. The parameter type is not a string as in findByName but rather a number taken from GuiComponent.typeAsNumber.

Syntax

Visual Basic
Public Function FindByNameEx( _
   ByVal Name As String, _
   ByVal Type As Long _
) As GuiComponent

Parameters

Name
Type

See Also

GuiVContainer Object


SetFocus Method

SetFocus Method

Description

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focussed object.

Syntax

Visual Basic
Public Sub SetFocus()

Example

Pressing this button to display the details of an entry in the table control will only succeed if the focus has already been set on the respective entry.

See Also

GuiVContainer Object


ShowContextMenu Method

ShowContextMenu Method

Description

Shows the context menu of the control.

Syntax

Visual Basic
Public Sub ShowContextMenu()

See Also

GuiVContainer Object


Visualize Method

Visualize Method
On
InnerObject

Description

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

Syntax

Visual Basic
Public Function Visualize( _
   ByVal On As Boolean, _
   Optional ByVal InnerObject As Variant _
) As Byte

Parameters

On
InnerObject

See Also

GuiVContainer Object


AccLabelCollection Property

AccLabelCollection Property

Description

The collection contains objects of type GuiLabel that were assigned to this control in the ABAP Screen Painter.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccLabelCollection() As GuiComponentCollection

See Also

GuiVContainer Object


AccText Property

AccText Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccText() As String

See Also

GuiVContainer Object


AccTextOnRequest Property

AccTextOnRequest Property

Description

An additional text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTextOnRequest() As String

See Also

GuiVContainer Object


AccTooltip Property

AccTooltip Property

Description

An additional tooltip text for accessibility support.

Property type

Read-only property

Syntax

Visual Basic
Public Property AccTooltip() As String

See Also

GuiVContainer Object


Changeable Property

Changeable Property

Description

An object is changeable if it is neither disabled nor read-only.

Property type

Read-only property

Syntax

Visual Basic
Public Property Changeable() As Byte

See Also

GuiVContainer Object


Children Property

Children Property

Description

This collection contains all direct children of the object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Children() As GuiComponentCollection

See Also

GuiVContainer Object


ContainerType Property

ContainerType Property

Description

This property is TRUE, if the object is a container and therefore has the children property.

Property type

Read-only property

Syntax

Visual Basic
Public Property ContainerType() As Byte

See Also

GuiVContainer Object


DefaultTooltip Property

DefaultTooltip Property

Description

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

Property type

Read-only property

Syntax

Visual Basic
Public Property DefaultTooltip() As String

See Also

GuiVContainer Object


Height Property

Height Property

Description

Height of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Height() As Long

See Also

GuiVContainer Object


IconName Property

IconName Property

Description

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Property type

Read-only property

Syntax

Visual Basic
Public Property IconName() As String

See Also

GuiVContainer Object


Id Property

Id Property

Description

An object id is a unique textual identifier for the object. It is built in a URL-like formatting, starting at the GuiApplication object and drilling down to the respective object.

Property type

Read-only property

Syntax

Visual Basic
Public Property Id() As String

Remarks

Using fully qualified ids has one significant drawback: the index of both the connection and session become part of the id. If the id given above is used to search for the text field the search will only be successful if the session to which the text field belongs is again the first session of the first connection. This problem can be circumvented using relative ids. A relative id does not start with /. Instead it begins with the type prefix of the child of the object on which the search is started. Therefore it is usually preferable to truncate the first part of the id up to the session index and work with a relative id, such as wnd[0]/usr/ctxtRS38M-PROGRAMM. This relative id is still unique with respect to a given session, but it is independent of the number of sessions or connections currently open.

Example

The id of the text field in transaction se38 is /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM. It is created through first taking the type specific prefix for the given component, which in this case is 'ctxt'. The name of the field is then appended, if one exists. For dynpro fields the name is the field name defined in screen painter, in this case 'RS38M-PROGRAM'. In many cases, especially if there is no name available for an object, an index has to be appended for uniqueness. Finally, the id of the parent object is added as a prefix, separated by the '/' character.

Objects of type GuiShell do not have a name. So whenever there are several objects of this type on the same level in the hierarchy, a one-dimensional index is appended for uniqueness. On the other hand, list and step-loop screens are set up in a two-dimensional grid, so the index string added to the id will have two components as well.

See Also

GuiVContainer Object


IsSymbolFont Property

IsSymbolFont Property

Description

The property is TRUE if the component's text is visualized in the SAP symbol font.

Property type

Read-only property

Syntax

Visual Basic
Public Property IsSymbolFont() As Byte

See Also

GuiVContainer Object


Left Property

Left Property

Description

Left position of the element in screen coordinates

Property type

Read-only property

Syntax

Visual Basic
Public Property Left() As Long

See Also

GuiVContainer Object


Modified Property

Modified Property

Description

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

Property type

Read-only property

Syntax

Visual Basic
Public Property Modified() As Byte

See Also

GuiVContainer Object


Name Property

Name Property

Description

The name property is especially useful when working with simple scripts that only access dynpro fields. In that case a field can be found using its name and type information, which is easier to read than a possibly very long id. However, there is no guarantee that there are no two objects with the same name and type in a given dynpro.

Property type

Read-only property

Syntax

Visual Basic
Public Property Name() As String

See Also

GuiVContainer Object


Parent Property

Parent Property

Description

The parent of an object is one level higher in the runtime hierarchy. An object is always in the children collection of its parent.

Property type

Read-only property

Syntax

Visual Basic
Public Property Parent() As GuiComponent

See Also

GuiVContainer Object


ParentFrame Property

ParentFrame Property

Description

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

Property type

Read-only property

Syntax

Visual Basic
Public Property ParentFrame() As GuiComponent

See Also

GuiVContainer Object


ScreenLeft Property

ScreenLeft Property

Description

The y position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenLeft() As Long

See Also

GuiVContainer Object


ScreenTop Property

ScreenTop Property

Description

The x position of the component in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property ScreenTop() As Long

See Also

GuiVContainer Object


Text Property

Text Property

Description

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you cant change it, whereas you can only set the text property of a password field, but not read it.

Property type

Read-write property

Syntax

Visual Basic
Public Property Text() As String

See Also

GuiVContainer Object


Tooltip Property

Tooltip Property

Description

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tooltip() As String

See Also

GuiVContainer Object


Top Property

Top Property

Description

Top coordinate of the element in screen coordinates.

Property type

Read-only property

Syntax

Visual Basic
Public Property Top() As Long

See Also

GuiVContainer Object


Type Property

Type Property

Description

The type information of GuiComponent can be used to determine which properties and methods an object supports. The value of the type string is the name of the type taken from this documentation.

Property type

Read-only property

Syntax

Visual Basic
Public Property Type() As String

See Also

GuiVContainer Object


TypeAsNumber Property

TypeAsNumber Property

Description

While the type property is a string value, the typeAsNumber property is a long value that can alternatively be used to identify an object's type . It was added for better performance in methods such as FindByIdEx. Possible values for this property are taken from the GuiComponentType enumeration.

Property type

Read-only property

Syntax

Visual Basic
Public Property TypeAsNumber() As Long

See Also

GuiVContainer Object


Width Property

Width Property

Description

Width of the component in pixels.

Property type

Read-only property

Syntax

Visual Basic
Public Property Width() As Long

See Also

GuiVContainer Object


GuiComponentType Enumeration

GuiComponentType Enumeration

Members

Member | Value | Description
GuiUnknown | -1 | GuiUnknown
GuiComponent | 0 | GuiComponent
GuiVComponent | 1 | GuiVComponent
GuiVContainer | 2 | GuiVContainer
GuiApplication | 10 | GuiApplication
GuiConnection | 11 | GuiConnection
GuiSession | 12 | GuiSession
GuiFrameWindow | 20 | GuiFrameWindow
GuiMainWindow | 21 | GuiMainWindow
GuiModalWindow | 22 | GuiModalWindow
GuiMessageWindow | 23 | GuiMessageWindow
GuiLabel | 30 | GuiLabel
GuiTextField | 31 | GuiTextField
GuiCTextField | 32 | GuiCTextField
GuiPasswordField | 33 | GuiPasswordField
GuiComboBox | 34 | GuiComboBox
GuiOkCodeField | 35 | GuiOkCodeField
GuiButton | 40 | GuiButton
GuiRadioButton | 41 | GuiRadioButton
GuiCheckBox | 42 | GuiCheckBox
GuiStatusPane | 43 | GuiStatusPane
GuiCustomControl | 50 | GuiCustomControl
GuiContainerShell | 51 | GuiContainerShell
GuiBox | 62 | GuiBox
GuiContainer | 70 | GuiContainer
GuiSimpleContainer | 71 | GuiSimpleContainer
GuiScrollContainer | 72 | GuiScrollContainer
GuiListContainer | 73 | GuiListContainer
GuiUserArea | 74 | GuiUserArea
GuiSplitterContainer | 75 | GuiSplitterContainer
GuiTableControl | 80 | GuiTableControl
GuiTableColumn | 81 | GuiTableColumn
GuiTableRow | 82 | GuiTableRow
GuiTabStrip | 90 | GuiTabStrip
GuiTab | 91 | GuiTab
GuiScrollbar | 100 | GuiScrollbar
GuiToolbar | 101 | GuiToolbar
GuiTitlebar | 102 | GuiTitlebar
GuiStatusbar | 103 | GuiStatusbar
GuiMenu | 110 | GuiMenu
GuiMenubar | 111 | GuiMenubar
GuiCollection | 120 | GuiCollection
GuiSessionInfo | 121 | GuiSessionInfo
GuiShell | 122 | GuiShell
GuiGOSShell | 123 | GuiGOSShell
GuiSplitterShell | 124 | GuiSplitterShell
GuiDialogShell | 125 | GuiDialogShell
GuiDockShell | 126 | GuiDockShell
GuiContextMenu | 127 | GuiContextMenu
GuiComponentCollection | 128 | GuiComponentCollection


GuiErrorType Enumeration

GuiErrorType Enumeration

Members

Member | Value | Description
Gui_Err_Init | 601 | Sapgui engine cannot be initialized.
Gui_Err_Front_Module | 602 | The path of the 'sapfront.dll' could not be determined.
Gui_Err_Invalid_Context | 603 | Function called in invalid thread context
Gui_Err_Logon_Module | 604 | The 'Sapgui Logon Component' could not be instantiated.
Gui_Err_Sapgui_Module | 605 | The 'Sapgui Component' could not be instantiated.
Gui_Err_Session_Index | 606 | The session index is out of range.
Gui_Err_No_Memory | 607 | The system is out of memory.
Gui_Err_Control_Name | 608 | The control could not be found by name.
Gui_Err_Property_Readonly | 609 | The property is readonly.
Gui_Err_Not_Implemented | 610 | The method or property is currently not implemented.
Gui_Err_Invalid_Window | 611 | The required window is invalid.
Gui_Err_Enumerator_Reset | 612 | The enumerator of the collection cannot be reset.
Gui_Err_Invalid_Argument | 613 | The method got an invalid argument.
Gui_Err_Enumerator_Index | 614 | The enumerator of the collection cannot find an element with the specified index.
Gui_Err_Control_Label | 615 | The control could not be found by label.
Gui_Err_Control_Position | 616 | The control could not be found by position.
Gui_Err_VKey_Disabled | 617 | The virtual key is not enabled.
Gui_Err_Bad_Index_Type | 618 | Bad index type for collection access.
Gui_Err_FindById | 619 | The control could not be found by id.
Gui_Err_FindByName | 620 | The control could not be found by name.
Gui_Err_Disconnected | 621 | The object invoked has disconnected from its clients.
Gui_Err_No_Wrapper | 622 | No wrapper available for this control.
Gui_Err_Menu_Disabled | 623 | The menu item is disabled.
Gui_Err_Scripting_Disabled_Srv | 624 | Scripting is disabled by the server.
Gui_Err_Int_GetCtrl_Failed | 625 | Could not get ctrl (Internal Error)
Gui_Err_Int_GetSesFromCtrl_Failed | 626 | Could not get session from ctrl (Internal Error)
Gui_Err_Int_GetFocusManFromSes_Failed | 627 | Could not get focus manager from session (Internal Error)
Gui_Err_Int_Invalid_TestToolMode | 628 | Invalid test tool mode
Gui_Err_Int_Get_Session_Failed | 629 | Can not get session from TLS
Gui_Err_Int_View_Not_Set | 630 | View not set (Internal Error)
Gui_Err_Resize_Failed | 631 | Resize failed.
Gui_Err_FindByPos | 632 | The control could not be found by position.
Gui_Err_AccessDenied | 633 | Access denied.
Gui_Err_Bad_Focus | 634 | Can not set focus to this object.
Gui_Err_Save_Image | 635 | Error saving image.
Gui_Err_SL_No_Entry | 1000 | Not a valid SAPLogon entry


GuiEventType Enumeration

GuiEventType Enumeration

Members

Member | Value | Description
SapDefaultEvent | 0 | Default
SapSessionStartRequestEvent | 514 | SessionStartRequest
SapSessionEndRequestEvent | 515 | SessionEndRequest
SapSessionErrorEvent | 516 | SessionError
SapCustomDataChangedEvent | 1280 | CustomDataChanged
SapHitSelectEvent | 1281 | Hit
SapContextMenuEvent | 1282 | ContextMenu
SapSessionDestroyEvent | 1283 | SessionDestroy
SapSessionAutoFCodeEvent | 1284 | SessionAutoFCode
SapSessionActivatedEvent | 1285 | SessionActivated
SapSessionFocusChangedEvent | 1286 | SessionFocusChanged
SapApplicationCreateSessionEvent | 2002 | ApplicationCreateSession
SapApplicationDestroySessionEvent | 2003 | ApplicationDestroySession
SapApplicationErrorEvent | 2004 | ApplicationErrorEvent
SapApplicationIgnoreSessionEvent | 2005 | ApplicationIgnoreSession


GuiImageType Enumeration

GuiImageType Enumeration

Description

SAP GUI Image types

Members

Member | Value | Description
BMP | 0 | BMP
JPEG | 1 | JPEG
PNG | 2 | PNG
GIF | 2 | GIF


GuiMessageBoxOption Enumeration

GuiMessageBoxOption Enumeration

Description

SAP GUI Message Box Options

Members

Member | Value | Description
MSG_OPTION_OK | 0 | Constant value to be used when calling the showMessageBox method. Using this value will display an ‘OK’ button only. (0)
MSG_OPTION_YESNO | 1 | Constant value to be used when calling the showMessageBox method. Using this value will display a ‘Yes’ button and a ‘No’ button. (1)
MSG_OPTION_OKCANCEL | 2 | Constant value to be used when calling the showMessageBox method. Using this value will display an ‘OK’ button and a ‘Cancel’ button. (2)


GuiMessageBoxResult Enumeration

GuiMessageBoxResult Enumeration

Description

SAP GUI Message Box Results

Members

Member | Value | Description
MSG_RESULT_CANCEL | 0 | Constant value to be used as a return value by the showMessageBox method. This value is returned when the ‘Cancel’ button has been pressed. (0)
MSG_RESULT_OK | 1 | Constant value to be used as a return value by the showMessageBox method. This value is returned when the ‘OK’ button has been pressed. (1)
MSG_RESULT_YES | 2 | Constant value to be used as a return value by the showMessageBox method. This value is returned when the ‘Yes’ button has been pressed. (2)
MSG_RESULT_NO | 3 | Constant value to be used as a return value by the showMessageBox method. This value is returned when the ‘No’ button has been pressed. (3)


GuiMessageBoxType Enumeration

GuiMessageBoxType Enumeration

Description

SAP GUI Message Box Types

Members

Member | Value | Description
MSG_TYPE_INFORMATION | 0 | Constant value to be used when calling the showMessageBox method. Using this value will display the letter ‘i’ as the message box icon. (0)
MSG_TYPE_QUESTION | 1 | Constant value to be used when calling the showMessageBox method. Using this value will display a question mark as the message box icon. (1)
MSG_TYPE_WARNING | 2 | Constant value to be used when calling the showMessageBox method. Using this value will display an exclamation mark as the message box icon. (2)
MSG_TYPE_ERROR | 3 | Constant value to be used when calling the showMessageBox method. Using this value will display a stop sign as the message box icon. (3)
MSG_TYPE_PLAIN | 4 | Constant value to be used when calling the showMessageBox method. Using this value will display no message box icon. (4)


GuiScrollbarType Enumeration

GuiScrollbarType Enumeration

Members

Member | Value | Description
GuiScrollbarTypeUnknown | 0 | Unknown
GuiScrollbarTypeVertical | 1 | Vertical
GuiScrollbarTypeHorizontal | 2 | Horizontal


GuiTableSelectionType Enumeration

GuiTableSelectionType Enumeration

Members

Member | Value | Description
NO_SELECTION | 0 | No selection possible. (0)
SINGLE_SELECTION | 1 | One column/row can be selected. (1)
MULTIPLE_INTERVAL_SELECTION | 2 | Several columns/rows can be selected. (2)


Getting Started - SAP GUI Scripting ROT Entry Helper

SAP GUI Scripting ROT Entry Helper Send comments on this topic.
Introduction


Project Overview

SAP GUI Scripting ROT Entry Helper Send comments on this topic.
Project Overview

Description

This is a helper library that contains just one object. It is used to allow COM clients to access a running SAP GUI process.

Classes

Class Module | Description
SapGuiAuto | This object is registered in the Windows Running Object Table whenever the SAP GUI main process saplogon.exe runs, assuming that SAP GUI Scripting is installed on the client PC.

Remarks

Some scripting languages do not allow accessing an entry in the Running Object Table. Even though they may offer a 'GetObject' function, this function will then only support accessing files in the file system or creating COM objects using the COM progid. In this case you need to start by creating another helper object, CSapROTWrapper, which in turn allows you to access the ROT entry for SAP GUI.


Getting Started - SAP GUI Scripting ROT Entry Helper

SAP GUI Scripting ROT Entry Helper Send comments on this topic.
Getting Started


SapGuiAuto Object

SAP GUI Scripting ROT Entry Helper Send comments on this topic.
SapGuiAuto Object
See Also Members

Description

This object is registered in the Windows Running Object Table whenever the SAP GUI main process saplogon.exe runs, assuming that SAP GUI Scripting is installed on the client PC.

See Also

SapGuiAuto Members


SapGuiAuto Object Members

SAP GUI Scripting ROT Entry Helper Send comments on this topic.
SapGuiAuto Object Members
See Also Overview

Public Methods

Public Method GetScriptingEngine This method returns the GuiApplication COM interface for the currently running SAP GUI process.

See Also

SapGuiAuto Overview


GetScriptingEngine Method

SAP GUI Scripting ROT Entry Helper Send comments on this topic.
GetScriptingEngine Method
See Also Example

Description

This method returns the GuiApplication COM interface for the currently running SAP GUI process.

Syntax

Visual Basic
Public Function GetScriptingEngine() As Object

Return Type

GuiApplication

Example

Retrieving the GuiApplication interface from the ROT:
Visual Basic Script (Visual Basic) Copy Code
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
WinBatch by Wilson WindowWare (Visual Basic) Copy Code
SapGuiAuto = ObjectGet("SAPGUI");
Application = SapGuiAuto.GetScriptingEngine;

See Also

SapGuiAuto Object


Getting Started - SAP GUI Scripting ROT Access Helper

SAP GUI Scripting ROT Access Helper Send comments on this topic.
Introduction


Project Overview

SAP GUI Scripting ROT Access Helper Send comments on this topic.
Project Overview

Description

This library contains just one object. It is required in cases where the scripting engine does not allow accessing entries in the Running Object Table. This is for example the case for the following engines

  • JAWS script, the scripting language of the JAWS Screenreader, by Freedom Scientific
  • AutoIt, a freeware Windows automation language

For these languages you need to create a CSapROTWrapper object first, before you can access the ROT entry and get the GuiApplication interface of the running SAP GUI process.

Classes

Class Module | Description
CSapROTWrapper | SapROTWrapper Class


Getting Started - SAP GUI Scripting ROT Access Helper

SAP GUI Scripting ROT Access Helper Send comments on this topic.
Getting Started


CSapROTWrapper Object

SAP GUI Scripting ROT Access Helper Send comments on this topic.
CSapROTWrapper Object
See Also Members

Description

SapROTWrapper Class

See Also

CSapROTWrapper Members


CSapROTWrapper Object Members

SAP GUI Scripting ROT Access Helper Send comments on this topic.
CSapROTWrapper Object Members
See Also Overview

Public Methods

Public Method GetROTEntry This method returns the ROT entry of SAP GUI.

See Also

CSapROTWrapper Overview


GetROTEntry Method

SAP GUI Scripting ROT Access Helper Send comments on this topic.
GetROTEntry Method
See Also Example
strDisplayName
This parameter must have the value "SAPGUI". Any other value returns an error.

Description

This method returns the ROT entry of SAP GUI.

Syntax

Visual Basic
Public Function GetROTEntry( _
   ByVal strDisplayName As String _
) As Object

Parameters

strDisplayName
This parameter must have the value "SAPGUI". Any other value returns an error.

Example

Accessing the GuiApplication interface for the running SAP GUI process from AutoIt
AutoIt (Visual Basic) Copy Code
Dim $Wrapper = ObjCreate ("SapROTWr.SapROTWrapper")
Dim $RotSAPGUI = $Wrapper.GetROTEntry ("SAPGUI")
Dim $Application = $RotSAPGUI.GetScriptingEngine()
Accessing the GuiApplication interface for the running SAP GUI process from JAWS
JAWS Script (Visual Basic) Copy Code
  Object Wrapper,
  Object RotSAPGUI,
  Object SAPGUI

  Let Wrapper = CreateObject ("SapROTWr.SapROTWrapper")
  Let RotSAPGUI = Wrapper.GetROTEntry ("SAPGUI")
  Let SAPGUI = RotSAPGUI.GetScriptingEngine

See Also

CSapROTWrapper Object


Enumerations Object

Enumerations Object
See Also Members

See Also

Enumerations Members


Enumerations Object Members

Enumerations Object Members
See Also Overview

See Also

Enumerations Overview


Using CreateObject

Using CreateObject

Description

You can instantiate a SAP GUI application object using CreateObject.
Rem Create the GuiApplication object
Set Application = CreateObject("Sapgui.ScriptingCtrl.1")

Rem Open a connection in synchronous mode
Set Connection = Application.OpenConnection("U9C [PUBLIC]", True)
Set Session = Connection.Children(0)

Rem Do something: Either fill out the login screen
Rem or in case of Single-Sign-On start a transaction.
Session.SendCommand("/nbibs")

MsgBox "Waiting..."

Rem Shutdown the connection
Set Session = Nothing
Connection.CloseSession("ses[0]")
Set Connection = Nothing

Rem Wait a bit for the connection to be closed completely
Wscript.Sleep 1000
Set Application = Nothing

MsgBox "Done"


Using GetObject

Using GetObject

Description

You can attach to a running instance of SAP GUI through the Running Object Table.
Rem Get the application object from the Running Object Table
Set rotEntry = GetObject("SAPGUI")
Set application = rotEntry.GetScriptingEngine

Rem Get the first session of the first connection
Rem You may have to adjust this to access a different session
Set connection = application.Children(0)
Set session = connection.Children(0)

Rem Start a transaction
session.findById("wnd[0]/tbar[0]/okcd").text = "/nbibs"
session.findById("wnd[0]").sendVKey 0


Project Overview

SAPGUIScripting Send comments on this topic.
Project Overview

Description

SAP GUI Scripting API

Projects

Project | Description
SAPFEWSELib SAP GUI Scripting API 7.10

SAPLOGON | This is a helper library that contains just one object. It is used to allow COM clients to access a running SAP GUI process.
SapROTWr This library contains just one object. It is required in cases where the scripting engine does not allow accessing entries in the Running Object Table. This is for example the case for the following engines
  • JAWS script, the scripting language of the JAWS Screenreader, by Freedom Scientific
  • AutoIt, a freeware Windows automation language

For these languages you need to create a CSapROTWrapper object first, before you can access the ROT entry and get the GuiApplication interface of the running SAP GUI process.