SapGuiIteratorGetValueAt Function

Action

This functions reads and provides the value of a collection at a specified position. It will only return the value of simple data types such as long, boolean and strings. Use SapGuiIteratorGetObjectAt for getting a handle to complex types.

Include file

SapGui.bdh

Syntax

SapGuiIteratorGetValueAt( in  nIterator : number,
                          in  nPos      : number,
                          out sValue    : string, 
                          out nType     : number ) : boolean;
Parameter Description
nIterator The handle to the collection iterator.
nPos The position of the value to be read
sValue The string representation of the value
nType
The type of the property. The value may be one of the following:
  • SAPGUI_VT_BSTR: The value is of type string.
  • SAPGUI_VT_DISPATCH: The value is of type object. To get a handle to the object use SapGuiIteratorGetObject.
  • SAPGUI_VT_NULL: The value is NULL.
  • SAPGUI_VT_I4: The value if of type long.
  • SAPGUI_VT_BOOL: The value is of type boolean.

Return value

  • true if successful
  • false otherwise

Example

transaction TMain
  var
    sConnID   : string;
    i         : number;
    nIterator : number;
    nType     : number;
    nObject   : number;
    bRet      : boolean;
    sStr1, sStr2 : string;
  begin
  
    // Connecting to SAP
    sConnID := SapGuiOpenConnection(" /SAP_CODEPAGE=1100 /FULLMENU 10.5.2.198 0 /3");
    SapGuiSetActiveConnection(sConnID);
    SapGuiSetActiveSession("ses[0]");
  
    // SAP
    SapGuiSetActiveWindow("wnd[0]", "SAP", SAPGUI_MATCH_Exact);
    SapGuiWindowAction(SAPGUI_WND_MAXIMIZE);
  
    // Logon to SAP System
    SapGuiIgnoreError(SAPENGINE_STATUSBAR_CHANGED, SEVERITY_SUCCESS);
    ThinkTime(2.8);
    SapGuiLogon("ddic", "minisap", "000", ""); 
  
    // Copyright
    ThinkTime(2.1);
    SapGuiSetActiveWindow("wnd[1]", "Copyright", SAPGUI_MATCH_Exact);
    SapGuiPressButton("tbar[0]/btn[0]");
  
    // SAP Easy Access
    ThinkTime(9.9);
    SapGuiSetActiveWindow("wnd[0]", "SAP Easy Access", SAPGUI_MATCH_Exact);
    SapGuiGetPropertyCollection("wnd[0]", "Children", nIterator);
    SapGuiIteratorGetValueAt(nIterator, 0, sValue, nType);
  
    SapGuiIteratorRelease(nIterator);
  end TMain;