Skip to Content

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Feb 14, 2019 at 04:57 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 09, 2018 at 07:55 AM

    Did you try with '099991231235959'?

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

  • Posted on Jul 08, 2019 at 03:30 PM

    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 ?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 17, 2020 at 12:34 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.