Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP CDS-View: Select with Where and DEC15 "timestamp"

johanneshoehmann
Discoverer

Hello,

i want to select from Table but021_fs (the business partner adress usage). I want to filter for the field "valid_to" which is DEC15.

I always get error messages.

If i use

where but021_fs.valid_to = '99991231235959' I get an data type conflict error

where but021_fs.valid_to = 99991231235959 I get an error with 4-Byte-Integer error

where but021_fs.valid_to = '99.991.231.235.959' I get an data type conflict error

and but021_fs.valid_to = 99991231235959.0 I get an error that the value is too big.

So, how to correctly make this statement?

Thanks for your help

11 REPLIES 11

raymond_giuseppi
Active Contributor
0 Kudos

Did you try with '099991231235959'?

0 Kudos

Value of literal (-)099991231235959 is greater than a 4-Byte-Integer is the error.

0 Kudos
  • In your version is this field actually a DEC 15 (TZNTSTMPS short time stamp) or an INT 4, are you victim of an implicit conversion
  • CDS view: Did you try to use some function such as TSTMP_TO_DATS() or DATS_TIMS_TO_TSTMP() to handle this timestamp
  • Abap / Open SQL: did you fill some field with result of CONVERT DATE dat TIME tim INTO TIME STAMP DAT ts ZONE tz.

0 Kudos

I opened a ticket at SAP. They said it is a bug and will be fixed in a later release....

0 Kudos

What is your SAP release ? Can your share with us the SAP message ?

Dear customer,

for the time being, all numerical literals in CDS conditions are processed via an intermediary 4-byte integer representation,

leading to an error on overflow. This applies to releases up to and including SAP_BASIS 7.50.

At this point, I can not make a statement if and/or when this will change. Inquiry with development is pending.

Johannes, is there an update to this issue? I'm also experiencing this issue regarding data types in CDS views and need a solution. Please share with us the SAP ticket information that you mentioned back on your August 31 post: "I opened a ticket at SAP. They said it is a bug and will be fixed in a later release....". We would like to reference that when we submit our own ticket.

Thanks

0 Kudos

Hi,

just for you info - I have a 7.50 sp1, in this release it works correct.

lg

i-ivd
Explorer
0 Kudos

Fine that it's working with 7.50 sp1, but what to do if we dont have yet this release ? will this bugfix be shipped as a separate note ?

0 Kudos

Here is the ugly workaround for "old" releases: just use an good old dictionary database view on BUT021_FS with a selection condition "BUT021_FS VALID_TO EQ 99991231235959 " ...

matthias_weiss
Explorer
0 Kudos

Hi,

just use

<table>.valto = + 99991231235959

Works fine for me; you just need to put the sign in front.

Now for creation of a timestamp like

cast( 99991231235959 as abap.dec( 15, 0 ) )

that's a different story.

Regards,

Matthias