使用 Azure 数据工厂从 SAP ECC 复制数据Copy data from SAP ECC by using Azure Data Factory

适用于:是 Azure 数据工厂是 Azure Synapse Analytics(预览版)APPLIES TO: yesAzure Data Factory yesAzure Synapse Analytics (Preview)

本文概述了如何使用 Azure 数据工厂中的复制活动从 SAP Enterprise Central Component (ECC) 复制数据。This article outlines how to use the copy activity in Azure Data Factory to copy data from SAP Enterprise Central Component (ECC). 有关详细信息,请参阅复制活动概述For more information, see Copy activity overview.

提示

若要了解 ADF 对 SAP 数据集成方案的总体支持,请参阅使用 Azure 数据工厂进行 SAP 数据集成白皮书,其中包含每个 SAP 连接器的详细介绍、比较和指导。To learn ADF's overall support on SAP data integration scenario, see SAP data integration using Azure Data Factory whitepaper with detailed introduction on each SAP connector, comparsion and guidance.

支持的功能Supported capabilities

以下活动支持此 SAP ECC 连接器:This SAP ECC connector is supported for the following activities:

可以将数据从 SAP ECC 复制到任何受支持的接收器数据存储。You can copy data from SAP ECC to any supported sink data store. 有关复制活动支持作为源或接收器的数据存储列表,请参阅支持的数据存储表。For a list of data stores that are supported as sources or sinks by the copy activity, see the Supported data stores table.

具体而言,此 SAP ECC 连接器支持:Specifically, this SAP ECC connector supports:

  • 在 SAP NetWeaver 版本 7.0 和更高版本上从 SAP ECC 复制数据。Copying data from SAP ECC on SAP NetWeaver version 7.0 and later.

  • 从 SAP ECC OData 服务公开的任何对象复制数据,例如以下对象:Copying data from any objects exposed by SAP ECC OData services, such as:

    • SAP 表或视图。SAP tables or views.
    • 业务应用程序编程接口 [BAPI] 对象。Business Application Programming Interface [BAPI] objects.
    • 数据提取程序。Data extractors.
    • 发送给 SAP 进程集成 (PI) 的数据或中间文档 (IDOC),可以通过相对适配器以 OData 形式接收。Data or intermediate documents (IDOCs) sent to SAP Process Integration (PI) that can be received as OData via relative adapters.
  • 使用基本身份验证复制数据。Copying data by using basic authentication.

提示

若要通过 SAP 表或视图从 SAP ECC 复制数据,请使用速度更快且可伸缩性更强的 SAP 表连接器。To copy data from SAP ECC via an SAP table or view, use the SAP table connector, which is faster and more scalable.

先决条件Prerequisites

若要使用此 SAP ECC 连接器,需要通过 SAP 网关通过 OData 服务公开 SAP ECC 实体。To use this SAP ECC connector, you need to expose the SAP ECC entities via OData services through SAP Gateway. 更具体说来:More specifically:

  • 设置 SAP 网关Set up SAP Gateway. 对于采用高于 7.4 版的 SAP NetWeaver 版本的服务器,SAP 网关已安装。For servers with SAP NetWeaver versions later than 7.4, SAP Gateway is already installed. 对于较早版本,在通过 OData 服务公开 SAP ECC 数据之前,必须安装嵌入式 SAP 网关或 SAP 网关中心系统。For earlier versions, you must install the embedded SAP Gateway or the SAP Gateway hub system before exposing SAP ECC data through OData services. 若要设置 SAP 网关,请参阅安装指南To set up SAP Gateway, see the installation guide.

  • 激活并配置 SAP OData 服务。Activate and configure the SAP OData service. 可以通过 TCODE SICF 在数秒内激活 OData 服务。You can activate the OData service through TCODE SICF in seconds. 还可以配置需要公开哪些对象。You can also configure which objects need to be exposed. 有关详细信息,请参阅分步指南For more information, see the step-by-step guidance.

如果数据存储是以下方式之一配置的,则需要设置自承载集成运行时才能连接到此数据存储:If your data store is configured in one of the following ways, you need to set up a self-hosted integration runtime to connect to the data store:

  • 数据存储位于本地网络内部、Azure 虚拟网络内部或 Amazon 虚拟私有云内。The data store is located inside an on-premises network, inside an Azure virtual network, or inside Amazon Virtual Private Cloud.
  • 数据存储是一种托管的云数据服务,只有在防火墙规则中列入允许列表的 IP 才能访问该服务。The data store is a managed cloud data service where the access is restricted to IPs that are whitelisted in the firewall rules.

入门Get started

若要使用管道执行复制活动,可以使用以下工具或 SDK 之一:To perform the Copy activity with a pipeline, you can use one of the following tools or SDKs:

对于特定于 SAP ECC 连接器的数据工厂实体,以下部分提供有关用于定义这些实体的属性的详细信息。The following sections provide details about properties that are used to define the Data Factory entities specific to the SAP ECC connector.

链接服务属性Linked service properties

SAP ECC 链接服务支持以下属性:The following properties are supported for the SAP ECC linked service:

propertiesProperty 说明Description 必选Required
type type 属性必须设置为 SapEccThe type property must be set to SapEcc. Yes
url SAP ECC OData 服务的 URL。The URL of the SAP ECC OData service. Yes
username 用于连接到 SAP ECC 的用户名。The username used to connect to SAP ECC. No
password 用于连接到 SAP ECC 的明文密码。The plaintext password used to connect to SAP ECC. No
connectVia 用于连接到数据存储的集成运行时The integration runtime to be used to connect to the data store. 先决条件部分了解更多信息。Learn more from Prerequisites section. 如果不指定运行时,则使用默认的 Azure 集成运行时。If you don't specify a runtime, the default Azure integration runtime is used. No

示例Example

{
    "name": "SapECCLinkedService",
    "properties": {
        "type": "SapEcc",
        "typeProperties": {
            "url": "<SAP ECC OData URL, e.g., http://eccsvrname:8000/sap/opu/odata/sap/zgw100_dd02l_so_srv/>",
            "username": "<username>",
            "password": {
                "type": "SecureString",
                "value": "<password>"
            }
        }
    },
    "connectVia": {
        "referenceName": "<name of integration runtime>",
        "type": "IntegrationRuntimeReference"
    }
}

数据集属性Dataset properties

有关可用于定义数据集的各个部分和属性的完整列表,请参阅数据集For a full list of the sections and properties available for defining datasets, see Datasets. 以下部分提供 SAP ECC 数据集支持的属性列表。The following section provides a list of the properties supported by the SAP ECC dataset.

若要从 SAP ECC 复制数据,请将数据集的 type 属性设置为 SapEccResourceTo copy data from SAP ECC, set the type property of the dataset to SapEccResource.

支持以下属性:The following properties are supported:

propertiesProperty 说明Description 必选Required
path SAP ECC OData 实体的路径。Path of the SAP ECC OData entity. Yes

示例Example

{
    "name": "SapEccDataset",
    "properties": {
        "type": "SapEccResource",
        "typeProperties": {
            "path": "<entity path, e.g., dd04tentitySet>"
        },
        "schema": [],
        "linkedServiceName": {
            "referenceName": "<SAP ECC linked service name>",
            "type": "LinkedServiceReference"
        }
    }
}

复制活动属性Copy activity properties

有关可用于定义活动的各个部分和属性的完整列表,请参阅管道For a full list of the sections and properties available for defining activities, see Pipelines. 以下部分提供 SAP ECC 源支持的属性列表。The following section provides a list of the properties supported by the SAP ECC source.

以 SAP ECC 作为源SAP ECC as a source

若要从 SAP ECC 复制数据,请将复制活动的 source 节中的 type 属性设置为 SapEccSourceTo copy data from SAP ECC, set the type property in the source section of the copy activity to SapEccSource.

复制活动的 source 节支持以下属性:The following properties are supported in the copy activity's source section:

propertiesProperty 说明Description 必选Required
type 复制活动的 source 节的 type 属性必须设置为 SapEccSourceThe type property of the copy activity's source section must be set to SapEccSource. Yes
query 用于筛选数据的 OData 查询选项。The OData query options to filter the data. 例如:For example:

"$select=Name,Description&$top=10"

SAP ECC 连接器会从以下组合 URL 复制数据:The SAP ECC connector copies data from the combined URL:

<URL specified in the linked service>/<path specified in the dataset>?<query specified in the copy activity's source section>

有关详细信息,请参阅 OData URL 组件For more information, see OData URL components.
No
sapDataColumnDelimiter 单个字符,将用作传递给 SAP RFC 的分隔符,以用于拆分输出数据。The single character that is used as delimiter passed to SAP RFC to split the output data. No
httpRequestTimeout 用于获取响应的 HTTP 请求的超时 (TimeSpan 值) 。The timeout (the TimeSpan value) for the HTTP request to get a response. 该值是获取响应而不是读取响应数据的超时。This value is the timeout to get a response, not the timeout to read response data. 如果未指定,默认值为 00:30:00(30 分钟)。If not specified, the default value is 00:30:00 (30 minutes). No

示例Example

"activities":[
    {
        "name": "CopyFromSAPECC",
        "type": "Copy",
        "inputs": [
            {
                "referenceName": "<SAP ECC input dataset name>",
                "type": "DatasetReference"
            }
        ],
        "outputs": [
            {
                "referenceName": "<output dataset name>",
                "type": "DatasetReference"
            }
        ],
        "typeProperties": {
            "source": {
                "type": "SapEccSource",
                "query": "$top=10"
            },
            "sink": {
                "type": "<sink type>"
            }
        }
    }
]

SAP ECC 的数据类型映射Data type mappings for SAP ECC

从 SAP ECC 复制数据时,可以使用以下映射将 SAP ECC 数据的 OData 数据类型映射到 Azure 数据工厂临时数据类型。When you're copying data from SAP ECC, the following mappings are used from OData data types for SAP ECC data to Azure Data Factory interim data types. 若要了解复制活动如何将源架构和数据类型映射到接收器,请参阅架构和数据类型映射To learn how the copy activity maps the source schema and data type to the sink, see Schema and data type mappings.

OData 数据类型OData data type 数据工厂临时数据类型Data Factory interim data type
Edm.Binary String
Edm.Boolean Bool
Edm.Byte String
Edm.DateTime DateTime
Edm.Decimal Decimal
Edm.Double Double
Edm.Single Single
Edm.Guid String
Edm.Int16 Int16
Edm.Int32 Int32
Edm.Int64 Int64
Edm.SByte Int16
Edm.String String
Edm.Time TimeSpan
Edm.DateTimeOffset DateTimeOffset

备注

目前不支持复杂数据类型。Complex data types aren't currently supported.

Lookup 活动属性Lookup activity properties

若要了解有关属性的详细信息,请查看 Lookup 活动To learn details about the properties, check Lookup activity.

后续步骤Next steps

有关 Azure 数据工厂中复制活动支持作为源和接收器的数据存储的列表,请参阅支持的数据存储For a list of the data stores supported as sources and sinks by the copy activity in Azure Data Factory, see Supported data stores.