SapGuiGridGetColumnName Function

Action

This function retrieves the name of a specified column of a SapGui grid control.

Include file

SapGui.bdh

Syntax

SapGuiGridGetColumnName( in  csControlId : string, 
                         in  iCol        : number,
                         out sVal        : string) : boolean;
Parameter Description
sControlId The unique id of the grid.
iCol The based index of the column. The first column is 0. Note that the index does not necessarily reflect the displayed order of the column. Call SapGuiGridGetColumnOrder to get the diplayed order of columns.
sVal The parameter will be assigned the name of the column.

Return value

  • true if successful
  • false otherwise

Example

transaction TMain
  var
    iCol     : number;
    sConnID  : string;
    sColName : 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");
    
    // Write the name of 3rd column into sColName
    SapGuiGridGetColumnName( "usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell" , 2, sColName);
    
  end TMain;