Quantcast
Channel: SCN : All Content - ABAP for SAP HANA
Viewing all articles
Browse latest Browse all 831

Open SQL access to DAYDATE field

$
0
0

Hi !

 

I have some table in HANA with DAYDATE field

 

create table zbseg2 (f1 daydate,f2 integer);

insert into zbseg2 values ('2012-03-01', 100);

insert into zbseg2 values ('2012-03-02', 200);

 

I have secondary connection from ABAP application server to HANA named hb1_test. In application server table ZBSEG2 described in data dictionary like this

Field nameType
F1DATS
F2INT4

 

The next code works correct:

REPORT zhana_zbseg2_conn.

DATA l_str LIKE zbseg2.

SELECT SINGLE * INTO CORRESPONDING FIELDS OF l_str FROM zbseg2 CONNECTION hb1_test.

MESSAGE s000(00).

I receive first record from HANA table with correct field F1.

 

But next code has dump as a result

REPORT zhana_zbseg2_conn.

DATA l_str LIKE zbseg2 OCCURS 0.

SELECT * INTO CORRESPONDING FIELDS OF TABLE l_str FROM zbseg2 CONNECTION hb1_test.

MESSAGE s000(00).


Dump is "Database error text: "SQL message: DB type (14) of selected column (0) and ABAP type TYPDATE (1) of target field (0) are not compatible"


Is there a workaround for this case? May be I need to use another type in data dictionary description? I try different types but no result.


Viewing all articles
Browse latest Browse all 831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>