Skip to Content
avatar image
Former Member

SAP Script

I'm currently trying to copy cell values from a table in SAP and pasting it to a text document.

Can someone please help me with the following error:

Object does not support method getcellvalue

If Not IsObject(application) Then
   Set SapGuiAuto  = GetObject("SAPGUI")
   Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
   Set connection = application.Children(0)
End If
If Not IsObject(session) Then
   Set session    = connection.Children(0)
End If
If IsObject(WScript) Then
   WScript.ConnectObject session,     "on"
   WScript.ConnectObject application, "on"
End If

Set fso = CreateObject("Scripting.FileSystemObject")

Set TextFile = fso.CreateTextFile("C:\Users\m313501\Desktop\Conc.txt",True)

For ROW = 0 To 10

CELL = session.findById("wnd[0]/usr/tabsTAB_GROUP_10/tabp10\TAB10/ssubSUB_GROUP_10:SAPLIQS0:7210/tabsTAB_GROUP_20/tabp20\TAB03/ssubSUB_GROUP_20:SAPLIQS0:7125/tblSAPLIQS0MASSNAH_VIEWER2/txtVIQMSM-QSMNUM[ROW,ROW]").GetCellValue(ROW,ROW)

TextFile.WriteLine CELL

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 26, 2017 at 10:03 AM

    Hi Billy,

    if this is really a table, it should look like this.

    for example:

    CELL = session.findById("wnd[0]/usr/tabsTAB_GROUP_10/tabp10\TAB10/ssubSUB_GROUP_10:SAPLIQS0:7210/tabsTAB_GROUP_20/tabp20\TAB03/ssubSUB_GROUP_20:SAPLIQS0:7125/tblSAPLIQS0MASSNAH_VIEWER2/txtVIQMSM-QSMNUM[2," & cstr(ROW) & "]").text

    The column number is permanently set to 2. If this is also to be variable, it looks as follows:

    CELL = session.findById("wnd[0]/usr/tabsTAB_GROUP_10/tabp10\TAB10/ssubSUB_GROUP_10:SAPLIQS0:7210/tabsTAB_GROUP_20/tabp20\TAB03/ssubSUB_GROUP_20:SAPLIQS0:7125/tblSAPLIQS0MASSNAH_VIEWER2/txtVIQMSM-QSMNUM[" & cstr(COL) & "," & cstr(ROW) & "]").text

    The method getcellvalue is used with an ALV-GRID.



    Add comment
    10|10000 characters needed characters exceeded