Skip to Content
author's profile photo Former Member
Former Member

Error occured when using default modifier in CDS

Dear Experts,

when I created a simple CDS document with default modifier in HANA SP6, I always got failure.

The error message say "Unexpected token"default" at line x,column x".

My CDS document is below.

namespace Hello_XS.db;
@Schema: 'DEMO'
context modifiers {
    entity table1
    {
        key field1 : String(10);
        field2 : String(10) default "dummy";
    };
};

when I activated,I got the below error.

would you please kindly let me know how to solve it? thanks in advance.

error.png (18.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 06, 2014 at 11:51 AM

    Sorry, there is a bug in the developer guide on page 183, it says to use " and you need to use '. Hopefully or Former Member will get it fixed.

    The code below activates successfully.

    John

    context test2 {

    entity table1

    {

    key field1 : String(10);

    field2 : String(10) default 'dummy';

    };

    };

    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.