on 08-08-2014 1:39 PM
Hello:
Iv'e been trying to automate dragging and dropping files into the TextEdit window via transaction OAWD. I've recorded the script using the script recorder and get this:
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "oawd"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/lbl[5,3]").setFocus
session.findById("wnd[0]/usr/lbl[5,3]").caretPosition = 1
session.findById("wnd[0]").sendVKey 2
session.findById("wnd[0]/usr/lbl[12,5]").setFocus
session.findById("wnd[0]/usr/lbl[12,5]").caretPosition = 0
session.findById("wnd[0]").sendVKey 2
session.findById("wnd[1]/usr/txt[2]").text = "Test 2"
session.findById("wnd[1]/usr/txt[2]").caretPosition = 6
session.findById("wnd[1]/tbar[0]/btn[9]").press
session.findById("wnd[1]/usr/ssub/1/cntlSPLITTER/shellcont/shellcont/shell/shellcont[0]/shell").hierarchyHeaderWidth = 286
session.findById("wnd[1]/usr/ssub/1/cntlSPLITTER/shellcont/shellcont/shell/shellcont[1]/shell").multipleFilesDropped
session.findById("wnd[1]/usr/ssub/1/cntlSPLITTER/shellcont/shellcont/shell/shellcont[1]/shell").setSelectionIndexes 73,99
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/tbar[0]/btn[12]").press
session.findById("wnd[0]/tbar[0]/btn[3]").press
The .multipleFilesDropped is a method defined in the Scripting Help as :
Emulate a Drag&Drop operation, in which several files are dropped on the
textedit control. The collection contains for each file the fully qualified file
name as a string.
I've also tried replacing that method with the .SingleFileDropped method which is defined as:
This function emulates the drop of a single file with the directory path fileName.
I used .SingleFileDropped ("C:\SAP\myfile.pdf") when attempting this method.
No files are copied to the TextEdit window with either method. I'm trying to do this within an Excel macro and realize that my code will have to identify the files that should be dragged to the TextEdit window. Does anyone out there know how to automate the drag & drop step?
Hello Gary.
According to note 587202 SAP GUI Scripting does not Support Drag&Drop.
Best regards
Holger
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Holger: Thanks for the quick response. I found the note you mentioned and it's quoted below:
Drag and Drop is not supported in scripting. However, you should have the option of using the function without drag and drop in all applications.
What has me curious is the last sentence; ...you should have the option or using the function without drag and drop in all applications. Do you think there may be another way to get the files into the TextEdit window other than drag and drop?
You can choice FileOpen Dialog via OAWD. But there we have the next issue:
- No support for Microsoft common dialogs
Scripting for common dialogs (such as FileSave, FileOpen) is not supported.
I do not know if we have another Transaction beside OAWD which can get file-path as string Input.
When you want use MS Comm Dialog FileOpen you Need to use an seperate macro-enabled Excel instance which can control MS Comm FileOpen via USER32-Api calls during execution of SAP Session code.
This is an complex Workaround. Don´t know if this make any sense for your requirements.
Yes, Access to SE38 is very often restricted. What´s about Access for Transaction START_REPORT?
However, mentioned note include an customized Report 'ZOA_UPLOAD_AND_LINK'. So I assume you have to raise an Change request to your IT department for implementation of note 685520. Then you can request to make an customized Transaction for this new Report.
When this Report/transaction Support to save time for your daily Business I guess this Change can be implemented in your System landscape.
Br, Holger
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.