...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Table of Contents |
---|
Introduction
This plugin would allow SAP ECC enterprise users to specify one of the Inventory Management data sources as source in Cloud Data Fusion. Typical pipeline scenario would include specifying one of the data sources as source (under Sources plugins) and BigQuery as sink. For the sake of simplicity, this document will cover one data source (Material Movements from Inventory Management - 2LIS_03_BF).
User Experience and Configuration
- SAP ECC Setup
SAP ECC users log into SAP Gateway Service Builder (segw) to create and expose the data source as SAP OData service. SAP has published following articles around this step:
User creates OData service for the data source (2LIS_03_BF). Output is RESTful OData service that can be accessed by Cloud Data Fusion.
User can also use SAP Netweaver Gateway client to test the service (with HTTP request and response)
- Cloud Data Fusion - Source configuration
- Source Data Types Mapping
User would log into their CDF instance and click on “Hub”.
Under “Plugins” section, user should be able to find “SAP ECC Source”.
This integration would provide a single JAR files for SAP ECC data sources. User would upload the JAR file and this would deploy the plugin using the JAR file.
Once uploaded, the user is prompted to provide following configuration information. Please note that all the fields below should be macro enabled.
...
Data type mismatch - OData output has data types (section 6) different than the data types available in BigQuery. Some sort of data type conversion needs to happen before the extracted data can be ingested into BigQuery. Below is the suggested mapping of OData data types to CDAP schema data types:
...
Section | User Facing Name | Widget Type | Description | Constraints |
---|---|---|---|---|
General | Label | textbox | Label for UI. | |
Reference Name | textbox | Uniquely identified name for lineage. | ||
OData Service URL | textbox | URL of the SAP ECC OData service. The URL must end with an external service name (e.g., http://eccsvrname:8000/sap/opu/odata/sap/zgw100_dd02l_so_srv/). | Required | |
Resource Path | textbox | Path of the SAP ECC OData entity. For example:
| Required | |
Query Options | keyvalue | OData query options to filter the data. For example:
The plugin copies data from the combined URL: For more information, see OData URL components. | ||
Include Metadata Annotations | toggle | Whether the plugin should read SAP metadata annotations and include them to each record. | ||
Credentials | Username | textbox | Username for basic authentication. | |
Password | password | Password for basic authentication. | ||
Output Schema | schema | Specifies the schema of the entries. |
...
OData V2 Data Types Mapping
Types can be mapped as follows, according to the org.apache.olingo.odata2.api.edm.EdmSimpleType and OData Primitive Data Types(section 6):
...
Types can be mapped as follows, according to the org.apache.olingo.commons.api.edm.EdmPrimitiveType and OData CSDL Primitive Types:
...
OData V4 Annotation Expression Mapping
EDM expression | Type | Example | CDAP record schema | |||||
---|---|---|---|---|---|---|---|---|
Binary | constant |
|
| |||||
Bool | constant |
|
| |||||
Date | constant |
|
| |||||
DateTimeOffset | constant |
|
| |||||
Decimal | constant |
|
| |||||
Duration | constant |
|
| |||||
EnumMember | constant |
|
| |||||
Float | constant |
|
| |||||
Guid | constant |
|
| |||||
Int | constant |
|
| |||||
String | constant |
|
| |||||
TimeOfDay | constant |
|
| |||||
Path | dynamic |
|
| |||||
AnnotationPath | dynamic |
|
| |||||
LabeledElementReference | dynamic |
|
| |||||
Null | dynamic |
|
| |||||
NavigationPropertyPath | dynamic |
|
| |||||
PropertyPath | dynamic |
|
| |||||
And | dynamic |
|
| |||||
Or | dynamic |
|
| |||||
Eq | dynamic |
|
| |||||
Ne | dynamic |
|
| |||||
Gt | dynamic |
|
| |||||
Ge | dynamic |
|
| |||||
Lt | dynamic |
|
| |||||
Le | dynamic |
|
| |||||
Not | dynamic |
|
| |||||
Apply | dynamic |
|
Note: the proposal is to use the parameter index as a prefix for field name to avoid conflicts. In this case, parameters record will be a record of the following fields:
|
|
|
|
|
Cast | dynamic |
|
| |||||
Collection | dynamic |
|
| |||||
If | dynamic |
|
| |||||
IsOf | dynamic |
|
| |||||
LabeledElement | dynamic |
|
| |||||
Record | dynamic |
|
| |||||
UrlRef | dynamic |
|
|
Notes
...
- An edm:Annotation element MAY contain edm:Annotation elements that annotate the annotation.
- The edm:Annotations element is used to apply a group of annotations to a single model element. These are annotations with External Targetingare annotations with External Targeting.
Complex Types Mapping
Both OData V2 and V4 support complex types. Complex types are keyless nominal structured types. The lack of a key means that instances of complex types cannot be referenced, created, updated or deleted independently of an entity type. Complex types allow entity models to group properties into common structures.
The example below demonstrates the definition of several complex types in the service metadata document:
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:DataServices>
<Schema Namespace="TestService" xmlns="http://docs.oasis-open.org/odata/ns/edm" Alias="self">
<ComplexType Name="City">
<Property Name="CountryRegion" Type="Edm.String" Nullable="false"/>
<Property Name="Name" Type="Edm.String" Nullable="false"/>
<Property Name="Region" Type="Edm.String" Nullable="false"/>
</ComplexType>
<ComplexType Name="Location" OpenType="true">
<Property Name="Address" Type="Edm.String" Nullable="false"/>
<Property Name="City" Type="TestService.City" Nullable="false"/>
</ComplexType>
<ComplexType Name="HomeAddress" BaseType="TestService.Location">
<Property Name="FamilyName" Type="Edm.String"/>
</ComplexType>
...
<EntityType Name="AllDataTypesEntity">
...
<Property Name="Address" Type="TestService.Location" Nullable="false"/>
<Property Name="HomeAddress" Type="TestService.HomeAddress" Nullable="false"/>
<Property Name="Size" Type="TestService.Size" Nullable="false"/>
</EntityType>
...
</Schema>
</edmx:DataServices>
</edmx:Edmx> |
Properties of these types are mapped to a record with corresponding fields and each of them is mapped according to it's Edm type: OData V2 Data Types Mapping, OData V4 Data Types Mapping.
OData V4 EnumType and TypeDefinition
OData V4 supports enumeration types and type definitions, that are defined as follows:
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:DataServices>
<Schema Namespace="TestService" xmlns="http://docs.oasis-open.org/odata/ns/edm" Alias="self">
<EnumType Name="PersonGender">
<Member Name="Male" Value="0"/>
<Member Name="Female" Value="1"/>
<Member Name="Unknown" Value="2">
<Annotation Term="Core.Description" String="Shipped with highest priority" />
</Member>
</EnumType>
<TypeDefinition Name="Length" UnderlyingType="Edm.Int32">
<Annotation Term="Org.OData.Measures.V1.Unit" String="Centimeters" />
</TypeDefinition>
<TypeDefinition Name="Weight" UnderlyingType="Edm.Int32">
<Annotation Term="Org.OData.Measures.V1.Unit" String="Kilograms" />
</TypeDefinition>
...
<EntityType Name="AllDataTypesEntity">
...
<Property Name="Gender" Type="self.PersonGender" Nullable="false"/>
<Property Name="Height" Type="self.Length" />
<Property Name="Weight" Type="self.Weight" />
</EntityType>
...
</Schema>
</edmx:DataServices>
</edmx:Edmx> |
Properties of the enum types are mapped to string. Properties of the TypeDefinition are mapped according to it's underlying Edm type: OData V2 Data Types Mapping, OData V4 Data Types Mapping.
References
OData service
SAP Netweaver Gateway
Overview - https://blogs.sap.com/2013/01/24/a-simple-overview-on-sap-netweaver-gateway/
SAP Netweaver Gtw and OData Tutorials: https://sapyard.com/tutorials-on-odata-sap-netweaver-gateway/
Microsoft Data Factory - SAP ECC Connector
Plugin Type
- Batch Source
- Batch Sink
- Real-time Source
- Real-time Sink
- Action
- Post-Run Action
- Aggregate
- Join
- Spark Model
- Spark Compute
...