cancel
Showing results for 
Search instead for 
Did you mean: 

Allow start of program sapftp in VB for CVAPI_DOC_CREATE

Former Member
0 Kudos

Hi,

I wrote a VB program that creates documents in SAP via the RFC function module CVAPI_DOC_CREATE.

I already wrote a PHP version of the same program and it works.

Before calling function CVAPI_DOC_CREATE, there is an instruction that allows the sap server to start program sapftp on the client. SAPFTP program is then used to transfer files from client to R/3 server.

PHP version : $rc = saprfc_allow_start_program ("sapftp");

Java version: JCO.setMiddlewareProperty("jco.middleware.allow_start_of_programs", "sapftp")

Does any one knows the VB version of this instruction ?

Thanks for any help you can provide

Abdel SIDHOM

Accepted Solutions (0)

Answers (1)

Answers (1)

andrefischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Abdel,

the following code can be used to start notepad from a C# programm.

System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "Notepad";
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
myProcess.Start();

Best regards,

André

Former Member
0 Kudos

Thanks André,

In this thread , we talk about function "RfcAllowStartProgram in librfc32.dll.

Can anybody tell me how to call this vb function.

Thanks,

Abdel

Former Member
0 Kudos

Hi Abdel,

how are you doing ?

are you using vb.net or vb 6 ?

it should not be any different than adding any resistered DLL ( for vb 6)

for .net you will need to find the class in the SAP.Connector set of classes ...

with respect,

amit

Former Member
0 Kudos

Thanks amit,

I'm using VBS version 5.6

Do you know the dll containing this class ?

Thanks

Abdel

Former Member
0 Kudos

Hi Abdel,

you will need to add reference to librfc32.dll

is there any specific reason you are using vb 5.6 ?

perhaps we could bring you into the mainstream connector usage if you move up to VB .NET

with respect,

amit

Former Member
0 Kudos

Hi All,

I finally fixed the problem with VB6 by adding :

Private Declare Function RfcAllowStartProgram Lib "librfc32.dll" (ByVal s As String) As Long

Result = RfcAllowStartProgram("sapftp")

The RfcAllowStartProgram function must be called before calling CVAPI_DOC_CREATE function module.

Regards,

Abdel