SapGuiSetString Function

Action

Sets a string value that will be used as a parameter with the next call of a SapGuiInvoke function.

Include file

SapGui.bdh

Syntax

SapGuiSetString( in sParam : string allownull );
Parameter Description
sParam The string value to be set as a parameter for the next call of SapGuiInvoke.

Example

transaction TMain
  var
    sConnID : string;
  begin
    // Connecting to SAP
    gsConnID := SapGuiOpenConnection(" /SAP_CODEPAGE=1100 /FULLMENU 10.5.2.198 0 /3");
    SapGuiSetActiveConnection(sConnID);
    SapGuiSetActiveSession("ses[0]");

    // SAP
    SapGuiSetActiveWindow("wnd[0]", "SAP", SAPGUI_MATCH_Exact);

    // maximize
    // wnd[0]
    SapGuiInvokeMethod("wnd[0]", "maximize");

    // Logon to SAP System
    // Before running a test you have to customize the password parameter!
    SapGuiIgnoreError(SAPENGINE_STATUSBAR_CHANGED, SEVERITY_SUCCESS);
    ThinkTime(2.5);
    SapGuiLogon("ddic", "*******", "000", "");

    // Copyright
    ThinkTime(2.8);
    SapGuiSetActiveWindow("wnd[1]", "Copyright", SAPGUI_MATCH_Exact);

    // press
    // btn[0]
    SapGuiInvokeMethod("tbar[0]/btn[0]", "press");

    // SAP Easy Access
    ThinkTime(9.4);
    SapGuiSetActiveWindow("wnd[0]", "SAP Easy Access", SAPGUI_MATCH_Exact);

    // expandNode
    // shell
    SapGuiSetString("0000000003");
    SapGuiInvokeMethod("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "expandNode");

    // selectedNode
    SapGuiSetProperty("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "selectedNode", "0000000004");

    // topNode
    SapGuiSetProperty("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "topNode", "Favo");

    // doubleClickNode
    // shell
    SapGuiSetString("0000000004");
    SapGuiInvokeMethod("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "doubleClickNode");
    // Grid Control Info:
    // /app/con[0]/ses[0]/wnd[0]/usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell/0 columns
    // -------------------------------------

    // Business Workplace von DDIC
    ThinkTime(8.5);
    SapGuiSetActiveWindow("wnd[0]","Business Workplace von DDIC", SAPGUI_MATCH_Exact);
  end TMain;