SapGuiSelectComboBoxEntry Function

Action

Selects an item in a SapGui combobox.

Include file

SapGui.bdh

Syntax

SapGuiSelectComboBoxEntry( in sControlId : string allownull,
                           in sEntry     : string,
                           in sTimer     : string optional ) : boolean;
Parameter Description
sControlId The uniquely identifying id of a combobox.
Sentry The value to be selected from the combobox.
sTimer Timer name used for measurements.

Return value

  • true if successful
  • false otherwise

Example

transaction TMain
  var
    sConnID : 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
    // Before running a test you have to customize the password parameter!
    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(3.8);
    SapGuiSetActiveWindow("wnd[0]", "Display Document: No address for SAP user in SAPoffice !", SAPGUI_MATCH_Exact);
    SapGuiSelectTab("usr/tabsSO33_TAB1/tabpTAB2");
    ThinkTime(4.0);
    SapGuiSelectTab("usr/tabsSO33_TAB1/tabpTAB3");
    ThinkTime(4.5);
    SapGuiTreeSetHierarchyWidth( "usr/tabsSO33_TAB1/tabpTAB3/ssubSUB1:SAPLSO09:0150/cntlSPLITTER/shellcont/shell/shellcont[0]/shell", 250);
    SapGuiSelectTab("usr/tabsSO33_TAB1/tabpTAB2");
    ThinkTime(9.0);
    SapGuiSelectComboBoxEntry("usr/tabsSO33_TAB1/tabpTAB2/ssubSUB1:SAPLSO33:1200/cmbSOS33-OBJPRI", "510", "High");
    SapGuiSetFocus("usr/tabsSO33_TAB1/tabpTAB2/ssubSUB1:SAPLSO33:1200/cmbSOS33-OBJPRI");
    SapGuiPressButton("tbar[0]/btn[15]");
            
    // Grid Control Info:
    // /app/con[0]/ses[0]/wnd[0]/usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell/9 columns
    // -------------------------------------
    // 1: STATSO:Message attributes
    // 2: OBJTP:Type
    // 3: OBJDES:Title
    // 4: ATTACH:Attachments
    // 5: CRADR:Author
    // 6: INDAT:Date received
    // 7: SNDCP:Copy
    // 8: RESUB:Resubmission
    // 9: RECCNT:Recipient
        
    // Business Workplace von DDIC
    ThinkTime(8.8);
    SapGuiSetActiveWindow("wnd[0]", "Business Workplace von DDIC", SAPGUI_MATCH_Exact);
    SapGuiPressButton("tbar[0]/btn[15]");

    // SAP Easy Access
    SapGuiSetActiveWindow("wnd[0]", "SAP Easy Access", SAPGUI_MATCH_Exact);
    ThinkTime(2.3);
    SapGuiPressButton("tbar[0]/btn[15]");

    // Log Off
    ThinkTime(2.0);
    SapGuiSetActiveWindow("wnd[1]", "Log Off", SAPGUI_MATCH_Exact);

    // Yes
    SapGuiPressButton("usr/btnSPOP-OPTION1", "Yes");
  end TMain;