Skip to Content
0

Scriptrecorder is not recording "copy text" in contextmenu and recording other options

Jul 12, 2017 at 12:48 PM

236

avatar image
Former Member

Hi,

I tried using the below blog and following code, but script is throwing an error. Where as its recording all options other than "CopyText" in the context menu.

https://archive.sap.com/discussions/thread/3308007

Code:-

session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").contextMenu

session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectContextMenuItemByPosition "0"

Or this:

session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").contextMenu

session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectContextMenuItemByText "Text kopieren"

My Code :-

ById("wnd[1]/usr/cntlGRID/shellcont/shell").selectContextMenuItem "&FIND"
session.findById("wnd[2]/usr/txtGS_SEARCH-VALUE").setFocus
session.findById("wnd[2]/usr/txtGS_SEARCH-VALUE").caretPosition = 0
session.findById("wnd[2]").sendVKey 0
session.findById("wnd[2]/tbar[0]/btn[12]").press
session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").contextMenu
session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").selectContextMenuItem "&FIND_MORE"
session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").contextMenu
session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").selectContextMenuItem "&FILTER"

Can someone please help ?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Stefan Schnell
Jul 12, 2017 at 02:44 PM
0

Hello Sumanth,

try the following code and let us know your results.

session.findById("wnd[0]/tbar[0]/okcd").text = "/nse38"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtRS38M-PROGRAMM").text = "BCALV_FULLSCREEN_DEMO"
session.findById("wnd[0]/tbar[1]/btn[8]").press

session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").selectColumn "SEATSOCC"

session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").contextMenu
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").selectContextMenuItem "&FIND"
If IsObject(Wscript) Then
  WScript.Sleep 1000
End If
session.findById("wnd[1]/tbar[0]/btn[12]").press
 
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").contextMenu
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").selectContextMenuItemByPosition "0"

In my case it works without any problems.

Cheers
Stefan

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Stefan,

Thanks for the prompt reply.

I tried the same yesterday , it didnt work, but good that it worked now, not sure how is that ...

Anyhow thanks a lot :)

1