14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

15

ABAP Programming for SAP HANA

Figure 15.3 Creating a DDL Source: Part 2

Your CDS view already has a name, but having one name is just not good enough;

you need two names. The new name is for the SQL view that is going to be created

in the dictionary (the one you will be able to look at in SE11), and the name

you already have is a name for the CDS view entity, which is viewed and changed

via Eclipse. You could name both the SQL view and the CDS view the same,

but…don’t. They’re different things, so the name should reflect that. Call the SQL

view ZV_MONSTERS and the entity ZCDS_MONSTERS.

The former can be seen in SE11; the latter is the one you should refer to in SELECT

statements in your ABAP programs. (You could refer to the former in your programs

as well, but that would be naughty.)

Coding the DDL

Now, it’s time to code the DDL, which will eventually create the CDS view when

complete. As mentioned earlier, this will consist of one big SELECT statement. You

have to start the coding with one or more so-called annota tions, which can be

thought of as header settings (or metadata, as in “Mutants in Metadata One”) for

the view. An annotation is a line of code that starts with an @ sign.

662

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!