Application Development 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: 

Problem with Local File Identification in RFC

former_member273752
Participant
0 Kudos

Dear all,

We are working on a scenario where we have to integrate an external application with SAP system. The external application would use SAP DMS as document repository; It will send us a local file path and we have to upload the document located in that path as an attachment to a DMS Document Info Record. We have designed a wrapper RFC for this purpose, which encapsulates the standard Fm BAPI_DOCUMENT_CREATE2. This BAPI takes a file path input under table parameter DOCUMENTFILES. Problem is, when we are running the RFC from SAP GUI, the document info record is created correctly with the document as attachment, but when we invoke the RFC from the external application, the process fails and we get an error message stating:"Error while checking in Original Files". We debugged the scenario and found out that, while running under SAP GUI, the BAPI is able to identify a GUI Link, and hence succeeds; but while calling from the external application, the BAPI fails to find a GUI Link, tries to start a FTP Server using RFC Destination SAPFTP, and fails. So, obviously, the BAPI is not able to parse the local file path because of non-existence of GUI Link. So,in this regard, my question is: is there no way that we can pass a local file path from an external application to SAP, and get the same identified and get the document uploaded? Is there any alternative to our approach?

Awaiting answers.

Regards,

Sid

3 REPLIES 3

former_member273752
Participant
0 Kudos

Hi,

Any ideas,anyone?

Thanks and Regards,

Former Member
0 Kudos

Hi Sid,

An alternative could be to send the binary data to the RFC and have it uploaded by a function module like BDS_BUSINESSDOCUMENT_CREA_TAB.

You can take a look at this blog about uploading files to the BDS: /people/raja.thangamani/blog/2007/06/27/bsphow-to-create-attachment-in-business-transactions

Hope this works for you!

With kind regards,

Roel van den Berge

former_member273752
Participant
0 Kudos

Solved the problem by:

Converting file content to binary->transferring binary content to a wrapper RFC->writing the content into a temporary file in application server->then calling BAPI_DOCUMENT_CREATE2 to create the document without attachment->then calling CVAPI_DOC_CHECKIN to checkin the temporay file from application server.

Related references:

http://wiki.sdn.sap.com/wiki/display/PLM/DMSandbackground+processing

https://websmp130.sap-ag.de/sap/support/notes/504692

Thanks to All who have contributed to the Solution.

Sincere Regards,

Sid