RFC Easy
Hi.
ANybody can help me with a very easy sample of VB RFC for execution of a Function Module ?
Thanks in advance.
Yep,
Have a look at this:
Set R3 = Logon_To_Sap("system", "client", "user", "pword")
If Not R3 Is Nothing Then
If R3.Z_SO_AUTOMATION_CHECK_CREDS(Exception, _
I_Bname:=User_Name.Text, _
I_VkOrg:=VKOrg.Text, _
I_Vtweg:=VtWeg.Text, _
I_Spart:=Spart.Text, _
I_VkBur:=VkBur.Text, _
I_VkGrp:=VkGrp.Text, _
E_Message:=Message) Then
If Exception <> "" Then
Call Error("Z_SA_AUTOMATION_CHECK_CREDS - " & Exception)
Else
If Message <> "" Then
Call Error(Message)
Else
'*
'* Ok, no error messages, save the logon data and
'*
.....
.....
The function Logon to SAP looks like this:
'***************************************************************************
'*
'* Function: Logon_To_SAP as Object
'*
'* Purpose: Logs onto an SAP system using the provided criteria and returns
'* a connection object to the caller
'*
'* Entry: System name to log on to as string
'* Client of system as string
'* User name as string
'* Password as String
'*
'* Exit: SAP Connection object
'*
'* Calls:
'*
'***************************************************************************
'*
Function Logon_To_Sap(System As String, Client As String, User As String, Password As String) As Object
Dim SAP As Object
Dim Connection As Object
'*
Call Push_Status("Connecting to SAP. Please Wait")
Set SAP = CreateObject("SAP.Functions")
SAP.Connection.ApplicationServer = System
SAP.Connection.SystemNumber = "00"
SAP.Connection.User = User
SAP.Connection.Password = Password
SAP.Connection.Client = Client
SAP.Connection.Language = "E"
'*
'* The 'True' argument forces a silent logon. Changing this
'* to false will display the logon dialogs.
'*
If SAP.Connection.Logon(0, True) = False Then
Set SAP = Nothing
End If
Call Pop_Status
Set Logon_To_Sap = SAP
End Function
Regards
R
hi,R,
have you some sample of RFC with Borland Delphi?
thanks.
_________________
I Like SAP