Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with RFC call from VB

Status
Not open for further replies.

pkailas

Programmer
Jun 10, 2002
555
0
0
US
I have a client that needs to have me query their SAP system from within an application that uses VBA. I have successfully written the portion that logs onto their SAP. I just have no experience with the syntax to use their custom RFC that they have provided me. I only know this much.

the import parameters and order:

TEMPLATE
STRAS
PSTLZ
PFACH

Then there are 2 returned values

MESSAGE
LIFNR

Here's what I have so far.

Dim sapConnection As Object 'Connection object
Dim theFunc As Object 'Function object
Dim functionCtrl As SAPFunctions

Set functionCtrl = New SAPFunctions
Set sapConnection = functionCtrl.Connection

sapConnection.ApplicationServer = "x.x.x.x"
sapConnection.client = "###"
sapConnection.Language = "EN"
sapConnection.user = "xxxxx"
sapConnection.Password = "xxxxx"

If sapConnection.logon(0, True) <> True Then
MsgBox "failed"
exit sub
end if

Set theFunc = functionCtrl.Add("Z_NK_RFC_VENDOR_LOOKUP")


From here I'm completely lost. How do I send the field values that I have such as the TEMPLATE or (PSTLZ and PFACH).

What this query is to do is return a vendor number and a message such as (Valid Vendor) when sent either a Document Type or a PO Box and Zipcode.

Thanks in advance.


_______
I love small animals, especially with a good brown gravy....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top