Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions ABAP SDK Walkthrough SharePoint with Graph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@


<H1 align="center">
<font size="16">
<b> Walkthrough for MS Graph using AAD Token V2.0 to work with SharePoint </b>
</font>
</H1>

<p align="center"

<https://github.com/Microsoft/ABAP-SDK-for-Azure>
</p>

<p align="right">
Author: Patrick Weber, BOMAG
</p>
<p align="right">
Version: 1.0
</p>

<h2 class="title">
Contents
</h2>

<div id="TOC">
<ul>
<li>
<a href="#Purpose">1. Purpose </a>
</li>
<li>
<a href="#Prerequisites">2. Prerequisites </a>
</li>
</ul>
</div>

* [2.1 Define RFC Destination for AAD Token V2](#heading--1-1)
* [2.2 Define RFC Destination for Graph](#heading--1-2)
* [2.3 Configuration](#heading--1-3)


<div id="TOC">
<ul>
<li>
<a href="#DEMO Program">3. DEMO Program</a>
</li>
</ul>
</div>

<div id="Purpose">
<h2>
<a href="#TOC">Purpose</a>
</h2>
<p>
</p>
</div>

If you want to connect with SharePoint Online i.e. to upload files, the available O365 classes of this SDK are not able to do this. I was mentioned to use MS Graph instead.

With MS Graph, you get a variety of rest services to connect with many Microsoft products running on Azure or Office 365 cloud. In this SDK, a first implementation
of MS Graph api is present and described. With this example, one can fetch user data and calendar items. In total, only three services of Graph has been implemented so far. To get my task done, I started to enhance ZCL_ADF_SERVICE_GRAPH class and added some methods to act with SharePoint Online. While doing this, I noted that the
access token provided by login.microsoft.com/oauth2/token was not sufficient to access Graph.

For anyone interested in interacting with SharePoint Online using MS Graph, necessary configuration of RFC destinations and ADF can be found here. Also a small demo program ZADF_DEMO_AZURE_GRAPH_V2 is available.

<div id="Prerequisites">
<h2>
<a href="#TOC">Prerequisites</a>
</h2>
<p>
Make sure you have installed ABAP SDK for Azure in your SAP system. Refer document ‘ABAP SDK for Azure –
GitHub’ for more details.
</p>
</div>

Visit <https://github.com/Microsoft/ABAP-SDK-for-Azure>

<div id="heading--1-1">
<h3>
<a href="#TOC">2.1 Define RFC Destination for AAD Token V2</a>
</h3>
<p>
Go to transaction SM59 in your SAP system and create new RFC destination of type ‘G’ like this
</p>
</div>

Target host: **login.microsoftonline.com**

Port: 443

Path Prefix: **/InputTenantID/oauth2/v2.0/token**

![](MD%20image/58.png)

<div id="heading--1-2">
<h3>
<a href="#TOC">2.2 Define RFC Destination for Graph</a>
</h3>
<p>
Go to transaction SM59 in your SAP system and create new RFC destination of type ‘G’ like this
</p>
</div>

Target host: **graph.microsoft.com**

Port: 443

Path Prefix: **/v1.0**

![](MD%20image/59.png)
<div id="heading--1-3">
<h3>
<a href="#TOC">2.3 Configuration</a>
</h3>
<p>
Go to transaction ZADF_CONFIG and define the necessary interface IDs. You will need three in total. Please note, that GRAPH_GET and GRAPH_PUT uses the same RFC
destination. We need two interfaces pointing to the same URI but we want to configure http header differently.
</p>
</div>

![](MD%20image/60.png)

Next go to SAP Azure Data Framework Configurations and create these three entries. Enter Client Secret into field Key/AAD for interface TOKEN_V2. Set call type to synchronuous for all three

![](MD%20image/62.png)

Next go to SAP Azure REST Call Header values and create these entries.
![](MD%20image/61.png)

<div id="DEMO Program">
<h3>
<a href="#TOC">3. DEMO Program</a>
</h3>

Report ZADF_DEMO_AZURE_GRAPH_V2 of package ZADF_DEMO shows different usage examples. It shows you how to
<ul>
<li>fetch ID of SharePoint Site Collection</li>
<li>get a list of all SharePoint lists of a site</li>
<li>get all list items of a list</li>
<li>get all drives (aka document libraries) </li>
<li>upload files to a drive</li>
</ul>
</div>




















Binary file added MD image/58.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MD image/59.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MD image/60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MD image/61.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MD image/62.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
<WITH_UNIT_TESTS>X</WITH_UNIT_TESTS>
</VSEOCLASS>
<DESCRIPTIONS>
<SEOCOMPOTX>
Expand Down
20 changes: 0 additions & 20 deletions src/zadf/zadf_con_indx.tabl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,90 +19,70 @@
</DD09L>
<DD03P_TABLE>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>MANDT</FIELDNAME>
<POSITION>0001</POSITION>
<KEYFLAG>X</KEYFLAG>
<ROLLNAME>MANDT</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<NOTNULL>X</NOTNULL>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>RELID</FIELDNAME>
<POSITION>0002</POSITION>
<KEYFLAG>X</KEYFLAG>
<ROLLNAME>INDX_RELID</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<NOTNULL>X</NOTNULL>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>SRTFD</FIELDNAME>
<POSITION>0003</POSITION>
<KEYFLAG>X</KEYFLAG>
<ROLLNAME>INDX_SRTFD</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<NOTNULL>X</NOTNULL>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>SRTF2</FIELDNAME>
<POSITION>0004</POSITION>
<KEYFLAG>X</KEYFLAG>
<ROLLNAME>INDX_SRTF2</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<NOTNULL>X</NOTNULL>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>ZDEL_IND</FIELDNAME>
<POSITION>0005</POSITION>
<ROLLNAME>SYCHAR01</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>AEDAT</FIELDNAME>
<POSITION>0006</POSITION>
<ROLLNAME>SYDATS</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<SHLPORIGIN>T</SHLPORIGIN>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>USERA</FIELDNAME>
<POSITION>0007</POSITION>
<ROLLNAME>USERNAME</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>PGMID</FIELDNAME>
<POSITION>0008</POSITION>
<ROLLNAME>PROGNAME</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>CLUSTR</FIELDNAME>
<POSITION>0009</POSITION>
<ROLLNAME>INDX_CLSTR</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_CON_INDX</TABNAME>
<FIELDNAME>CLUSTD</FIELDNAME>
<POSITION>0010</POSITION>
<ROLLNAME>INDX_CLUST</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
Expand Down
1 change: 0 additions & 1 deletion src/zadf/zadf_config_view/zadf_configfg.fugr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,6 @@
<MODIFIC>X</MODIFIC>
<OUTPUT_FLD>X</OUTPUT_FLD>
<REQU_ENTRY>N</REQU_ENTRY>
<DICT_I_FKY>X</DICT_I_FKY>
</RPY_DYFATC>
<RPY_DYFATC>
<CONT_TYPE>TABLE_CTRL</CONT_TYPE>
Expand Down
2 changes: 0 additions & 2 deletions src/zadf/zadf_config_view/zrest_v_conf_mis.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
<TABNAME>ZREST_CONF_MISC</TABNAME>
<FIELDNAME>INTERFACE_ID</FIELDNAME>
<KEYFLAG>X</KEYFLAG>
<CHECKTABLE>ZREST_CONFIG</CHECKTABLE>
<SHLPORIGIN>P</SHLPORIGIN>
</DD27P>
<DD27P>
<VIEWFIELD>METHOD</VIEWFIELD>
Expand Down
6 changes: 0 additions & 6 deletions src/zadf/zadf_drf/zadf_stru_ai_head.tabl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,19 @@
</DD02V>
<DD03P_TABLE>
<DD03P>
<TABNAME>ZADF_STRU_AI_HEAD</TABNAME>
<FIELDNAME>SERVICE_LINE</FIELDNAME>
<POSITION>0001</POSITION>
<ROLLNAME>CHAR50</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_STRU_AI_HEAD</TABNAME>
<FIELDNAME>BUSINESS_PROCESS</FIELDNAME>
<POSITION>0002</POSITION>
<ROLLNAME>CHAR50</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_STRU_AI_HEAD</TABNAME>
<FIELDNAME>SUB_PROCESS</FIELDNAME>
<POSITION>0003</POSITION>
<ROLLNAME>CHAR50</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
Expand Down
6 changes: 0 additions & 6 deletions src/zadf/zadf_drf/zadf_stru_ai_info.tabl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,19 @@
</DD02V>
<DD03P_TABLE>
<DD03P>
<TABNAME>ZADF_STRU_AI_INFO</TABNAME>
<FIELDNAME>KEY</FIELDNAME>
<POSITION>0001</POSITION>
<ROLLNAME>ZADF_KEY_ACTIONS</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_STRU_AI_INFO</TABNAME>
<FIELDNAME>FIELD</FIELDNAME>
<POSITION>0002</POSITION>
<ROLLNAME>ZADF_KEYNAM</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_STRU_AI_INFO</TABNAME>
<FIELDNAME>VALUE</FIELDNAME>
<POSITION>0003</POSITION>
<ROLLNAME>ZADF_VAL</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
Expand Down
12 changes: 6 additions & 6 deletions src/zadf/zadf_ehub_policy.tabl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,34 @@
</DD09L>
<DD03P_TABLE>
<DD03P>
<TABNAME>ZADF_EHUB_POLICY</TABNAME>
<FIELDNAME>MANDT</FIELDNAME>
<POSITION>0001</POSITION>
<KEYFLAG>X</KEYFLAG>
<ROLLNAME>MANDT</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<NOTNULL>X</NOTNULL>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_EHUB_POLICY</TABNAME>
<FIELDNAME>INTERFACE_ID</FIELDNAME>
<POSITION>0002</POSITION>
<KEYFLAG>X</KEYFLAG>
<ROLLNAME>ZINTERFACE_ID</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<NOTNULL>X</NOTNULL>
<COMPTYPE>E</COMPTYPE>
</DD03P>
<DD03P>
<TABNAME>ZADF_EHUB_POLICY</TABNAME>
<FIELDNAME>POLICY</FIELDNAME>
<POSITION>0003</POSITION>
<ROLLNAME>ZADF_POLICY</ROLLNAME>
<ADMINFIELD>0</ADMINFIELD>
<COMPTYPE>E</COMPTYPE>
</DD03P>
</DD03P_TABLE>
<TABL_EXTRAS>
<TDDAT>
<TABNAME>ZADF_EHUB_POLICY</TABNAME>
<CCLASS>ZSDK</CCLASS>
</TDDAT>
</TABL_EXTRAS>
</asx:values>
</asx:abap>
</abapGit>
1 change: 0 additions & 1 deletion src/zadf/zadf_ehub_policys.tobj.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<TVDIR>
<TABNAME>ZADF_EHUB_POLICY</TABNAME>
<AREA>ZEHUBPOLICY</AREA>
<DEVCLASS>ZADF</DEVCLASS>
<TYPE>1</TYPE>
<LISTE>9000</LISTE>
<BASTAB>X</BASTAB>
Expand Down
2 changes: 0 additions & 2 deletions src/zadf/zadf_fg.fugr.lzadf_fgf00.abap
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
*---------------------------------------------------------------------*
* view related FORM routines
* generation date: 05/10/2017 at 02:12:26
* view maintenance generator version: #001407#
*---------------------------------------------------------------------*

* base table related FORM-routines.............
Expand Down
2 changes: 0 additions & 2 deletions src/zadf/zadf_fg.fugr.lzadf_fgi00.abap
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
*---------------------------------------------------------------------*
* view related PAI modules
* generation date: 05/10/2017 at 02:12:26
* view maintenance generator version: #001407#
*---------------------------------------------------------------------*

INCLUDE LSVIMITX . "base table related PAI modules
Loading