on 07-10-2017 2:53 PM
Hi there,
I'm very new to coding SAP through scripts so apologies if there is a really obvious answer to this. I've tried using the record function to capture what I want to do but it doesn't capture me copying the text using the keyboard so I was wondering if there was another way..... here is what I have so far.
session.FindById("wnd[0]").SendVKey 0
session.FindById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").DoubleClickCurrentCell
session.FindById("wnd[0]/tbar[1]/btn[5]").Press
session.FindById("wnd[0]/usr/shell/shellcont[1]/shell[1]").SelectItem " 2", "&Hierarchy"
Everything works great up until this point and does exactly as it should. What I want to do next is copy the contents of the selected item. I can do this easily by using CTRL-C on the keyboard but I can't find the proper way of either using sendkeys or allocating the text to a variable such as..
variable1 = session.FindById("wnd[0]/usr/shell/shellcont[1]/shell[1]").SelectItem " 2", "&Hierarchy"
session.FindById("wnd[0]/usr/shell/shellcont[1]/shell[1]").SendVKey V92
Both options give errors though.
Many thanks in advance for any assistance.
Hello Scott,
try this to copy the content of an active cell to the clipboard.
CurrCellRow = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").CurrentCellRow()
CurrCellCol = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").CurrentCellColumn()
CurrCellContent = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").GetCellValue(CurrCellRow, CurrCellCol)
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Navigate("about:blank")
oIE.document.parentwindow.clipboardData.SetData "text", CurrCellContent
oIE.Quit
'Now is the content of the cell in the clipboard
Let us know your results.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.