2015 Jun 15 7:28 AM
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 name | Type |
| F1 | DATS |
| F2 | INT4 |
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.
2015 Jun 15 10:12 AM
Hi Alexey,
as the dump mentions, the DB type and the ABAP type are not compatible. Daydate like '2015-01-01' is not compatible to DATS '20150101'.
So you would have to convert daydate (or to be more precise, the type CS_DAYDATE) to a compatible type for ABAP DATS. As this is hardly possible within Open SQL (at least in the current version), the question is, whether you can already modify the date at DB level, before reading it from the database.
My question is, why you got a DAYDATE type in zbseg2 (not a copy of BSEG, right?). Because in BSEG I know the DATS are persisted to NVARCHAR(8) fields. You might want to model it the same way.
Cheers,
Jasmin
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 name | Type |
| F1 | DATS |
| F2 | INT4 |
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.
2015 Jun 15 10:12 AM
Hi Alexey,
as the dump mentions, the DB type and the ABAP type are not compatible. Daydate like '2015-01-01' is not compatible to DATS '20150101'.
So you would have to convert daydate (or to be more precise, the type CS_DAYDATE) to a compatible type for ABAP DATS. As this is hardly possible within Open SQL (at least in the current version), the question is, whether you can already modify the date at DB level, before reading it from the database.
My question is, why you got a DAYDATE type in zbseg2 (not a copy of BSEG, right?). Because in BSEG I know the DATS are persisted to NVARCHAR(8) fields. You might want to model it the same way.
Cheers,
Jasmin
2015 Jun 15 10:51 AM
Hi Jasmin,
thank you for your reply.
In our system we have all date field for all replicated tables converted to this format DAYDATE (and BSEG too). It is a fait accompli, that I can not do anything.
Can you talk me in which version of ABAP it will be possible? Or may be you know release date for this version?
Best regards, Alexey.
2015 Jun 18 2:27 PM
Hi Alexey,
I don't know about such a requirement (but that doesn't mean it does not exists... I just don't know about it), so I don't have any release information when such a feature will / might be available.
My question is, why have BSEG fields been converted to that data type??
Cheers,
Jasmin
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |