Ga verder naar hoofdinhoud

Set up the SAP extractor

Follow the steps below to set up the extractor.

Before you start

  1. Set up the SAP endpoints you want to extract data from.

  2. Check the server requirements for the extractor.

  3. Create a configuration file according to the configuration settings. The file must be in YAML format.

Connect to SAP

The extractor supports three different protocols to connect to SAP: OData, SOAP, or RFC.

OData

The extractor connects to OData V2.0 endpoints in the SAP NetWeaver Gateway. The Gateway is available in multiple SAP versions:

SAP versionDescription
SAP ERP 6.0We recommend the SAP Gateway Service builder, which automates and generates OData entities from the SAP standard data schemas.

There are multiple ways of mapping SAP entities to OData entities. To ensure that schema mapping is done correctly on the entity level, use the Import DDIC Structure function for structures or database table that you expose through the OData service.

See this guide for creating an OData service in SAP ERP 6.0.
SAP S/4HANA OnPremiseWe recommend using the standard OData endpoints delivered in the SAP S/4HANA installation. You'll find the endpoints at the SAP Business Accelerator Hub.

To extract data using SAP OData predefined schemas, activate the standard endpoints on the /IWFND/MAINT_SERVICES transaction. For instance, the standard endpoint for SAP plant maintenance (PM) work orders.
SAP S/4HANA CloudThe OData endpoints are available inside the cloud communication scenarios predefined by SAP. You'll find the standard endpoints at the SAP Business Accelerator Hub. For instance, the standard endpoint for SAP plant maintenance (PM) work orders.
Note

We recommend using OData to connect and extract data from SAP.

SOAP

The extractor connects to SAP ABAP Web Services exposed through the SOAP protocol.

Every published SAP Web service will have a corresponding XML-based description, accessible in the Web Service Description Language (a WSDL document). The extractor connects to the Web service by reading the definitions in the WSDL URL and triggering the defined operations.

For more information about SAP ABAP Web Services, see SAP's official documentation.

RFC

The extractor connects to SAP Remote Function Call interfaces by executing SAP function modules in a remote SAP server.

The communication relies on SAP NetWeaver RFC SDK, maintained and distributed by SAP.

Cognite doesn't distribute SAP NetWeaver RFC SDK within the SAP extractor. You must install this in the environment where the extractor will be deployed.

For more information about the requirements to use SAP RFC in the extractor, see the server requirements.

Run as a Windows executable file

  1. Navigate to Data management > Integrate > Extractors and find the SAP extractor's package for Windows executable.

  2. Download and decompress the zip file.

  3. Open a command line window and run the executable file with the configuration file as an argument.

In this example, the configuration file is named config.yml and saved in the same folder as the executable file:


> .\sap_extractor-<VERSION>-win-x64.exe .\config.yml

You stop the extractor by pressing Ctrl+C on your keyboard. The log file is stored in the configured path.

Run as a Windows service

  1. Navigate to Data management > Integrate > Extractors and find the SAP extractor's installation package for Windows service.

  2. Download and decompress the zip file to the same directory as a configuration file.

Naming the configuration file

You must name the configuration file config.yml.

  1. As an administrator, open up a command line window in the folder you placed the executable file and the configuration file.

  2. Run the following command:


> .\sap-extractor-winservice.win-x64.exe install

  1. Open Services in Windows and find the Cognite SAP extractor service.

  2. Right-click the service and select Properties.

  3. Configure the service according to your requirements.

Run as a Linux executable

  1. Navigate to Data management > Integrate > Extractors and find the SAP extractor's package for Linux executable.

  2. Download and decompress the zip file.

  3. Open a command line window and run the executable file with the configuration file as an argument.

In this example, the configuration file is named config.yml and saved in the same folder as the executable file:


> ./sap_extractor-<VERSION>-linux path/to/the/folder/config.yaml

Load data incrementally

If the OData entities have an incremental field, you can set up the extractor to only process new or updated entities since the last extraction.

For example, you can use the S/4HANA standard OData entity Maintenance Order and enter the field LastChangeDateTime in the incremental_field configuration parameter for incremental delta queries to the CDF staging area.

Tip

For the incremental load to work properly, the incremental field in SAP must be a Edm.DateTimeOffset field. For example, LastChangeDateTime for SAP OData entity Maintenance Order.

Tip

The SAP extractor uses OData $skip and $top operations in order to handle pagination. Therefore, when setting up the SAP extractor towards a custom SAP OData endpoint, make sure that your SAP implementation supports pagination.

Schedule automatic runs

To schedule automatic runs on Windows, you can run the extractors in Windows Task Scheduler.

To schedule automatic runs on Mac OS and Linux, use cron expressions. To enter a new cron job, run crontab -e to edit the cron table file with the default system text editor.

Here's the format for a job in the cron table:

<minute>  <hour>  <day of month (1-31)>  <month (1-12)>  <day of week (0-6 starting on Sunday)>  <command>