on 09-25-2009 7:59 AM
Hello,
Ihave a VBA code that calls a BAPI via RFC to checkout a document. The Problem is that I get an error like in the subject. Here is my Code
Private Declare Sub RfcAllowStartProgram Lib "librfc32.dll" (value As Any)
Sub checkout_file()
Dim oDocument As Object
Dim oDocumentFile As Object
Dim oDocumentFiles As Object
Dim oReturn As Object
Dim oBAPICtrl As Object
'Creating BAPI object
Set oBAPICtrl = CreateObject("SAP.BAPI.1")
Set oConnection = oBAPICtrl.Connection
If oConnection.Logon(0, False) = False Then
MsgBox "No access to R/3 System"
Exit Sub 'Programm beenden
End If
RfcAllowStartProgram ByVal 0&
'Creating lokal instance of BO "Draw"
Set oDocument = oBAPICtrl.GetSAPObject("DRAW", "PM2", "A5N00030059989", "D", "000")
If Err.Number <> 0 Then
MsgBox "No local BO 'Draw' created!"
Exit Sub
End If
Set oDocumentFile = oBAPICtrl.DimAs(oDocument, "CheckOutView2", "DocumentFile")
oDocumentFile("WSAPPLICATION") = "DOC"
oDocument.CheckOutView2 OriginalPath:="D:\test\", _
DocumentFile:=oDocumentFile, _
DOCUMENTFILES:=oDocumentFiles, _
DocumentStructure:=oDocumentStructure, Return:=oReturn
MsgBox oDocumentFiles.RowCount
MsgBox oReturn("MESSAGE")
Set oConnection = Nothing
Set oBAPICtrl = Nothing
End Sub
I have the newest librfc32.dll in my System32 folder (Version 7110.0.46.6208). Where is the problem? Can it be a problem on the application server or something?
Thank you,
Thomander
Hi Thomander,
Note 885058 indicates that the problem is resolved with the latest
RFC and ICU files. The RFC library is contained in the RFCSDK, please
ensure that you are using the latest SDK, it can be downloaded from the
following location:
Support Packages and Patches
==> Additional Components
==> SAP NW RFC SDK
==> SAP NW RFC SDK 7.10
==>Your OS
ICU libraries can be downloaded from service market place as part of
sap kernel. There are contained in the complete package sapexe.car
& in a seperate package UCLIB.sar
-> service.sap.com/patches
-> Entry by application group
-> additional component
-> SAP Kernel [ select the correct versions] & download the file
The naming convention of the library files varies depending on the
operating system, they may be called
"libicuuc.so.26", "libicuuc.sl.26", "libicuuc26.so" or "icuuc26.dll",
for example. You must therefore adjust the unpacking statements
accordingly.
Unpack the library to the temporary directory & then move it to the
kernel directory ("/usr/sap/<SID>/SYS/exe/run").
Caution: Make sure that the libicu* libraries do not overwrite any
existing files.
Once you are using the latest RFC and ICU files you should be ok.
Maybe the information in the following link could also be useful for this kind of error:
https://www.sdn.sap.com/irj/scn/wiki?path=/display/plm/i001Win32error+2
Best regards,
Christoph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomander,
please note that DMS BAPIs require always a SAPGUI channel or open RFC connection to start the SAPHTTP/SAPFTP program that is used to up- or download files to the client. If the BAPI ist executed in background mode, the system doesn't know from where to get the original file.
Please do not use BAPIs in background mode, use APIs instead. They are more flexible regarding RFC calls (background processing). Please see SAP note 504692, which contains sample programs for special checkin/checkout cases. Please read this note and use the sample programs as a basis for your own coding. Further please see also SAP note 796709 which also might contain useful information for such cases.
Unfortunately, there is no standard solution for calling DMS BAPIs in the background. If you need more assistance with your own coding, please contact our Remote Consulting Team. They are the right guys for consulting issues.
Best regards,
Christoph
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.