on 2025 Jan 17 3:04 PM
Hello everyone
I am using Power Automate Desktop (PAD) to create an RPA to access transaction FB03 and print some documents and I have a problem
I use a SAP script (VBA) to access the printing and the problem I have is that the script does not take control of the Windows printing to obtain the PDF and I have to do it with PAD and it usually fails from time to time. Is there any way for the SAP script to access the Windows print screen and print the document? Thanks for your help.
This is the script and the PAD code.
Script
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
session.findById("wnd[0]").maximize
session.findById("wnd[0]/usr").horizontalScrollbar.position = 39
session.findById("wnd[0]/usr/lbl[154,13]").setFocus
session.findById("wnd[0]/usr/lbl[154,13]").caretPosition = 1
session.findById("wnd[0]").sendVKey 2
session.findById("wnd[0]/usr/txtBSEG-AUGBL").setFocus
session.findById("wnd[0]/usr/txtBSEG-AUGBL").caretPosition = 8
session.findById("wnd[0]").sendVKey 2
session.findById("wnd[0]/mbar/menu[0]/menu[5]").select
session.findById("wnd[0]/tbar[0]/btn[86]").press
session.findById("wnd[1]/tbar[0]/btn[13]").press
PAD screen
Request clarification before answering.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.