Importing Data from SAP: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
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, and data is converted into respective datatypes of the in-memory core and SQL Server as follows:
Data can be imported from SAP (using the RFC interface) with [[QPR_ProcessAnalyzer_Scripting_Commands#--.23ImportSapQuery|--#ImportSapQuery]] command in SQL scripting and ReadSap function in the expression language. 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]].
 
== Data conversion in RFC interface ==
 
Data fetched from SAP using the RFC interface, contains accurate data type information, so data will be converted into respective data types used by the in-memory core and SQL Server as follows:


{| class="wikitable"
{| class="wikitable"
Line 39: Line 43:
|}
|}


Notes:
Conversion is determined by the '''ConvertDataTypes''' setting. If no conversion is defined, --#ImportSapQuery (in SQL scripting) does not make any conversions, and ReadSap (in expression language) makes all conversion. When there is no conversion defined, data is converted to strings.
* 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.
 
* If T type of column (time) appears directly after the the D type of column (date), the time part in the T column is added to the D column data, and no new column in the result is created for the the T column. This is done only if both D and T types are among the converted types.
Date (D) and time (T) type of fields are usually related to the same timestamp and thus they are bound together as follows: If T type of column is defined directly after the the D type of column, the time part in the T column is added to the D column, and no new column is created for the the T column. This is done only if both D and T types are among the converted types.
* In the C datatype, spaces from both side are trimmed away.
 
Note that, in the C datatype, spaces from both side are trimmed away.


More information about SAP data types: https://help.sap.com/saphelp_nwpi71/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm?no_cache=true.
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]].


[[Category: QPR ProcessAnalyzer]]
[[Category: QPR ProcessAnalyzer]]

Revision as of 15:46, 10 December 2020

Data can be imported from SAP (using the RFC interface) with --#ImportSapQuery command in SQL scripting and ReadSap function in the expression language. In addition to the RFC interface, data can be fetched from SAP HANA with ODBC using the ImportODBCSecure function and ImportOdbcQuery.

Data conversion in RFC interface

Data fetched from SAP using the RFC interface, contains accurate data type information, so data will be converted into respective data types used by 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)

Conversion is determined by the ConvertDataTypes setting. If no conversion is defined, --#ImportSapQuery (in SQL scripting) does not make any conversions, and ReadSap (in expression language) makes all conversion. When there is no conversion defined, data is converted to strings.

Date (D) and time (T) type of fields are usually related to the same timestamp and thus they are bound together as follows: If T type of column is defined directly after the the D type of column, the time part in the T column is added to the D column, and no new column is created for the the T column. This is done only if both D and T types are among the converted types.

Note that, in the C datatype, spaces from both side are trimmed away.

More information about SAP data types: https://help.sap.com/saphelp_nwpi71/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm?no_cache=true.