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: 

Connecting SAP and Sharepoint by ABAP and WebDAV

dirk_floor
Explorer
0 Kudos

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 ?

0 REPLIES 0