dateabaphanaslt

SAP HANA Decimal to timestamp or seconddate SLT


I am using SLT to load tables into our Hana DB. SLT uses the ABAP dictionary and sends timestamps as decimal (15,0) to the HANA DB. Once in the HANA DB via a calculated column in a calculation view, I am trying to convert the decimals to timestamps or seconddates. Table looks like this:

Table Definition

I run a small SLT transformation to populate columns 27-30. The ABAP layer in SLT populates the columns based on the Database transactions.

The problem comes when I try and convert columns 28-30 to timestamps or seconddates. using syntax like this:

Select to_timestamp(DELETE_TIME)
 FROM SLT_REP.AUSP

Select to_seconddate(DELETE_TIME)
 FROM SLT_REP.AUSP

I get the following errors:

Timestamp enter image description here

Problem being, It works some times as well: enter image description here

The syntax in calculated column looks like this:

Calc Column

With the error from calculation view being:

enter image description here

Has anyone found a good way to convert ABAP timestamps (Decimal (15,0)) to Timestamp or Seconddate in HANA?


Solution

  • The problem was with the ABAP data type. I was declaring the target variable as DEC(15,0). The ABAP extracting the data was rounding up the timestamp in some instances to the 60th second. Once in Target Hana, the to_timestamp(target_field) would come back invalid when a time looked like "20150101121060" with the last two digits being the 60th second. This is invalid and would fail. The base Hana layer did not care as it was merely putting a length 14 into into a field. I changed the source variable to be DEC(21,0). This eliminated the ABAP rounding and fixed my problem.