Hi I'm Philip from the HANA Academy in this series of videos we're looking at
the XS Advanced model in this and the next several videos we're going to look
at what's new with Web IDE for HANA when we’re with HANA 2 SPS 01 if we
just look at this version from help about you can see i'm using SPS 01
of HANA 2 patch 2 there are patches that become available every so often so
patch 2 was released in early June 2017 now I'm using the on-premise
version of HANA however you could also be using HANA Express if you want as well
you'll need the the full apps version of HANA Express to work with Web IDE for
HANA and XS Advanced so what we're going to do is build a Fiori application
web-based application or build it from scratch and as we go through that we'll
see some of the new things that have been added with SPS 01 for Web IDE for
HANA so to get started the first thing I'll assume that you've already done is
that you've created a space for example I've created one called dev and then
you've got a suitable user and you're able to log in to Web IDE for HANA you
can see that in other videos in this series now it's not specific to SPS 01
so to get started we're going to want to create a project so we can go to
the workspace hit new project from template this multi target application
project is the one we need to choose and we can give that project a name I'm going
to call it sales now one of the things that's new with this SPS 01 you'll see
that if you only have one space authorized for your user in this case
it's just a dead space that space will be selected automatically in prior
releases you had to explicitly select it even if there's only one available so
hit next and finish and it will create the project for us so if we expand the
project what we can see is that we've got our mta yaml file now if we just open
that you'll notice one of the quite nice new things that's available with SPS 01
is a mta yaml editor now previously what we had to do
was use a code editor and we'd have to use spaces and indentations
and get some very specific syntax as we build our mta yaml
file this file if you remember is what basically pulls together all the
different multi target components or modules within your overall project now
with SPS 01 we've introduced a editor called the mta editor and what this
does is allows you to much more easily generate the file and it's quite nice
because you can switch between the editor and a code editor visual editor
code editor at will so you can see at the moment is pretty empty we've just
got the basic information the ID the version schema version again you can see
that in the code editor but as we go through the videos we'll see that that
is this mta editor will become more useful and you'll see how it's actually
working for us now we've done that the next thing will be to actually create an
HDI container because we want to basically create a schema and the users
around that schema in HANA so we can have data stored in HANA
so let's go to right mouse button on sales our project and then we'll choose
a HANA database module now the order in this list is based on what you most
recently did so if you don't see it here you just click on more and then you'll
get the full list of all of the modules available so I'm going to go for HANA
database module and we'll give it a name I'll call it DB now something that's new
with SPS 01 is that you have the ability now to choose which HANA
database version you would like to target you can see here that we've got
SPS 01 of two SPS zero or even HANA 1.O SPS 12 so what that means
basically is that when you choose this target HANA database version the code
editors when you're building HDI artifacts so maybe calc views or CDS
entries the code editors will adapt and basically only give you a functionality
that's available in the version of HANA that you've targeted so what this means
because this is now part of XS advanced and Web IDE for HANA you can
upgrade for example your SPS 12 landscape you can upgrade to the more
recent XS advanced and a more recent Web IDE for HANA such as the one that comes
with 2.0 SPS 01 you can upgrade to that
version in your SPS 12 landscape and then you can develop apps that will work
on your HANA SPS 12 database you are able to to use Web IDE for HANA with
prior releases of HANA so you can actually mix and match the version of
HANA as a database and the version of Web IDE for HANA and XS advanced so
that's something that's new in SPS 01 so let's go ahead and finish we're
working in SPS 01 anyway so we've just selected the SPS 01 it created
our database module now if we just go back to our mta yaml file you'll see
that now we've got a module called DB that's been added it’s of type HDB HANA
database and we can if we scroll down we'll see some different properties for
example it requires a service called HDI container and if we go to the list of
resources you'll see that a surface called HDI container is defined as an
HDI container type with XS advanced with some properties around it etc etc
so this is a very nice way of working with the mta editor you can see it's
quite easy to organize what you've got if you wanted to see what it looks like
in the code you may already be familiar with this then it would like this you
put your modules section your resources section and of course you need to make
sure you're using spaces not tabs and you're doing correct indentations
but the mta editor itself will take care of that job for you so the final thing
we want to do actually to create some tables in our
HDI container so to do that we go to the source folder right mouse button and hit
new and we've got different types of artifact we can create and the one we're
going to use here is CDS so let's do a new CDS artifact now there's a
graphical editor and a text editor we've seen the graphical editor in the past
let’s this time go with the text editor we'll give it a name let's call it
tables because we're going to store some table definitions in there hit create
and it will open up the text editor now something that's quite nice here and
that's new is it if you right mouse button you can insert code
snippets so for example I just want to create an empty context ready to go to
start coding I can do that I notice that it identified the namespace based on the
project and the module name to sales.db it's identified the context that it
would expect you'd want to use which is the name of our file which I've called
tables and it's also giving you commented out the code you would
need if you want to automatic OData publishing something you can use already
from Java and in the future from XSJS so we created the context there are
other things that you can use the snippets for there are all sorts of
different options there so that's something you can look at in your own
time what I'm going to do is just create a definition for a couple of tables
we're going to have some sales data from regions and different countries within
those regions and to save you typing we can copy and paste the code from the
GitHub repository that's associated with these videos so if you don't know by now
go to github.com SAP HANA Academy should find a link actually with this video or
with the playlist description go to the XSA repository and then in there you’ll
find that we have sales and in sales there is a text file with some code so
we want to do is to take this context and actually the two entities region and
country so we just take that bit of code I'm going to copy it and then paste it
into here and then I can save it now one of the other things that you can do is
you can right mouse button and you can choose to beautify your code which means
it formats it and that's always a nice good thing to do in fact this case it's
already formatted appropriately now in SPS 01 you can actually customize
how you want that beautified process to take place so if for your project you
right mouse button and choose the project settings you can see that we've
got the beautifier and as well as JavaScript which was already there we've
got CDS so for CDS you can actually go in and define how much alignment how
much white space where you want to have line breaks or not so you've got some
control on a project basis for how you want the beautify option
to actually work so again that something new with SPS 01 so we saved it and what
we now need to do is go ahead and build it so let's go to our database component
and we'll hit build nothing new with that that's exactly as we've run in
previous versions so the build has completed successfully we can see that
message down here at the end so it's basically created our HDI container a
schema and the associated technical users to work with it in our HANA
database so what we're going to see in the next video is actually how we can
work with that schema using the database explorer or the HDI container and we'll
see also what's new with the database explorer in SPS 01 so what we've
seen in this video is how to set up a project we've looked at some of
the new capabilities of the mta editor for mta projects and we've also seen CDS
beautify and the code snippets - the newest CDS entries you can find more
HANA video tutorials on our YouTube channel if you'd like to be informed as
soon as new video tutorials are published please subscribe to the
channel you can also connect with us on LinkedIn follow us on Twitter and we
have pages on Facebook and Google+ code snippets for all of our tutorials are
published to GitHub thanks for watching