Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- report zz_transform_sharepoint.
- * You may use data types prefixed with XSD... for conversion to special formats
- types: begin of ty_row,
- link_title type string,
- plant type string,
- created type xsddatetime_iso,
- end of ty_row,
- ty_rows type standard table of ty_row with empty key.
- start-of-selection.
- perform start.
- * ---
- form start.
- data: lv_doc type xstring,
- lt_rows type ty_rows.
- perform get_sharepoint changing lv_doc.
- call transformation zshare
- source xml lv_doc
- result rows = lt_rows.
- cl_demo_output=>display( lt_rows ).
- * The simple transformation looks like this
- *<?sap.transform simple?>
- *<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
- * <tt:root name="ROWS"/>
- * <tt:template>
- * <n0:GetListItemsResponse xmlns:n0="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- * <n0:GetListItemsResult xmlns:z="#RowsetSchema" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882">
- * <n0:listitems>
- * <rs:data>
- * <tt:loop name="row" ref=".ROWS">
- * <z:row>
- * <tt:attribute name="ows_LinkTitle" value-ref="$row.link_title"/>
- * <tt:attribute name="ows_Plant" value-ref="$row.plant"/>
- * <tt:attribute name="ows_Created" value-ref="$row.created"/>
- * </z:row>
- * </tt:loop>
- * </rs:data>
- * </n0:listitems>
- * </n0:GetListItemsResult>
- * </n0:GetListItemsResponse>
- * </tt:template>
- *</tt:transform>
- endform.
- form get_sharepoint changing cv_doc type xstring.
- * A sharepoint example list, given as UTF-8 string (like in an HTTP request)
- cv_doc = cl_abap_codepage=>convert_to(
- `<?xml version="1.0"?>` &&
- `<n0:GetListItemsResponse xmlns:n0="http://schemas.microsoft.com/sharepoint/soap/"` &&
- ` xmlns:xsd="http://www.w3.org/2001/XMLSchema"` &&
- ` xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"` &&
- ` xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">` &&
- ` <n0:GetListItemsResult xmlns:z="#RowsetSchema"` &&
- ` xmlns:rs="urn:schemas-microsoft-com:rowset"` &&
- ` xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"` &&
- ` xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882">` &&
- ` <n0:listitems>` &&
- ` <rs:data ItemCount="8">` &&
- ` <z:row ows_LinkTitle="1337"` &&
- ` ows_Plant="10"` &&
- ` ows_MetaInfo="1;#"` &&
- ` ows__ModerationStatus="0"` &&
- ` ows__Level="1"` &&
- ` ows_Title="1337"` &&
- ` ows_ID="1"` &&
- ` ows_UniqueId="1;#{05F8EDB7-D0CA-4024-8125-AC3628394B69}"` &&
- ` ows_owshiddenversion="5"` &&
- ` ows_FSObjType="1;#0"` &&
- ` ows_Created_x0020_Date="1;#2016-02-16 14:20:31"` &&
- ` ows_Created="2016-02-16 14:20:31"` &&
- ` ows_FileLeafRef="1;#1_.000"` &&
- ` ows_PermMask="0x7fffffffffffffff"` &&
- ` ows_Modified="2016-05-27 23:18:38"` &&
- ` ows_FileRef="1;#Lists/Testlist/1_.000"/>` &&
- ` </rs:data>` &&
- ` </n0:listitems>` &&
- ` </n0:GetListItemsResult>` &&
- `</n0:GetListItemsResponse>` ).
- endform.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement