on 07-11-2011 1:55 PM
Hello!
I'm new to the SAP scripting. On my company we use lots and lots of Excel spreadsheet lists with sales orders and projects, which is why i need to learn to connect those lists with SAP.
I have a list of sales orders in Excel starting downwards from cell A2 and I want to get the exchange rate on each of the orders from the header of VA03, so that the script copies the currency rate of each sales order next to the order number in the spreadsheet.
How do i do this? :s
Thanks, Mattias
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mattias,
if you have allready worked with Scripting (Recording) you allready have the way to connect excel with SAP
To Connect an existing Instance of SAP with Excel you will need this code:
Public sapsession
Public Sub Connect_SAP()
If Not IsObject(SAPguiApp) Then
Set SAPguiApp = CreateObject("Sapgui.ScriptingCtrl.1")
End If
If Not IsObject(sapsession) Then
Set sapsession = sapConnection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject sapsession, "on"
WScript.ConnectObject sapApplication, "on"
End If
End Sub
at end of all action you have to destroy all objects
Public Sub Destory_SAP()
set sapsession = nothing
set sapapplication = Nothing
set sapGuiapp = Nothing
End Sub
PS Look for Threads that have the same Title as yours -
There are many in this forum ...
Greetings
Thomas B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.