on 01-07-2014 10:01 AM
Hello,
i am a biginner.
i use a Windows Visual Basic script.
the script calls a SAP Table
I have to read the Content of some cells.
But sometimes a User have an other Layout of the table and the Column is not listetd.
How can i check the Column name is available
how can i check the column Names of the Table.
session.findbyid("Wnd[0]......").columns(3).title
don't work.
Laufzeitfehler 438
Antworten gerne auch in deutsch.
Hi Emil,
If you present us a little of your code, then we could help you under certain circumstances.
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, thank you for your interest
here the structur of the code
1. standard Logon procedure
2. Call the transaction
3. Call the table with session.findById("wnd[0]/tbar[1]/btn[8]").press
If session.ActiveWindow.Name <> "wnd[0]" Then
GoTo errorhandler
End If
Set table = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell")
Now, i have to check the column names of the table.
How can i get these?
i found an indirect way to check with
If table.GetColumnPosition("ANUM") < 0 Then
GoTo errorhandler
end if
but it would be better to have an output of the column names.
Regards,
Emil
Dear Emil,
The id doesn't seem to be like a GuiTableControl, but GuiGridView.
If you want to get the Title of the grid as displayed in SAPgui, you can try the following in VBA:
Dim colmax As Long
Dim i As Long
colmax = table.ColumnCount - 1
For i = 0 To colmax
MsgBox table.GetDisplayedColumnTitle(table.ColumnOrder(i))
Next i
Thanks,
Sayuti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.