Alessandro Canevese 27.Mar.12 10:08 AM a Web browser Connector for ODBCAll ReleasesAll Platforms
Hi all.
I'm new to LEI and I'm trying to use it to replicate some tables from SAP to a MS SQL Server. We are using the SAP Connector to read tables from SAP and the ODBC Connector to write records to MS SQL Server. Everything works fine, except for the dates.
In SAP the date type for table fields is DATUM that does not contain the time reference. If you need to store a timestamp you have two options: a) to store the time part in a UZEIT type separate field; b) to use a timestamp data element that can be implemented in several alternate ways: as CHAR14, NUMC14, FLOAT, and the like.
The point here is that in MS SQL Server timestamps are stored in a single field of type DateTime.
So, apparently, there could be two ways to replicate the values from SAP to SQL Server, but none of them seems to work (given the connectors we are using).
1) use two fields (types DATUM and UZEIT) on the SAP table and merge them on the fly on a format suitable to be mapped to a corresponding single DateTime field on the MS SQL Server table. As far as I've seen there's no way to do it (I mean that in the wizards I've used to configure the mapping between the tables I've not been able to find a way to do it).
2) use a single field (that is rendered as a CHAR14 or a number, etc.). This appears to not work either, as it fires an exception at runtime, saying that the string (the number, the float, etc.) cannot be converted to DateTime.
What can I do? Any help/suggestion is greatly appreciated!
Thank you in advance.
Ciao
Alessandro
P.S.: notice that DATUM is indeed recognized by the mapping wizard as a DateTime field. But, obviously, lacking the time information, after the replication the time part of the DateTime field in the MS SQL Server table appears to be void (0:00:00).