Skip to Content
0

Connecting SAP and Sharepoint by ABAP and WebDAV

Jun 06, 2017 at 09:11 AM

110

avatar image
Former Member

Hello everybody,

I'm trying to read and write files from our SAP system (ERP) to Sharepoint (in the Office365-cloud). I think WebDAV is the way to go, so after some searching I came to this testprogram.

PARAMETERS:
p_host TYPE string DEFAULT 'https://<companyname>.sharepoint.com' LOWER CASE ,
p_url  TYPE string DEFAULT '/sites/<dir1>/<dir2>/' LOWER CASE,
p_unam TYPE string DEFAULT '<user email>' ,
p_pwd  TYPE string LOWER CASE.


DATA:
  lo_connection TYPE REF TO if_swdcl_connection,
  lo_client     TYPE REF TO if_swdcl_client,
  lo_namespace  TYPE REF TO if_swdcl_namespace_client,
  l_content     TYPE xstring,
  lo_error      TYPE REF TO cx_root,
  ip_http_client TYPE REF TO IF_HTTP_CLIENT.


DATA: mt_tab TYPE sdavc_tt_resource_data,
      ms_tab TYPE sdavc_ts_resource_data,
      prop TYPE REF TO if_swdcl_property_client.


START-OF-SELECTION.
  TRY.
      lo_connection = cl_swdcl_connection=>create_by_user(
        i_server      = p_host
        i_user        = p_unam
        i_password    = p_pwd
      ).


      lo_client = cl_swdcl_client=>get_instance( lo_connection ).


      prop = lo_client->get_property_client( ).
      prop->get_properties(
          EXPORTING
            i_url                 = p_url
            i_depth               = '1'  
          RECEIVING
            rt_resources          = mt_tab 
        ).


      LOOP AT mt_tab INTO ms_tab.


      ENDLOOP.

As a first step I'm trying to read the contents of the directory, but I keep getting HTTP error 400 "ICM_HTTP_CONNECTION_FAILED" and DAV_ERROR "SF I616ZTEST102" on get_properties.

What am I doing wrong ?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers