cancel
Showing results for 
Search instead for 
Did you mean: 

CHECK-IN problem with BAPI_DOCUMENT_CREATE2 in RFC

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Did you found any solution ?

I am on JCo3 and the parameter RfcAllowStartProgram  is not available there. Is there any substitute of this in JCo3.  I read somewhere that property use_sapgui should not be used as it needs SAP gui installed at client side.

Please suggest.

Thanks.

P.

Former Member
0 Kudos

Hello, Cédric!

I had the same problem.

First of all set the params

PF_FTP_DEST = 'SAPFTPA'

PF_HTTP_DEST = 'SAPHTTPA'

This tells the system to execute the process in background (on appserver).

When you see the message "Error while checking and storing : C:\..." it means that application server can't find the path. Of course he can't find your local path.

So, to make it work you must first upload the file to appserver and then you'll be able to attach it to everywhere. Please, refer to this topic to find the explanation of how to upload a file to appserver. http://scn.sap.com/message/13801145

christoph_hopf
Advisor
Advisor
0 Kudos

Hi Cédric,

generally from DMS point of view the functionality you would like to realize is a very special one for which no standard solution exists. However, API-s are more flexible in some cases, i.e. CVAPI_DOC_CHECKOUTVIEW with RFC destinations defined as SAPHTTPA/SAPFTPA could fulfill your requirements.

Please see also note 504692, which contains sample programs for the checkin in background. Further please see also the note 796709 which contain also necessary information for this action too.  As additional information source kindly go through the note 729800. This will be of use for the current issue. If one uses BAPI's in via RFC-Lib, the ABAP-System makes a callback and starts the saphttp, sapftp via theopen RFC channel. Therefore the RFC-Client has to allow this by calling RfcAllowStartProgram("sapftp;saphttp"). Please read also note 144256 that clearly describes the process.

Additionally please read also the information at http://wiki.sdn.sap.com/wiki/x/1oLWAw and I saw that the used file path starts with C:\\ and I think that this should be C:\.

Best regards,

Christoph