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)
...
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:
...
For more examples, please, refer: https://www.odata.org/odata-services/
SAP ECC Source Plugin
Source Properties
...
User Facing Name
...
Widget Type
...
Description
...
Constraints
...
URL of the SAP ECC OData service. The URL must end with an external service name
...
Design
The suggestion is to use Apache Olingo as Client Library.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
public class OlingoSampleApp { private static final String ROOT_URL = "http://vhcalnplci.dummy.nodomain:8000/sap/opu/odata/ |
...
SAP/ |
...
ZGW100_ |
...
XX_ |
...
S2_ |
...
Required
...
Path of the SAP ECC OData entity.
For example:
- "SalesOrderCollection"
- "Category(1)/Products"
Required
...
OData query options to filter the data.
For example: "$select=Name,Description&$top=10".
The plugin copies data from the combined URL:
<OData Service URL>/<Entity Set>?<Query>
For more information, see OData URL components.
...
SRV/";
private static final String USERNAME = "DEVELOPER";
private static final String PASSWORD = "Appl1ance";
private static final String RESOURCE_PATH = "SalesOrderCollection";
public static void main(String[] params) throws Exception {
ODataClient client = ODataClientFactory.getClient();
client.getConfiguration().setHttpClientFactory(new BasicAuthHttpClientFactory(USERNAME, PASSWORD));
URI resourcesUri = client.newURIBuilder(ROOT_URL)
.appendEntitySetSegment(RESOURCE_PATH)
.build();
ODataEntitySetIteratorRequest<ClientEntitySet, ClientEntity> request = client
.getRetrieveRequestFactory()
.getEntitySetIteratorRequest(resourcesUri);
request.setAccept("application/atom+xml");
ODataRetrieveResponse<ClientEntitySetIterator<ClientEntitySet, ClientEntity>> response = request.execute();
ClientEntitySetIterator<ClientEntitySet, ClientEntity> iterator = response.getBody();
while (iterator.hasNext()) {
ClientEntity entity = iterator.next();
// process client entity
}
}
} |
Source Properties
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 | textbox | OData query options to filter the data. For example: "$select=Name,Description&$top=10". The plugin copies data from the combined URL: For more information, see OData URL components. | ||
Credentials | Username | textbox | Username for basic authentication. | |
Password | password | Password for basic authentication. | ||
Output Schema | schema | Specifies the schema of the entries. |
Source Data Types Mapping
Types can be mapped as follows, according to the org.apache.olingo.commons.api.edm.EdmPrimitiveType
EDM primitive type | CDAP Schema Data Type | Comment |
---|---|---|
Edm.Binary | bytes | |
Edm.Boolean | boolean | |
Edm.Byte | int | Unsigned 8-bit integer value |
Edm.DateTime | timestamp | Datetime in the following format: 'yyyy-mm-ddThh:mm[:ss[.fffffff]]' |
Edm.Decimal | decimal | |
Edm.Double | double | |
Edm.Single | float | |
Edm.Guid | string | |
Edm.Int16 | int | |
Edm.Int32 | int | |
Edm.Int64 | long | |
Edm.SByte | int | Represents a signed 8-bit integer value |
Edm.String | string | |
Edm.Time | time | Represents the time of day with values ranging from 0:00:00.x to 23:59:59.y, where x and y depend upon the precision |
Edm.DateTimeOffset | timestamp | Represents date and time as an Offset in minutes from GMT, with values ranging from 12:00:00 midnight, January 1, 1753 A.D. through 11:59:59 P.M, December 9999 A.D Example 1: 2002-10-10T17:00:00Z |
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
...