SapGuiGridGetRowCount Function

Action

This function returns the number of rows of a SapGui grid control.

Include file

SapGui.bdh

Syntax

SapGuiGridGetRowCount( in    csControlId : string,
                       inout iCount      : number ) : boolean;
Parameter Description
sControlId The unique id of the grid
iCount The value to be assigned the number of rows.

Return value

  • true if successful

  • false otherwise

Example

transaction TMain
  var
    iCount  : number;
    sConnID : string;
  begin
    // Connecting to SAP
    sConnID := SapGuiOpenConnection( " /SAP_CODEPAGE=1100 /FULLMENU 10.5.2.132 0 /3");

    SapGuiSetActiveConnection(sConnID);

    SapGuiSetActiveSession("ses[0]");

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

    SapGuiWindowAction(SAPGUI_WND_MAXIMIZE);

    SapGuiLogon("ddic", "*******", "000", "");
    SapGuiIgnoreError(SAPENGINE_STATUSBAR_CHANGED, SEVERITY_SUCCESS);
    SapGuiSetActiveWindow("wnd[0]", "SAP Easy Access", SAPGUI_MATCH_ExactNoCase);

    SapGuiSelectTopNode( "usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[0]/shell", "Workplace: DDIC", " 1", "TopNode\\Workplace: DDIC");

    ThinkTime(16.8);
    SapGuiGridSelectCell( "usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell", 1, "OBJDES");

    // Store the number of rows in iCount
    SapGuiGridGetRowCount( "usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell" , iCount);
  end TMain;