Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

issue in calling archive file functions from VB code

Former Member
0 Likes
578

hi

we have a requirement of creating archive link document for employees using RFC which will be called via VB , the code we are using , uses standard FM

<ARCHIV_CREATE_FILE> in the RFC FM we have created

Private Const RAccess As String = " "

Private Declare Function RfcAllowStartProgram Lib "librfc32" (ByVal RAccess As String) As Integer

Sub test()

Dim fns

Dim par1

Dim par2

Dim par3

Dim par4

Dim par5

Set fns = CreateObject("SAP.Functions")

Set funcControl = CreateObject("SAP.Functions")

fns.logfilename = "my_log.txt"

fns.loglevel = 6

Dim conn

Set conn = fns.Connection

conn.ApplicationServer = "XXX.XX.XX.XX"

conn.System = "DEV"

conn.Systemnumber = "10"

conn.user = "abc"

conn.Password = "xyz"

conn.Client = "100"

conn.Language = "E"

conn.tracelevel = 6

If conn.logon(0, True) <> True Then

MsgBox "Could not connect to SAP R/3"

Else

MsgBox "Connected"

End If

ReturnCode = RfcAllowStartProgram("sapftp;saphttp")

funcControl.Connection = conn

Set RFC_READ_TABLE = funcControl.Add("ZFM")

Set strExport1 = RFC_READ_TABLE.exports("EMPLOYEENO")

Set strExport2 = RFC_READ_TABLE.exports("DOCUMENTTYPE")

Set strExport3 = RFC_READ_TABLE.exports("FILEPATH") '

strExport1.Value = "99999999"

strExport2.Value = "ZXXXX"

strExport3.Value = "C:\temp\Desert.jpg"

result = RFC_READ_TABLE.call

end sub

i get the result as false , when i debug the application , i get the error " only available with the rfc library from 4.0c onwa"

pls help

regards

sameer.

3 REPLIES 3
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
515

Sameer please search for this message you will find sap note to be implemented in one of threads. Please always search before posting

Read only

0 Likes
515

hi

i checked lots of threads , but this note says to use the LIBRFC32 of correct version , i have done the same , still am getting this error. I have downloaded all the new software dll and sapftp etc but still am getting error.

Nabheet , i have posted this after lot of trail and error and search , but i forgot to mention that all the threads have been refered to. If you have any specific note other than what i mentioned ,please help.

Regards

sameer

Read only

0 Likes
515

http://scn.sap.com/thread/1486105

Pleasecheck this thread

nabheet