2016 Aug 12 1:46 PM
Hi,
Is there any way to expose HANA view to ABAP as External View, when column types are: DATS, TIMESTAMP, VARCHAR ?
I've found one answer for VARCHAR (https://scn.sap.com/thread/3533385)
I have the possibility to edit HANA View, so how can I neatly expose columns with DATE data type, to use on ABAP as simple select statement ?
It's really useful since I have ranges as variables in WHERE clause and of course simple SELECT in ABAP code is much easier to read.
So far I get the error during creation of External View:
Field DOCUMENT_DATE: no Dictionary type exists for database type DATE.
The aim is to have such a situation:
HANA:
AT_DOCUMENTS:
document_date (Data Type DATE)
ABAP:
ZEV_DOCUMENTS
document_date (what type??)
and in code
SELECT *
FROM zev_documents
INTO DATA(lt_documents)
WHERE document_date IN s_date.
I cannot find any reference, which HANA types are supported and which not, neither the way how to easily convert unsupported types
Regards,
Radek
Hi,
Is there any way to expose HANA view to ABAP as External View, when column types are: DATS, TIMESTAMP, VARCHAR ?
I've found one answer for VARCHAR (https://scn.sap.com/thread/3533385)
I have the possibility to edit HANA View, so how can I neatly expose columns with DATE data type, to use on ABAP as simple select statement ?
It's really useful since I have ranges as variables in WHERE clause and of course simple SELECT in ABAP code is much easier to read.
So far I get the error during creation of External View:
Field DOCUMENT_DATE: no Dictionary type exists for database type DATE.
The aim is to have such a situation:
HANA:
AT_DOCUMENTS:
document_date (Data Type DATE)
ABAP:
ZEV_DOCUMENTS
document_date (what type??)
and in code
SELECT *
FROM zev_documents
INTO DATA(lt_documents)
WHERE document_date IN s_date.
I cannot find any reference, which HANA types are supported and which not, neither the way how to easily convert unsupported types
Regards,
Radek
2016 Aug 12 1:58 PM
Hi Radek,
I have not understood fully your question.
As per my experience whenever I came across situation, I changed HANA view date column to NVARCHAR(8) type and later in external view changed to date type.
-Amol S
2016 Aug 12 2:06 PM
Hi Amol,
Just imagine that on HANA side (column SAP HANA Type), for column FKDAT, you have the type DATE - and that's my question. To create a HANA view from such a column.
Regards,
Radek
2016 Aug 13 4:26 PM
Yes you are right...
If you really don't want to change a data type of HANA, then you can call hana view in AMDP ....
Cheers,
Amol
Message was edited by: Amol Samte
2016 Aug 18 9:08 AM
2016 Aug 18 9:11 AM
Hi Amol, thanks for the clue NVARCHAR(8), i did exactly the same and now DATS is in the list.
Thank you very much.
2016 Aug 12 2:01 PM
Hello Radek,
here you find a list of supported data types. Data type conversion for not supported types is typically done on HANA level in a separate "ABAP Query View" (just put an additional query view on top of the existing query view which does the necessary conversions, e.g. by a calculated column).
Another question is if you really need the HANA view. I mean do you need the HANA view also in the HANA database or in another tool, or is it just consumed from the ABAP level? If you just need it from the ABAP level you can think about the usage of ABAP CDS Views. In that case you don't have to deal with not supported data type mappings and the lifecylce management stuff.
Regards,
Florian
2016 Aug 12 2:11 PM
Hi Florian,
Thanks for the link, I just forgot that 7.4 documentation is really complementary.
The thing is that database table stems from HANA (is used not only on ABAP side), therefore I need to adjust.
Calculation View with simple conversion looks like the solution.
Are there any "official" recommendations how to convert unsupported HANA Data Types (like date to integer or string etc...)? Or is it just up to developer?
Regards,
Radek
2016 Aug 12 3:02 PM
To my knowledge there are no guide etc. We did it ourself depending on the requirements.
Regards,
Florian
2016 Aug 17 2:50 PM
Hi Fiorian,
Thank you for the information.
How can we do this at HANA level with abap query view, if possible please provide sample code.
Many thanks in Advance
Riyas
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |