Advertisement

05.16.2008 at 08:19AM PDT, ID: 23408593
[x]
Attachment Details

SAP VB script from Access

Asked by bsncp in Access Coding/Macros, SAP ERP Software, VB Script

I've pasted my SAP GUI script into a Microsoft Access module.  the script works if I run the .VBS file from my desktop, but when I try to run from within Access, I get a comile error 'Method or Data Member not found and it highlights .Children as if that were the issue.  I've added every single SAP option in my references and it still won't run.  Is there just one specific reference I need or is this code somehow not compatible with Access?


I'm using Access 2003
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
Function GrabOrders()
 
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]/tbar[0]/okcd").Text = "sq00"
Session.findById("wnd[0]").sendVKey 0
Session.findById("wnd[0]").sendVKey 19
Session.findById("wnd[1]").sendVKey 71
Session.findById("wnd[2]/usr/txtRSYSF-STRING").Text = "RWHITE"
Session.findById("wnd[2]/usr/txtRSYSF-STRING").caretPosition = 6
Session.findById("wnd[2]").sendVKey 0
Session.findById("wnd[3]/usr/lbl[0,2]").SetFocus
Session.findById("wnd[3]/usr/lbl[0,2]").caretPosition = 3
Session.findById("wnd[3]").sendVKey 2
Session.findById("wnd[1]").sendVKey 0
Session.findById("wnd[0]/usr/ctxtRS38R-QNUM").Text = "ZORDERFREIGHT"
Session.findById("wnd[0]/usr/ctxtRS38R-QNUM").caretPosition = 13
Session.findById("wnd[0]").sendVKey 17
Session.findById("wnd[1]/usr/ctxtRS38R-VARIANT").Text = "STARTUP"
Session.findById("wnd[1]/usr/ctxtRS38R-VARIANT").caretPosition = 7
Session.findById("wnd[1]").sendVKey 0
Session.findById("wnd[0]").sendVKey 12
Session.findById("wnd[0]").sendVKey 17
Session.findById("wnd[1]/usr/ctxtRS38R-VARIANT").Text = "YESTERDAY"
Session.findById("wnd[1]/usr/ctxtRS38R-VARIANT").caretPosition = 9
Session.findById("wnd[1]").sendVKey 0
Session.findById("wnd[0]").sendVKey 8
 
End Function
 
Keywords: SAP VB script from Access
 
Loading Advertisement...
 
[+][-]05.16.2008 at 08:28AM PDT, ID: 21583606

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 08:35AM PDT, ID: 21583677

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:03AM PDT, ID: 21583961

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:06AM PDT, ID: 21583984

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:18AM PDT, ID: 21584090

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:43AM PDT, ID: 21584294

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 10:11AM PDT, ID: 21584506

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 06:04AM PDT, ID: 21614551

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 07:43AM PDT, ID: 21615597

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 06:35AM PDT, ID: 21623654

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, SAP ERP Software, VB Script
Sign Up Now!
Solution Provided By: wildboy85
Participating Experts: 1
Solution Grade: B
 
 
[+][-]05.22.2008 at 02:40PM PDT, ID: 21627893

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628