Copiare dati da una tabella SAP usando Azure Data FactoryCopy data from an SAP table by using Azure Data Factory
Questo articolo illustra come usare l'attività di copia in Azure Data Factory per copiare dati da una tabella SAP.This article outlines how to use the copy activity in Azure Data Factory to copy data from an SAP table. Per altre informazioni, vedere Cenni preliminari sull'attività di copia.For more information, see Copy activity overview.
Suggerimento
Per informazioni sul supporto generale di ADF sullo scenario di integrazione dei dati SAP, vedere l'articolo relativo all' integrazione dei dati SAP con Azure Data Factory whitepaper con informazioni dettagliate introduttive, comparsing e linee guida.To learn ADF's overall support on SAP data integration scenario, see SAP data integration using Azure Data Factory whitepaper with detailed introduction, comparsion and guidance.
Funzionalità supportateSupported capabilities
Questo connettore della tabella SAP è supportato per le attività seguenti:This SAP table connector is supported for the following activities:
- Attività di copia con matrice di origine/sink supportataCopy activity with supported source/sink matrix
- Attività LookupLookup activity
È possibile copiare dati da una tabella SAP in qualsiasi archivio dati di sink supportato.You can copy data from an SAP table to any supported sink data store. Per un elenco degli archivi dati supportati come origini o sink dall'attività di copia, vedere la tabella relativa agli archivi dati supportati .For a list of the data stores that are supported as sources or sinks by the copy activity, see the Supported data stores table.
In particolare, questo connettore di tabella SAP supporta:Specifically, this SAP table connector supports:
Copia di dati da una tabella SAP in:Copying data from an SAP table in:
- SAP ERP Central Component (SAP ECC) versione 7,01 o successiva (in uno stack del pacchetto di supporto SAP recente rilasciato dopo 2015).SAP ERP Central Component (SAP ECC) version 7.01 or later (in a recent SAP Support Package Stack released after 2015).
- SAP Business Warehouse (SAP BW) versione 7,01 o successiva (in uno stack di pacchetti di supporto SAP recente rilasciato dopo 2015).SAP Business Warehouse (SAP BW) version 7.01 or later (in a recent SAP Support Package Stack released after 2015).
- SAP S/4HANA.SAP S/4HANA.
- Altri prodotti in SAP Business Suite versione 7,01 o successiva (in uno stack del pacchetto di supporto SAP recente rilasciato dopo 2015).Other products in SAP Business Suite version 7.01 or later (in a recent SAP Support Package Stack released after 2015).
Copia di dati da una tabella di SAP trasparente, una tabella in pool, una tabella cluster e una vista.Copying data from both an SAP transparent table, a pooled table, a clustered table, and a view.
La copia dei dati tramite l'autenticazione di base o le comunicazioni di rete sicure (SNC), se è configurata la SNC.Copying data by using basic authentication or Secure Network Communications (SNC), if SNC is configured.
Connessione a un server applicazioni SAP o a un server di messaggi SAP.Connecting to an SAP application server or SAP message server.
PrerequisitiPrerequisites
Per usare questo connettore di tabella SAP, è necessario:To use this SAP table connector, you need to:
Configurare un runtime di integrazione self-hosted (versione 3,17 o successiva).Set up a self-hosted integration runtime (version 3.17 or later). Per altre informazioni, vedere creare e configurare un runtime di integrazione self-hosted.For more information, see Create and configure a self-hosted integration runtime.
Scaricare il connettore SAP a 64 bit per Microsoft .NET 3,0 dal sito Web di SAP e installarlo nel computer del runtime di integrazione self-hosted.Download the 64-bit SAP Connector for Microsoft .NET 3.0 from SAP's website, and install it on the self-hosted integration runtime machine. Durante l'installazione, assicurarsi di selezionare l'opzione Installa assembly per GAC nella finestra passaggi di installazione facoltativi .During installation, make sure you select the Install Assemblies to GAC option in the Optional setup steps window.
L'utente SAP usato nel connettore Data Factory SAP TABLE deve avere le autorizzazioni seguenti:The SAP user who's being used in the Data Factory SAP table connector must have the following permissions:
- Autorizzazione per l'utilizzo di destinazioni della chiamata di funzione remota (RFC).Authorization for using Remote Function Call (RFC) destinations.
- Autorizzazioni per l'attività Execute dell'oggetto S_SDSAUTH autorizzazione.Permissions to the Execute activity of the S_SDSAUTH authorization object.
Inizia oggi stessoGet started
È possibile usare l'attività di copia con una pipeline tramite uno degli strumenti o degli SDK seguenti.You can use one of the following tools or SDKs to use the copy activity with a pipeline. Per istruzioni dettagliate, selezionare un collegamento:Select a link for step-by-step instructions:
- Strumento copia datiCopy data tool
- Portale di AzureAzure portal
- .NET SDK.NET SDK
- Python SDKPython SDK
- Azure PowerShellAzure PowerShell
- API RESTREST API
- Modello di Azure Resource ManagerAzure Resource Manager template
Le sezioni seguenti riportano informazioni dettagliate sulle proprietà che vengono usate per definire le entità Data Factory specifiche del connettore della tabella SAP.The following sections provide details about properties that are used to define the Data Factory entities specific to the SAP table connector.
Proprietà del servizio collegatoLinked service properties
Per il servizio collegato SAP BW Hub aperto sono supportate le proprietà seguenti:The following properties are supported for the SAP BW Open Hub linked service:
ProprietàProperty | DescriptionDescription | ObbligatoriaRequired |
---|---|---|
type |
La proprietà type deve essere impostata su SapTable .The type property must be set to SapTable . |
SÌYes |
server |
Nome del server in cui si trova l'istanza di SAP.The name of the server on which the SAP instance is located. Usare per connettersi a un server applicazioni SAP.Use to connect to an SAP application server. |
NoNo |
systemNumber |
Il numero di sistema del sistema SAP.The system number of the SAP system. Usare per connettersi a un server applicazioni SAP.Use to connect to an SAP application server. Valore consentito: numero decimale A due cifre rappresentato come stringa.Allowed value: A two-digit decimal number represented as a string. |
NoNo |
messageServer |
Nome host del server dei messaggi SAP.The host name of the SAP message server. Usare per connettersi a un server di messaggi SAP.Use to connect to an SAP message server. |
NoNo |
messageServerService |
Nome del servizio o numero di porta del server dei messaggi.The service name or port number of the message server. Usare per connettersi a un server di messaggi SAP.Use to connect to an SAP message server. |
NoNo |
systemId |
ID del sistema SAP in cui si trova la tabella.The ID of the SAP system where the table is located. Usare per connettersi a un server di messaggi SAP.Use to connect to an SAP message server. |
NoNo |
logonGroup |
Il gruppo di accesso per il sistema SAP.The logon group for the SAP system. Usare per connettersi a un server di messaggi SAP.Use to connect to an SAP message server. |
NoNo |
clientId |
ID del client nel sistema SAP.The ID of the client in the SAP system. Valore consentito: numero decimale A tre cifre rappresentato come stringa.Allowed value: A three-digit decimal number represented as a string. |
SÌYes |
language |
Linguaggio utilizzato dal sistema SAP.The language that the SAP system uses. Il valore predefinito è EN .Default value is EN . |
NoNo |
userName |
Nome dell'utente che ha accesso al server SAP.The name of the user who has access to the SAP server. | SÌYes |
password |
Password dell'utente.The password for the user. Contrassegnare questo campo con il tipo di SecureString per archiviarlo in modo sicuro in Data Factory oppure fare riferimento a un segreto archiviato in Azure Key Vault.Mark this field with the SecureString type to store it securely in Data Factory, or reference a secret stored in Azure Key Vault. |
SÌYes |
sncMode |
Indicatore di attivazione di SNC per accedere al server SAP in cui si trova la tabella.The SNC activation indicator to access the SAP server where the table is located. Usare se si vuole usare SNC per connettersi al server SAP.Use if you want to use SNC to connect to the SAP server. I valori consentiti sono 0 (disattivato, valore predefinito) o 1 (on).Allowed values are 0 (off, the default) or 1 (on). |
NoNo |
sncMyName |
Nome della SNC dell'Initiator per accedere al server SAP in cui si trova la tabella.The initiator's SNC name to access the SAP server where the table is located. Si applica quando sncMode è on.Applies when sncMode is on. |
NoNo |
sncPartnerName |
Nome della SNC del partner di comunicazione per accedere al server SAP in cui si trova la tabella.The communication partner's SNC name to access the SAP server where the table is located. Si applica quando sncMode è on.Applies when sncMode is on. |
NoNo |
sncLibraryPath |
Libreria del prodotto di sicurezza esterna per accedere al server SAP in cui si trova la tabella.The external security product's library to access the SAP server where the table is located. Si applica quando sncMode è on.Applies when sncMode is on. |
NoNo |
sncQop |
Qualità SNC del livello di protezione da applicare.The SNC Quality of Protection level to apply. Si applica quando sncMode è on.Applies when sncMode is On. I valori consentiti sono 1 (autenticazione), 2 (integrità), 3 (privacy), 8 (impostazione predefinita), 9 (massimo).Allowed values are 1 (Authentication), 2 (Integrity), 3 (Privacy), 8 (Default), 9 (Maximum). |
NoNo |
connectVia |
Runtime di integrazione da usare per la connessione all'archivio dati.The integration runtime to be used to connect to the data store. Un runtime di integrazione self-hosted è obbligatorio, come indicato in precedenza in prerequisiti.A self-hosted integration runtime is required, as mentioned earlier in Prerequisites. | SÌYes |
Esempio 1: connettersi a un server applicazioni SAPExample 1: Connect to an SAP application server
{
"name": "SapTableLinkedService",
"properties": {
"type": "SapTable",
"typeProperties": {
"server": "<server name>",
"systemNumber": "<system number>",
"clientId": "<client ID>",
"userName": "<SAP user>",
"password": {
"type": "SecureString",
"value": "<Password for SAP user>"
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
Esempio 2: connettersi a un server di messaggi SAPExample 2: Connect to an SAP message server
{
"name": "SapTableLinkedService",
"properties": {
"type": "SapTable",
"typeProperties": {
"messageServer": "<message server name>",
"messageServerService": "<service name or port>",
"systemId": "<system ID>",
"logonGroup": "<logon group>",
"clientId": "<client ID>",
"userName": "<SAP user>",
"password": {
"type": "SecureString",
"value": "<Password for SAP user>"
}
},
"connectVia": {
"referenceName": "<name of integration runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
Esempio 3: connettersi tramite SNCExample 3: Connect by using SNC
{
"name": "SapTableLinkedService",
"properties": {
"type": "SapTable",
"typeProperties": {
"server": "<server name>",
"systemNumber": "<system number>",
"clientId": "<client ID>",
"userName": "<SAP user>",
"password": {
"type": "SecureString",
"value": "<Password for SAP user>"
},
"sncMode": 1,
"sncMyName": "<SNC myname>",
"sncPartnerName": "<SNC partner name>",
"sncLibraryPath": "<SNC library path>",
"sncQop": "8"
},
"connectVia": {
"referenceName": "<name of integration runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
Proprietà del set di datiDataset properties
Per un elenco completo delle sezioni e delle proprietà per la definizione dei set di impostazioni, vedere Datasets.For a full list of the sections and properties for defining datasets, see Datasets. Nella sezione seguente viene fornito un elenco delle proprietà supportate dal set di dati della tabella SAP.The following section provides a list of the properties supported by the SAP table dataset.
Per copiare dati da e verso il SAP BW servizio collegato Hub aperto, sono supportate le proprietà seguenti:To copy data from and to the SAP BW Open Hub linked service, the following properties are supported:
ProprietàProperty | DescriptionDescription | ObbligatoriaRequired |
---|---|---|
type |
La proprietà type deve essere impostata su SapTableResource .The type property must be set to SapTableResource . |
SÌYes |
tableName |
Nome della tabella SAP da cui copiare i dati.The name of the SAP table to copy data from. | SÌYes |
EsempioExample
{
"name": "SAPTableDataset",
"properties": {
"type": "SapTableResource",
"typeProperties": {
"tableName": "<SAP table name>"
},
"schema": [],
"linkedServiceName": {
"referenceName": "<SAP table linked service name>",
"type": "LinkedServiceReference"
}
}
}
Proprietà dell'attività di copiaCopy activity properties
Per un elenco completo delle sezioni e delle proprietà per la definizione delle attività, vedere pipeline.For a full list of the sections and properties for defining activities, see Pipelines. Nella sezione seguente viene fornito un elenco delle proprietà supportate dall'origine della tabella SAP.The following section provides a list of the properties supported by the SAP table source.
Tabella SAP come origineSAP table as source
Per copiare dati da una tabella SAP, sono supportate le proprietà seguenti:To copy data from an SAP table, the following properties are supported:
ProprietàProperty | DescriptionDescription | ObbligatoriaRequired |
---|---|---|
type |
La proprietà type deve essere impostata su SapTableSource .The type property must be set to SapTableSource . |
SÌYes |
rowCount |
Numero di righe da recuperare.The number of rows to be retrieved. | NoNo |
rfcTableFields |
Campi (colonne) da copiare dalla tabella SAP.The fields (columns) to copy from the SAP table. Ad esempio column0, column1 .For example, column0, column1 . |
NoNo |
rfcTableOptions |
Opzioni per filtrare le righe in una tabella SAP.The options to filter the rows in an SAP table. Ad esempio COLUMN0 EQ 'SOMEVALUE' .For example, COLUMN0 EQ 'SOMEVALUE' . Vedere anche la tabella degli operatori di query SAP più avanti in questo articolo.See also the SAP query operator table later in this article. |
NoNo |
customRfcReadTableFunctionModule |
Un modulo della funzione RFC personalizzato che può essere usato per leggere i dati da una tabella SAP.A custom RFC function module that can be used to read data from an SAP table. È possibile usare un modulo della funzione RFC personalizzato per definire il modo in cui i dati vengono recuperati dal sistema SAP e restituiti a Data Factory.You can use a custom RFC function module to define how the data is retrieved from your SAP system and returned to Data Factory. Il modulo della funzione personalizzata deve disporre di un'interfaccia implementata (importazione, esportazione, tabelle) simile a /SAPDS/RFC_READ_TABLE2 , ovvero l'interfaccia predefinita utilizzata da Data Factory.The custom function module must have an interface implemented (import, export, tables) that's similar to /SAPDS/RFC_READ_TABLE2 , which is the default interface used by Data Factory. |
NoNo |
partitionOption |
Meccanismo di partizione per la lettura da una tabella SAP.The partition mechanism to read from an SAP table. Le opzioni supportate includono:The supported options include:
|
NoNo |
partitionColumnName |
Nome della colonna utilizzata per partizionare i dati.The name of the column used to partition the data. | NoNo |
partitionUpperBound |
Valore massimo della colonna specificata in partitionColumnName che verrà utilizzato per continuare con il partizionamento.The maximum value of the column specified in partitionColumnName that will be used to continue with partitioning. |
NoNo |
partitionLowerBound |
Valore minimo della colonna specificata in partitionColumnName che verrà utilizzato per continuare con il partizionamento.The minimum value of the column specified in partitionColumnName that will be used to continue with partitioning. |
NoNo |
maxPartitionsNumber |
Numero massimo di partizioni in cui dividere i dati.The maximum number of partitions to split the data into. | NoNo |
Suggerimento
Se la tabella SAP include un volume elevato di dati, ad esempio diversi miliardi di righe, usare partitionOption
e partitionSetting
per suddividere i dati in partizioni più piccole.If your SAP table has a large volume of data, such as several billion rows, use partitionOption
and partitionSetting
to split the data into smaller partitions. In questo caso, i dati vengono letti per partizione e ogni partizione di dati viene recuperata dal server SAP tramite una singola chiamata RFC.In this case, the data is read per partition, and each data partition is retrieved from your SAP server via a single RFC call.
Prendendo partitionOption
come partitionOnInt
ad esempio, il numero di righe in ogni partizione viene calcolato con la formula seguente: (Totale righe che rientrano tra partitionUpperBound
e partitionLowerBound
)/maxPartitionsNumber
.Taking partitionOption
as partitionOnInt
as an example, the number of rows in each partition is calculated with this formula: (total rows falling between partitionUpperBound
and partitionLowerBound
)/maxPartitionsNumber
.
Per caricare le partizioni di dati in parallelo per velocizzare la copia, il grado di parallelismo viene controllato dall'impostazione parallelCopies
sull'attività di copia.To load data partitions in parallel to speed up copy, the parallel degree is controlled by the parallelCopies
setting on the copy activity. Se, ad esempio, si imposta parallelCopies
su quattro, Data Factory genera ed esegue in modo simultaneo quattro query basate sull'opzione di partizione e sulle impostazioni specificate e ogni query recupera una parte di dati dalla tabella SAP.For example, if you set parallelCopies
to four, Data Factory concurrently generates and runs four queries based on your specified partition option and settings, and each query retrieves a portion of data from your SAP table. Si consiglia vivamente di maxPartitionsNumber
un multiplo del valore della proprietà parallelCopies
.We strongly recommend making maxPartitionsNumber
a multiple of the value of the parallelCopies
property. Quando si copiano dati in un archivio dati basato su file, viene anche riordinato di scrivere in una cartella come più file (specificare solo il nome della cartella), nel qual caso le prestazioni sono migliori rispetto alla scrittura in un singolo file.When copying data into file-based data store, it's also recommanded to write to a folder as multiple files (only specify folder name), in which case the performance is better than writing to a single file.
In rfcTableOptions
, è possibile usare gli operatori di query SAP comuni seguenti per filtrare le righe:In rfcTableOptions
, you can use the following common SAP query operators to filter the rows:
OperatorOperator | DescriptionDescription |
---|---|
EQ |
Uguale aEqual to |
NE |
Diverso daNot equal to |
LT |
Meno diLess than |
LE |
Minore o uguale aLess than or equal to |
GT |
Più diGreater than |
GE |
Maggiore o uguale aGreater than or equal to |
LIKE |
Come in LIKE 'Emma%' As in LIKE 'Emma%' |
EsempioExample
"activities":[
{
"name": "CopyFromSAPTable",
"type": "Copy",
"inputs": [
{
"referenceName": "<SAP table input dataset name>",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "<output dataset name>",
"type": "DatasetReference"
}
],
"typeProperties": {
"source": {
"type": "SapTableSource",
"partitionOption": "PartitionOnInt",
"partitionSettings": {
"partitionColumnName": "<partition column name>",
"partitionUpperBound": "2000",
"partitionLowerBound": "1",
"maxPartitionsNumber": 500
}
},
"sink": {
"type": "<sink type>"
},
"parallelCopies": 4
}
}
]
Mapping dei tipi di dati per una tabella SAPData type mappings for an SAP table
Quando si copiano dati da una tabella SAP, vengono usati i mapping seguenti tra i tipi di dati della tabella SAP e i tipi di dati Azure Data Factory interim.When you're copying data from an SAP table, the following mappings are used from the SAP table data types to the Azure Data Factory interim data types. Vedere Mapping dello schema e del tipo di dati per informazioni su come l'attività di copia esegue il mapping dello schema di origine e del tipo di dati al sink.To learn how the copy activity maps the source schema and data type to the sink, see Schema and data type mappings.
Tipo SAP ABAPSAP ABAP Type | Tipo di dati provvisorio di Data FactoryData Factory interim data type |
---|---|
C (stringa)C (String) |
String |
I (Integer)I (Integer) |
Int32 |
F (float)F (Float) |
Double |
D (Data)D (Date) |
String |
T (ora)T (Time) |
String |
P (BCD compresso, Currency, Decimal, Qty)P (BCD Packed, Currency, Decimal, Qty) |
Decimal |
N (numerico)N (Numeric) |
String |
X (binario e non elaborato)X (Binary and Raw) |
String |
Proprietà attività di ricercaLookup activity properties
Per informazioni dettagliate sulle proprietà, controllare l' attività di ricerca.To learn details about the properties, check Lookup activity.
Passaggi successiviNext steps
Per un elenco degli archivi dati supportati come origini e sink dall'attività di copia in Azure Data Factory, vedere archivi dati supportati.For a list of the data stores supported as sources and sinks by the copy activity in Azure Data Factory, see Supported data stores.
Commenti
Caricamento dei commenti...