Importing Data from SAP: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Data can be imported from SAP based on the RFC interface using --#ImportSapQuery command in SQL scripting and Re...") |
No edit summary |
||
Line 1: | Line 1: | ||
Data can be imported from SAP based on the RFC interface using [[QPR_ProcessAnalyzer_Scripting_Commands#--.23ImportSapQuery|--#ImportSapQuery]] command in SQL scripting and ReadSap function in the expression language. Data fetched from SAP contains datatype information | Data can be imported from SAP based on the RFC interface using [[QPR_ProcessAnalyzer_Scripting_Commands#--.23ImportSapQuery|--#ImportSapQuery]] command in SQL scripting and ReadSap function in the expression language. Data fetched from SAP contains datatype information, and data is converted into respective datatypes of the in-memory core and SQL Server as follows: | ||
{| class="wikitable" | {| class="wikitable" | ||
! '''SAP data type''' | ! '''SAP data type''' | ||
! '''Expression language: ReadSap''' | ! '''Expression language:<br>ReadSap''' | ||
! '''SQL scripting: --#ImportSapQuery''' | ! '''SQL scripting:<br>--#ImportSapQuery''' | ||
|- | |- | ||
||I | ||I | ||
Line 20: | Line 20: | ||
||C | ||C | ||
||string | ||string | ||
||NVARCHAR(length) or NVARCHAR(max) (if length is greater than 8000) | ||NVARCHAR(length) or<br>NVARCHAR(max) (if length is greater than 8000) | ||
|- | |- | ||
||D | ||D | ||
Line 28: | Line 28: | ||
||N | ||N | ||
||string | ||string | ||
||NVARCHAR(length) or NVARCHAR(max) (if length is greater than 8000) | ||NVARCHAR(length) or<br>NVARCHAR(max) (if length is greater than 8000) | ||
|- | |- | ||
||T | ||T | ||
Line 36: | Line 36: | ||
||X | ||X | ||
||byte[] | ||byte[] | ||
||VARBINARY(length) or VARBINARY(max) (if length is greater than 8000) | ||VARBINARY(length) or<br>VARBINARY(max) (if length is greater than 8000) | ||
|} | |} | ||
Notes: | |||
* If no conversion is defined, data is converted to strings. By default --#ImportSapQuery (in SQL scripting) does not make any conversions, and by default ReadSap (in expression language) makes all conversion. | |||
* In the C datatype, spaces from both side are trimmed away. | |||
* If T type of column appears directly after the the D type of column, the time part in the T column is taken into account in the D column, and no new column in the result is created for the the T column. This occurs only if both D and T types are among the converted types. | |||
More information about SAP data types: https://help.sap.com/saphelp_nwpi71/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm?no_cache=true. | |||
In addition to the RFC interface, data can be fetched from SAP HANA with ODBC using the [[DataFrame_in_Expression_Language#ImportOdbcSecure|ImportODBCSecure]] function and [[QPR_ProcessAnalyzer_Scripting_Commands#--.23ImportOdbcQuery|ImportOdbcQuery]]. | In addition to the RFC interface, data can be fetched from SAP HANA with ODBC using the [[DataFrame_in_Expression_Language#ImportOdbcSecure|ImportODBCSecure]] function and [[QPR_ProcessAnalyzer_Scripting_Commands#--.23ImportOdbcQuery|ImportOdbcQuery]]. |
Revision as of 19:35, 9 December 2020
Data can be imported from SAP based on the RFC interface using --#ImportSapQuery command in SQL scripting and ReadSap function in the expression language. Data fetched from SAP contains datatype information, and data is converted into respective datatypes of the in-memory core and SQL Server as follows:
SAP data type | Expression language: ReadSap |
SQL scripting: --#ImportSapQuery |
---|---|---|
I | long | INT |
F | double | FLOAT |
P | double | FLOAT |
C | string | NVARCHAR(length) or NVARCHAR(max) (if length is greater than 8000) |
D | datetime | DATETIME2 |
N | string | NVARCHAR(length) or NVARCHAR(max) (if length is greater than 8000) |
T | timespan | TIME |
X | byte[] | VARBINARY(length) or VARBINARY(max) (if length is greater than 8000) |
Notes:
- If no conversion is defined, data is converted to strings. By default --#ImportSapQuery (in SQL scripting) does not make any conversions, and by default ReadSap (in expression language) makes all conversion.
- In the C datatype, spaces from both side are trimmed away.
- If T type of column appears directly after the the D type of column, the time part in the T column is taken into account in the D column, and no new column in the result is created for the the T column. This occurs only if both D and T types are among the converted types.
More information about SAP data types: https://help.sap.com/saphelp_nwpi71/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm?no_cache=true.
In addition to the RFC interface, data can be fetched from SAP HANA with ODBC using the ImportODBCSecure function and ImportOdbcQuery.