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: 

Saving file to SharePoint using open dataset

scottcarricknwn
Participant

Are there any issues with using open dataset for writing a file (in this case a pdf) to a SharePoint folder? I have tried several valid URL's when doing so and I mostly get "No such file or directory" returned as an error. One URL resulted in a an abend stating "no authorization", however I am running the process myself and I have full access to SP site. Does SAP and SP just not work well together via ABAP?

OPEN DATASET l_filename FOR OUTPUT IN BINARY MODE MESSAGE error.

3 REPLIES 3

karim_benakli_kb
Participant
0 Kudos

Hi,

SAP and SP do not work in "open dataset" mode via ABAP. What you need to do is call SharePoint REST services to have it working. We have a partner who's doing that for us, znk consulting, see their site

Rgds,

K

raymond_giuseppi
Active Contributor
0 Kudos

Are your SharePoint and SAP hosted on same server?

  • In the first case than can be as easy than a GUI_UPLOAD.
  • In the second case, better look for http class (cl_http_client, cl_rest_http_client) Rest WebServices or third parties toools.

Hint: perform some search on UNC path


mateuszadamus
Active Contributor
0 Kudos

Hello scottcarricknwn

Here's a code on how to upload a file to SharePoint using SharePoint's API.

https://answers.sap.com/answers/13048963/view.html

You need to have SharePoint API access and account to be able to do that. For that you need to contact your SharePoint administrators.

Kind regards,
Mateusz