cancel
Showing results for 
Search instead for 
Did you mean: 

"Is Initial" clause for "DUPLICATEREFERENCEUUID" with type "RAW" cannot be used

friendlycoder
Participant
0 Kudos

Hi all,

The following CDS view doesn't compile:
define root view entity YSWIFTBANKSHISTORY
provider contract transactional_query
as projection on YSWIFTBANKSHISTORYTP
{
key Uuid,
PublicationDate,
ImportedAt
} where DuplicateReferenceUuid is initial

The compiler complains:"Is Initial" clause for "DUPLICATEREFERENCEUUID" with type "RAW" cannot be used
The data type of the field "DUPLICATEREFERENCEUUID" is "abap.raw(16)". How to question if field "DUPLICATEREFERENCEUUID" is initial?
Sandra_Rossi
Active Contributor
0 Kudos

Did you check what says the ABAP documentation corresponding to your ABAP version?

friendlycoder
Participant
0 Kudos

Hi sandra.rossi

Our ABAP version is SAP_BASIS 757 0002 SAPK-75702INSAPBASIS SAP Basis Component.

I couldn't find anything in the ABAP documentation.

Best regards

Sandra_Rossi
Active Contributor

I'm surprised that you didn't find anything. Searching and finding is the most valuable skill in the world 😉

CDS DDL - CDS View Entity, cds_cond, INITIAL

It says that IS INITIAL is NOT allowed for RAW.

lhs can have any data type except for CLNT, DECFLOAT16, DECFLOAT34, DF16_DEC, DF34_DEC, DF16_RAW, DF34_RAW, LCHR, STRING, RAW, RAWSTRING, DATN, TIMN, UTCL, and GEOM_EWKB.

friendlycoder
Participant
0 Kudos

Dear sandra.rossi,

What can I use for the data type RAW?

where DuplicateReferenceUuid is null

is also not allowed.

Best regards,

matt
Active Contributor
0 Kudos

How about abap.xstring(16).

Or sysuuid_x16.

friendlycoder
Participant
0 Kudos

How to put it in the where clause?

This does not work


where DuplicateReferenceUuid = sysuuid_x16;

Sandra_Rossi
Active Contributor

You seem to have difficulties to search the ABAP documentation, I hope you'll think about improving your skills.

Typed Byte Literals

This one should work (16 bytes = 32 zeroes):

} where DuplicateReferenceUuid = abap.raw'00000000000000000000000000000000'
friendlycoder
Participant
0 Kudos

Dear sandra.rossi

Thanks so much for your hint. I need to definitely improve my skills in relation to search the ABAP documentation.

Best regards

matt
Active Contributor
where DuplicateReferenceUuid = sysuuid_x16;

Of course it won't work. sysuuid_x16 is a type. I was suggesting that instead of using abap.raw(16) as your type you use sysuuid_x16!

In fact, if you are wanting a 16 byte hex uuid, you definitely should use sysuuid_x16. It's what it's for!

And then you can go: where DuplicateReferenceUuid is initial.

friendlycoder
Participant
0 Kudos

What is the difference between abap.raw(16) and SYSUUID_X16?

Underneath, they point to the same scalar type.

Best regards

Sandra_Rossi
Active Contributor

matthew.billingham The documentation below says that it's not possible to use IS INITIAL for a RAW type in a CDS view. I don't know what you are referring to, to say that it's possible.

CDS DDL - CDS View Entity, cds_cond, INITIAL

lhs can have any data type except for CLNT, DECFLOAT16, DECFLOAT34, DF16_DEC, DF34_DEC, DF16_RAW, DF34_RAW, LCHR, STRING, RAW, RAWSTRING, DATN, TIMN, UTCL, and GEOM_EWKB.


matt
Active Contributor

sandra.rossi

Ah yes, this is a CDS - different constraints. Elsewhere

CHECK uuid IS NOT INITIAL.

is permissible.

From your list, it looks like xstring is an option!

Sandra_Rossi
Active Contributor

bifunctor If it works, could you confirm? (and possibly post it as an answer then) Thank you!

} where DuplicateReferenceUuid = abap.raw'00000000000000000000000000000000'

Accepted Solutions (0)

Answers (0)