cancel
Showing results for 
Search instead for 
Did you mean: 

The CDS View has Billed Date in DATS Format in S/4 HANA. This reflects as STRING in Datasphere

0 Kudos
133

I consume a CDS View from my S/4 HANA Connection as a Remote Table in Datasphere. The Column Billed Date represented as DATS Data Type in S/4 HANA, is incoming to Datasphere in my CDS View Remote Table as STRING. What should I do to get the Data Type as Date in my CDS View Remote Table in Datasphere.

View Entire Topic
Savio_Dmello
Active Participant
0 Kudos

Option 1; You can modify the field definition of the Billed Date in your CDS View in S/4HANA as follows:

Use the ABAP.SQL.DATE annotation to ensure the field is represented as a date type. Here is an example:

@ObjectModel.dataType: #DATE
@EndUserText.label: 'Billed Date'
billingDocumentBilledDate as BilledDate

Option 2: In Datasphere, after you have connected and imported the Remote Table, you can create a Graphical View or a SQL View that transforms the STRING field into a DATE field.
Example SQL transformation for converting the STRING to DATE could look like this:

SELECT TO_DATE(BilledDate, 'YYYYMMDD') as BilledDate
FROM Your_Remote_Table;