Skip to Content
0
Former Member
Mar 01, 2013 at 01:50 PM

CHECK-IN problem with BAPI_DOCUMENT_CREATE2 in RFC

686 Views

Dear Experts,

I have created a Function module which calls the BAPI "BAPI_DOCUMENT_CREATE2" to create a DMS document into SAP. I give to this function, a link to a PDF file in my computer to add an attachment to the DMS document.

The document is created but I have a problem to check-in the PDF file in the document.

When I execute the function in the SE37 transaction, there is no problem. The document is created and the check-in of the attachment is OK.

But, when I call the function by RFC in a java class (with JCO connector), the document is created but the check-in of the attachment doesn’t work. The error 26 253 is returned with this message: "Error while checking in and storing: C://OAF/Data/80000121.pdf".

I have found some people in the same case and tried their solutions (put different values to PF_FTP_DEST and PF_HTTP_DEST parameters, use API functions, give the hostname,…), but none of them have worked.

Here is what I give to the function:

T_DOCDATA-DOCUMENTTYPE = 'BVV'.
T_DOCDATA-DOCUMENTNUMBER = '*'.
T_DOCDATA-DOCUMENTVERSION = '00'.
T_DOCDATA-DOCUMENTPART = '000'.
T_DOCDATA-DESCRIPTION = FILENAME. (Ex : 80000121)
T_DOCDATA-VALIDFROMDATE = CRT_DATE.
T_DOCDATA-STATUSINTERN = 'AA'.

DOCUMENTFILES-WSAPPLICATION = 'PDF'.
DOCUMENTFILES-DESCRIPTION = FILENAME.
DOCUMENTFILES-DOCFILE = FILE_PATH. (Ex : "C://OAF/Data/80000121.pdf")

DOCUMENTFILES-STORAGECATEGORY = 'DMS_C1_ST'.

CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
DOCUMENTDATA = T_DOCDATA
* HOSTNAME =
PF_FTP_DEST = 'SAPFTP'
PF_HTTP_DEST = 'SAPHTTPA'
DEFAULTCLASS = 'X'
IMPORTING
DOCUMENTNUMBER = L_DOCNR
TABLES
* OBJECTLINKS =
DOCUMENTFILES = DOCUMENTFILES.

If someone could help me for my problem ?

I hope I have explained myself clearly.

Thanks and Regards

Cédric Jacques.