Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

33 Generic Handlers Introduction

Alright guys, welcome back to the next episode on SAP Business Technology Platfor
m training with me and above. In our last session, we talked about concept of creatin
g our information models or data models with the help of also including the languag
e specific texts as well as the translated text for the labels and annotations. In today's
episode, we will continue with CDs views.
Also, I will start with development in SAP BTP directly. So many of you also had this c
oncern that if my company is not allowing me to install any software like Vs code, ho
w can I start development on Business Application Studio? Or what is the options do
we have? So, what are all the challenges you're facing at the moment while developi
ng the CAPAM application? So, first challenge, if my company do not allow me to up
date or install any software like Vs code or node JS, how to practice CAPM? The seco
nd was if I am changing my device multiple times, what options do I have to run sam
e code without porting manually? Is it possible to use everything on web browser inc
luding development and testing? Answer to all these questions is one which is SAP B
usiness Application Studio? SAP Business Application Studio is a state of the art devel
opment tool for multi cloud development of applications on BTP. We can use the Bas
s or Business Application Studio for pure development, CAPM development, plugin d
evelopment work, cloud workflows, IRPA development, and many more use cases.
It's a multi cloud development environment which you can use to develop all the app
lications directly in the cloud. Also solving all the three challenges which are listed ab
ove. To begin with development of CAPAM in Bas, the very first step is you need to st
art launching the Bass.
It's free. It's available in the trial account with two dev spaces. Now, let's understand
what's happening when you run SAP Business Application Studio in BTP.
So, you all are aware that we have something like SAP Business Technology Platform
which is a platform as a service running on infrastructure as a service. So somewhere
on the internet there is a infrastructure as a service which is hosted by AWS. On top o
f this, SAP have got the SAP BTP business technology platform.
Now, as a developer, I don't want to install anything in my local machine. Yes, rather I
wanted to directly open browser and connect to a development tool on the internet.
And this is your SAP business application studio.
Now, this is a development tool offered on SAP Business BTP to develop all sorts of a
pplications. Those who have attended my UI five training these days, we are using Ba
sh to also build Fury app. There is also open question by one of you which is still ope
n since quite long time.
I will come to it soon. Where you asked me can I develop and connect a Fury applicat
ion to a on premise system and build a Fury application on on premise system or not
? Answer is yes. We will also learn that as a request, extra request from your end we'll
cover that.
That question is in my mind. Yes, you ask me this and I will answer it. Yes, yes, using
Cloud connector, definitely we'll do that, don't worry.
Okay, but it's still a far away story. But let's focus on this CAPAM first. So now in the B
ass you will create something called dev space.
What's a dev space? So when you create a dev space, basically it's going to start a ne
w virtual machine here on AWS account. A virtual machine which is basically similar t
o local computer. So just the way you have a local computer and operating system.
Similarly in this, this is a virtual space on the physical space which will have a Linux o
perating system. Behind the scene, Linux spelling is incorrect. Linux or Linux whatever
you call it, there will be a Linux operating system and on that this tool will be installe
d and then you connect.
You will be able to create working directory and play with all the commands, most of
the Linux commands to start creating projects and you can create multiple projects in
there. The best part of Bass is it's also built using a image of Microsoft Vs code. So ba
sically what SAP did is they took the Vs code code and they have adapted and modifi
ed and they published it as a Bass.
Okay. Now if you want to start Bass, what is the okay, why am I picking this topic ove
r the CDs view right now? Because we need to start a dev space which is going to tak
e few minutes and during these few minutes I can take you back to the CDs view topi
c, finish that up and come to Bass again. If you are well versed with Vs code you can
develop both locally and over the Bass your applications for CAPAM.
So let's go to SAP BTP trial. Hanatrail, only one cockpit provide our account where we
've been doing deployment of most of our applications. And on very first page you w
ill see this option called Bass, SAP Business Application Studio.
I hope you all remember long time back in our sessions I've shown you launching a H
ana database explorer through Bass. Yes. So that's where we created this dev space.
I'm going to delete everything. So when you will come here at the beginning, very be
ginning, you will see nothing. This is how it will be.
So that's how I'm making it. Just to make you understand it easy. This is how it looke
d like initially.
You will click on Create Dev space and now you will choose you see the variety of de
velopment like mobile application, hana, Full Stack Cloud and Fury. So I want to full s
tack cloud. Why it's called full stack cloud? Because database Service and Fury all thre
e will be clubbed together.
And I'll choose here dev space name as let's say CAPM. You can name it anything yo
u can name it as like Mario Contra Popeye. Yes, Dorimon it's your choice.
So I'll just give it CAPM and I choose here SAP full stack development. Now this is ba
sically specially designed development environment for CAPM based applications. Yo
u see SAP, CAPM? Yes.
So that's the power and it will also get you all the necessary tools to develop CAPAM
based applications. All the tools are automatically will be pre installed. If you rememb
er in Vs code we went and we installed a CDs extension here.
Yeah, we did that. That is what we did manually. But you don't need to do in the bass
.
It will be coming pre installed automatically. Wow. Click on create.
You don't have to check anything, it's fine. Click on Create if you want, you can add t
hose extensions later. And now it's going to take some time to start.
So it's spinning a virtual machine, it's creating a physical space, allocating a physical s
pace somewhere on an AWS machine and creating a Linux virtual machine where it's
going to host a working directory where I can create my projects. That's what it's doi
ng behind the scenes. So I'm going to come back to this topic maybe in next 20 min
utes because it's going to take like five to ten minutes.
In the meanwhile, let's go back to our original topic of CDs views. So now I will go ba
ck and complete our CDs view. So I will add some more views.
So the first type of view which I wanted to show you is a simple view which will retur
n my text, which is a language specific text. And also it will return the description and
the text basically. So a simple view.
Later on I will use this view for the purpose of Value Help. F Four help in a Fury app. T
hat's why I'm creating it, so you can create one.
So let's come down. So yesterday we created PO worklist. Now I'll define a new view.
So get code completion and then say Product Help view can name it anything or Pro
duct Value Help. People can call it as VH value Help. Let me just give value.
Help. And now guys, watch out. Till now we did a as projection, right? If you go back
it was as projection.
You can also create a service by writing select Query. Yes, that's possible. So you can
say directly select from Master product.
Nice, let me add that dependencies using dot dot slash means working directory. Ab
ove the working directory we have a DB directory. In that we have data model CDs a
nd there we have our namespaces Anuba DB master and anubo DB transaction.
So master product. And now I'll say end user text. This is an annotation we saw alrea
dy yesterday.
So I wanted to expose the master data out and I can use end user text label. This is a
n annotation. I can add extra for my Fury application later on to also utilize this.
And there I can also add language specific descriptions. Yeah. So I can hard code this
.
Let's say for English language, this is another way of providing annotation. Language
is a keyword here english if somebody hits this product value help in English languag
e, they will see the name description of this entity as Product ID, this property as Pro
duct ID. And if somebody hit it in German language, I will say Product ID product ID.
Yeah. All right. So I don't know whether it's a correct translation, but I just kept it.
And now let me put the field name my Product ID field code completion as I will give
a name as Product ID more meaningful name we can give. Now I will add also descri
ption. So let me also choose similarly this end user label.
And I'll say description as description. And I'll say product description. I could go bac
k and use yesterday's technique to give also the labels with I 18 n what we did yester
day, add the rate title thing.
Whatever we use guys, we can reuse that. But I just wanted to show you all the possi
ble techniques which are possible. So that's my next view.
Now, notice this is built on a select query track select you can do to build a service. It'
s possible. You can do it on a view.
You can do it on a projection on a table. Or you can do it on a view also. Let's put it d
e.
Okay, now I wanted to create my next view. And my next view is going to be on purc
hase order items. Let me do that.
Come next and I'll create another view. Let me put semicolon here. This is my first vie
w.
This is my second view. And I will now create a purchase order items view defined vie
w. We can also give now exact case sensitive view names by putting exclamation sign
bracket.
This is the way you give case sensitive names. I can call it as item view as select from
transaction table items PU items. And then I will add my properties like parentkey par
tner, Guid just following association.
And I'll say business partner ID as partner. Then I will add next one is product. Okay, l
et me put keys here because I would later use these keys actually.
So it's a node key which is partner. Then I will say productguid node key as product I
D. Then I will expose currency code as exclamation sign bracket currency code gross
amount parentkey overall status as PO status.
A fairly simple view which is exposing items data. Next, I wanted to define a view wit
h projection. Now I wanted to do aggregation.
Yesterday's class, I showed you the advantages of using views. We can also use view f
or aggregating the data, right? Yeah. Why we use views? So we can use the views to
do complex joins and also aggregate data.
So suppose I wanted to know if a given product is what is the total sales per product
? If I ask you, let's say tell me per product how much sales we have made this year or
till now? So you would not fetch all 20 billion records from database and then start c
alculating a total on the front end. Rather you would do that through a select query
using aggregate function. So I will say define and I will define a view.
Okay, so guys, I think we will first create these things as our views. So these are views,
not entities. These are not services.
Yeah, I'm creating views so I need to put them inside my CDs. View here. Exactly.
These are my views. So define view and then I will say product view subsum s and I'll
say select from master product as prod curly braces. And now watch out.
I can use product ID of course as exclamation sign product ID. Yes. And then I'll use p
roduct text from the association which we have text description as description.
And now I will do an association. So I will put here another bracket parenthesis and t
hen I will do a selection select from transaction items. So I'm saying please read all th
e items table as a as an alias name for this a.
And then I'll say where a dot product grid is matching with my prod node key. Wow.
And SPO sum purchase order sum.
I am saying this and inside this I will do a aggregate function sum of gross amount.
Wow. Fantastic.
So that is how you can do things. So a dot gross amount it's giving me an error here.
Alias name is required for this select item as total.
We can say I think we can put this over here. No. So define view select from product
table these product fields parentheses select from transaction table as a and then su
m of gross amount as sum let me call it as sum.
And this should also be alias finally yeah this needs to be also alias. Actually after the
where condition we have to also alias this. There is something we are missing.
I think we are missing some comma somewhere. Curly braces ended here. No group
by clause is not needed here one we don't need that because we are just doing a su
m of total products.
So we are just doing a sum here sum of gross amount s sum where we are just fetchi
ng all the data from the product table and the sum. Yes. Okay.
I think this whole thing as should go outside. Yes. That was my mistake.
Yeah. So you see this whole thing is actually a field. And this field I am naming it as P
O sum and this field is computed at runtime.
Now this whole query will be execute pushed down to database and will be compute
d within the database yeah so you will get the result much much faster and that's the
power of creating CDs views. Okay last view which I would like to create is basically a
view which is going to do the same thing but in a little different way. What is little dif
ferent way? So I would like to first show you a concept of exposed association.
Exposed association means you can create a view which will have selection of primar
y records and then dependent records. It will expose it as an association and that ass
ociation can be used in another view. So let me show you creating a product view de
fined view and our defined product view as select from master product and then I'll s
ay mix in.
What is mix in? I'm saying I want to expose a association name of my association will
be let's say PO orders. You can name it anything your choice. And I'll say association
to for per product there are multiple line items.
So we say association star to items view. So just now we have created about this item
view which I'm going to use in this view here. So it's a view and view concept plus als
o association.
So mixing means I'm exposing this association out okay, I'm mixing it with it okay on
and now I am going to use here my relationship. So I'll say on this PO order which fie
ld product ID field is compared with the dollar projection product ID but this product
ID now I'll define in my selection below. So this is how we can also create a view usin
g mix in syntax where we have exposed association.
This is very similar concept in ABAP where you can create exposed association here y
ou use mix in keyword for that. So this product ID will be defined of course here. So I'
ll define my product ID.
Yes, basically we'll use node key and I'll say s column bracket product ID and I'll just u
se that here product ID. So dollar projection means I'm referring to a field which I'm s
electing from the database. This is a very complex scenario where we define a view o
n another view .1
and then we are exposing an association. This is an association we are defining with i
tems view another view we are using in association. We're defining an association at
view level and this is going to be my association name.
Okay? And then we are defining relationship on what basis selection should happen.
This dollar projection is a keyword which is actually referring to a field which I'm sele
cting in the selection field. So here I'll put all my selection fields to use that in the joi
n criteria.
So let me add all the other fields also like for example description automatically desc
ription will load in the current locale language. Yesterday we saw that we'll use categ
ory as category. Then we will use price s price typecode s type code.
Let's say then we'll use supplierguid my business partner ID as VPID then we'll use su
pplierguid company name company name yes. Then we have let's say city suppliergu
id city it will have I think the address grid city. So you can use see all these were asso
ciations if you remember at database table level.
So under my product there was a supplier grid. Under supplier grid there was addres
s grid. So we can read these data from these associations also now I will go back and
I will read last country field let's say supplierguid addressguid country and now I will j
ust expose the association PU order.
So this PU order is a exposed association which means the data when somebody rea
d this view the data for orders will not be read by default until unless someone consu
me the association. Watch out. So now guys, okay let me just quickly draw here what
we are trying to do.
So we had built an item view on top of item view. I have built another view called pro
duct view. So it's basically view on view.
There are multiple concepts clubbed together. So there's an item view which use a d
atabase table called purchase order and purchase order items on top of this item vie
w. Now we have built another view.
Yes, we are stacking the views exactly. We have built a product view and this view is u
sing another database table called product table master table. Yes and this view is usi
ng this view.
But this view is a loose binding, it's not a tight coupling because we used it air mix in
and association name as PO orders. So this view will be a loose coupling. When some
body fire a select query on my product view this item data won't be read by default.
Okay last I want to build a consumption view for final consumption from the UI side
or whatever which is then going to aggregate the data. So in this final view I am goin
g to read my product data and per product what is the total of my item gross amoun
t. Yes.
So that is what our complete use case is in this case. So this will cover a lot of concep
ts like mix in, mix in keyword how to use mix in keyword exposed association yes vie
w on view concept yes how can we merge views? Then we have also the concept of d
ollar projection how to use that keyword. So it's more or less like ABAP like CDs view
concept which we are doing here.
Okay now you can also do the same total like this. This is an easy way but this is a m
ore sophisticated way yet it is very effective depending on your need. So it's my duty
as a trainer to show you all techniques.
This is one technique direct select query. This is another technique with view and vie
w approach. So let's go final our final consumption view which is going to be showin
g all the product values total per purchase order.
So define view and then I'll say C product value c means product consumption view.
So product values view as and now I'm selecting finally from this view which we just c
reated product view and then inside this we'll say product ID. Whatever you just nee
d, you can extract that country.
Then we can use, let's say PO orders, my exposed association currency code as let it
be currency code. And then we will say a sum of my PO orders gross amount. This ti
me I'm summing it as a gross amount and I'll call it as PO gross amount.
Yes. And now since I'm selecting data from these exposed association and this main
association and now I'm using parallel all the columns together with aggregation fun
ction. I have to do a group by.
So here we'll do a group by and we'll say product ID comma country comma currenc
y code. Let me define an alias for this. It yes, currency code.
Correct. Only currency code has not been found. Why? We have given it here, right?
Purchase order as currency code.
Okay. Is it not in the original view? Let me check. Didn't we expose currency code the
re? Yeah, in our this view.
No, we have it items view. Let me go and check. Here it is.
Okay. It's currency code directly, not currency underscore code. So let me come dow
n.
Yeah, it is currency code only directly. We have used PO orders currency code. So tha
t's how we can define.
Now the advantage is this is a consumption view and depending on your selection, it
is going to do the total automatically for you. Let us go ahead. And now build audito
r service.
So one auditor service for this guy, the final consumption view and one auditor servic
e for this plain select approach I'll create both produce same results. Yes, but just diff
erent ways of defining. Of course, in the first one, I didn't use currency code.
So it will just do a total blindy. It will also total by mistake your Euros and US dollar a
nd Indian Rupees and GBP. But here we are doing more defined aggregation by also
currency code.
So now it's time to create services. Very simple. Just define entity projection on.
So I can say product total or whatever you wanted to name. For example, I wanted to
name it as purchase orders. So we wanted to just read the data of our choice.
Like I can name it as product orders and I say CDs View. What was the name? Let me
just check it's. Product view sub.
And the next one is entity. And I'll say Product Aggregation. And I'll say CDs.
View. Consumption view. Product View.
Wow. That's all we've got. We have got our serious views and I'll save.
Let me come out and redeploy my changes. So system will generate for each views t
he corresponding things. Okay, now it's giving me an error mesh.
Define expecting column somewhere we missed. You see, there's a red. Here is a red.
We missed a semicolon. Yes, exactly. I'll save now still.
Do we have error somewhere else? Yes, here we have an error. It's saying a dot prod
uct ID in the PO item. It's not able to find product ID is it an association can't be used
as a value in an expression.
I think this where condition will also be outside. I guess so let's see. No, but when I d
efined it, it worked fine, right? Control space product quit.
There is some problem here in our data model. Why it's giving this error now an asso
ciation can't be used as a value in expression CDs. What's the problem? We didn't us
e any association as such.
Parentheses. Okay guys, product ID node key it should be sorry because we want to
compare the node key of item which was sold with the node key of product. So this
product grid is my association name.
If I go back and show you the table of my items you see here, this product grid is an
association to product table. So in this association I have to further go till the level of
node key. Correct.
So now let's redeploy deployment works perfect. We can now switch over back and t
est. So CDs watch as usual.
And now we will get two extra CDs views which we had just developed. In the meanw
hile, my CAPM is also up and running. We will use it now in a second.
But before that, let's test our CDs. So we've got CDs service and we got product aggr
egation product orders. So let's click on product orders.
Wow. You can see here how many product orders we have per product. You see 44 4
4 59 yeah, 89005.
So this is the data based on data. We have got the totals here per product, per produ
ct per description actually now next is I wanted to go and run the aggregated one w
hich is more interesting. Because tomorrow let's say if you want to build analytic appl
ication, you would want to use this one.
So here you get now per country per product ID per currency the total purchase orde
r gross amount, how much you sold, you purchase that product. Now the beauty her
e is if you go back and say m percent dollar select equals to country comma purchas
e order gross amount it has got you now this country and total per country per prod
uct actually excluding the currency code actually it has totaled up all the amount rest
of all the amount per country. Yes, excluding the currency code.
So you can tweak the data like this depending on your need by using dollar select an
d system will do the total accordingly. That's the benefit you get when it comes to C
Ds views. So these are all the CDs views which we have created multiple concepts an
d view on view concept stacking multiple views.
That's the way you do in ABAP programming. If you know about ABAP CDs then it's a
very similar approach what we did here in our case also. Okay, cool.
So now let's move on and talk about CAPM. So CAPM development in Bass. So here
we have got a dev space up and running.
So what is the next goal? Next goal is I wanted to take entire development what I've
done till now into the Bass. Because many many of you are using your company lapt
ops and you may not have authorization to install Vs code. So how can you practice
along with this course? Whatever we did till now, directly in business application stud
io? Yes, you can.
So there are two ways. One way is you can push these changes to Git and you can pu
ll it from Git. Another way is create a fresh project in the Bass and then just drag drop
these content there.
So let's choose option two. I don't want it to hamper anything with the existing one. I
'll create a new one in Bass.
So I'll go to Bass, I'll click on CAPM. Now I'll see exact same development environme
nt like Vs code. You're going to get that.
And the best part of this is you don't have to install any tooling like Node JS, like CDs
DK they all are pre installed. Bam. That's amazing.
Yes, all of them are pre installed for you, node JS is also installed. CDs DK is also insta
lled. Everything is pre installed.
You can cross check that. You can come and cross check. So now I don't want to crea
te a new project.
Make sure you are in user directory. When you start a terminal, you must open a fold
er and by default there will be a folder called Projects. You must open that.
You must open and go inside that folder. All the projects should be grouped under t
he Projects folder. That's the correct directory under which you should work always.
Okay, this is created by system. You see there are a lot of tutorials like create a CAPA
M bookshop application, CAPAM common application, CAPAM node orders applicati
on. There are a lot of good code samples here.
You can choose from. Yeah, nice. Now you can directly switch over to new terminal w
hich will launch a similar command prompt.
What we have in our local machine can double click. It will maximize yes. And now w
atch out.
I will create first a directory with the name called let's say twelve CAPAM. Yes. So mk
dir make a new directory.
Twelve CAPAM enter. You can see now a new project has been created. Let's move in
side the directory.
Twelve CAPM enter. You can do clear command to clear everything. It's a Linux mach
ine behind the scene.
And now we do a CDs init. I hope you all remember CDs init command. It will create
your CAPAM project.
Wow. Anubo yes. Next step is we install SQLite.
So we say NPM install SQLite, add the rate three save dev save it as a development d
ependency enter and you see SQLite is getting installed. Suman, this was your questi
on. You can see already.
I am able to do so. Okay, so you can see SQLite has been successfully installed. You c
an go and check package JSON and you can see SQLite three dev dependency has b
een.
Added. Okay, one more thing. Please remove this already added dependency and the
n add another one.
One more time. It will work fine. Okay, so make sure you go to package JSON and re
move that dependency which is given by system automatically.
You should remove that and then install again. Okay, now we can see if dependency
have come. No, it didn't come.
Here why it didn't come? It should come. Let me check. Okay.
Failed at install script. Something is wrong guys. With this guy it indeed is failing.
I think same issue you are facing also in your System suman when you're trying to do
this. Let me just check. This is new to me.
Okay. I just typed in SQLite. Three.
I didn't type SQLite. Add the rate three. Okay, so let's see you're unable to deploy ent
ities.
No problem, we'll check it. So now I've got Escalate three directly. Let me also add un
der the dev dependency, not under the main dependency because this is only used f
or development and testing in real world.
Typically most of the cap applications are built on Hana. We'll also see once we finish
this how to deploy on Hana our database artifact. Okay now typically you can see thi
s entry will already be there.
What you guys have to do is just say NPM install and that's it. System will install all th
e CDs dependencies, express dependencies and SQL dependencies in your Node mo
dules here. So see at the rate Sav module where you have CDs and then you can also
see all your files over here.
Yes, everything has got installed now properly. Nice. Let's move to the next step.
So now I will just bring my basic data model file. In fact we can grab everything. So it'
s fairly simple.
Just go to your computer where you have all these files. Let me copy Path and I go to
my computer and I will just go to DB folder. I'm going to copy everything.
Just drag it and drop it on DB folder in Bass. Done. Everything will get imported.
Wow, you are onboarded on Bass. Now, next step, you go back to the service folder
where we did something till now. Just grab that, drag it, drop it over SRV folder into t
he Bass.
Yes, done. Next step, let's do one thing. We will just do a CDs deploy command.
Let's do a CDs deploy. And this is why I think you are facing issue to Escalate and I'll s
ay unaboutdb. Okay, so now you see guys, while deploying we are getting an error.
This is an error in our recently created purchase order sum and purchase order gross
amount. It says it doesn't have a data type. Yeah, must have a data type.
Okay, this is a functional issue of our code. This is not a CAPM or Bass issue. So let m
e go to our data definition and in this we will just come down and just give a data ty
pe for these gross amount what we are computing for the total.
So this total gross amount what you are computing, you must give a data type for thi
s. So we can give decimal. Let's say 15 comma two or ten comma two is also good.
Same thing. You also do it for this guy. You didn't get this issue in local, but you're g
etting it in the bass with the latest version of SQLite.
So we also do it here. I'll save and let me give a try now one more time. I think this sh
ould be given below.
We're writing as PO. Sum. Yes.
Here we should give okay, let's give a try now. And I'll say CDs deploy voila. There yo
u go, Suman.
I hope now your issue will also resolve. Fantastic. Guys, guys, there is an amazing stuf
f here when it comes to bass.
It's an amazing tool actually. I love this tool. Why? Look at this database icon.
Click on this database icon. You can actually create a connection to SQLite in a graph
ical mode. Click on plus button.
We have abundance of table. And you see these database connections. You can add I
add SQLite with node and I will say connection name, anubao DB, anubhavdb, Anuba
SQL lite, whatever name you like.
You give a database file name. But how do I get now the path of my database file? S
o just type in the below section in the command prompt, type PWD print, working di
rectory. Okay.
PWD print, working directory. Just copy this path. Paste that on the top and type anu
bhav DB is my database name.
Click on Test Connection voila. My connection is successful. I will save this connectio
n.
And on the left side I will get a beautiful database connection to connect to my SQL
database. Yes. Wow.
Anubao. That's amazing. Look at that guys.
For all the views they are here. All the services and the views, they are here. And all th
e tables are here.
That's phenomenal. That's phenomenal, guys. That's the power of business.
Application, studio. Okay, just give me a moment guys. There's a lot of noise.
Just give me a moment. Okay, so now we are good. So you can see all your tables an
d you can even open these tables here.
That's what I love the most about the business application studio. It's a very much po
werful tool for SAP CAPM specific development. So I will go inside the products and
you can see all my data over here.
Yeah. Wow, that's awesome. You can save this to Excel sheet.
I guess download to CSV or JSON format. That's superb. You can write a queries.
You can test queries here. Say select star from my table name. Want to redable my pr
oduct table where product ID is like I want to do a pattern search.
Like let's say HT 10, nine, start. This is a pattern search. Let me execute this query.
How to execute? I don't know. Is there any button here? I think detach from no contr
ol enter no f eight no f five f six no I don't know how to execute this guy but there m
ust be a possibility to execute our query. So you click on plus here, write a new SQL ri
ght click and I think we can execute here.
Some option must be there attach connection to this file. So first we have to attach c
onnection to this file it gets attached and then I think we can run somehow refresh n
o refresh from CMD? No, CMD was already the old approach. I'm just showing in a gr
aphical way how we can run it but there must be a possibility, guys, to even run that.
Yeah, you can see it worked. It gave you the list of all those products which has patte
rn HT nine one. So what I did is click on this display button.
So whatever SQL session you are attached to that result, it will show on the right side
. You can go to query details. You can also see the query details.
So a lot of these things you can actually do play out with the tool. This is just a small
tool which is given by Business Application Studio which is pre installed in the Busine
ss Application Studio to connect to all of these kinds of databases which you have. Al
l right, let's move back to the code view.
Let me close these things. Okay, so that's how we now make our code work on Bass
guys, there is another very interesting thing which I love the most about Bas is this b
ottom you see this cap data model and Service Explorer. You can actually develop de
ploy tables, structures, views just the way you do in Se eleven more of a graphical mo
de.
So I open these cap models and services move it up and now you see data models A
nuba DB and I will now see here all my data models so I click on it. So these are my s
ervices. It's showing data models let me right click open with CDs graphical modeler
choose this option and watch out, it is still loading something is not sure but there is
a possibility to actually now add a table directly.
So click on plus button, give your table name let's say magic and now a magic table i
s created. You can click on plus button to add property let's say ID as a key of I woul
d say string or integer add and new I will choose name string 50 character add a new
assess salary decimal ten two currency string four add and close I've got my table cre
ated. Wow.
You can see that table will be automatically added over here at the bottom somewhe
re. Why is this guy giving me an error? I don't know but the magic table will now be
added over here you can see a table has been added yeah, so the code gets generat
ed automatically. When you work with the CDs graphical model you right click and sa
y open with graphical modeler.
Yes, all our tables are inside the context actually. So we have to I think open here con
text to see all our tables also in graphical mode. So I say expand all somewhere.
I think we can go to the yeah, these are our context. So I go to master context and w
ow, look at my tables guys, which we created in the last classes. Yeah, all this table in
a graphical mode.
I could have created them with the graphical mode but I love coding so that's why I c
reated them using code. You can actually come to this graphical modeler and in fact
build your entire tables and joins associations directly using this graphical tool. Yes, y
ou can see your context, common context, master transaction context.
So now all my transaction tables are here. All right, everybody clear how to work with
CDs modeler and database connector. Now if there are errors or there are violations
of best practices system is also going to give you errors.
You see, PO editor has no element called product ID. Why changed here is an eleme
nt actually it's giving a false warning. So don't ignore this false warning which are giv
en by Bass.
We are still good to go. Okay, so that is how we can onboard ourselves. Now, from n
ext class onwards, I will be only using business application studio for developing our
applications.
Okay? It's giving some errors here guys. I have to cross check what could be the right
solution for these warnings. These are false errors, false alarms actually I have to chec
k them and fix them up.
Yeah, I'll check the solution for these false alarms and I'll fix them up. And let me also
show you now pushing the code, it's fairly simple from Bass to GitHub, you can push
your code to GitHub. So I will create now a new repository where I can push my code
changes.
We can change the project name as well and push right? So I think yes, we have a re
name option for project. Yes, here it is. Yeah, so we have rename options.
So what I will do is I will actually save this project as a final project and for this I will c
reate a new repository which will be having only the CAPAM related developments.
What we will do in this training. Okay, so that is what I will do, I will create a new rep
ository.
So let me show you pushing to the GitHub, how easy it is. We go back, switch over to
GitHub and let me create a new GitHub repository, private repository for my organiza
tion. So I'm just pausing my screen and logging to my corporate GitHub account.
So we have a corporate GitHub account for ango trainings where we can create priva
te repositories and give you access. So this is a corporate account, I click on new and
I will create now here CAPM. So BTP training CAPM, BTP training CAPM.
And now I will choose it as a private. This option will be grid out if you're using a pub
lic GitHub account. Since I'm using and paying to GitHub a corporate price, then they
will enable this option to make it private.
Yes. Now I can click on add README file, click on create repository and this creates a
new branch and an empty repository. I will just go and click on this button here copy.
And I will come here and just set up the host. So let me first go to the terminal once
more and go to this directory within the git account. And then here I will say git in it.
Yes, I initialized a empty git repository and you can see all the changes are here in th
e git yes system is added. Let me also make sure that git ignore is there. So git ignor
e is a file which you will use to avoid pushing certain amount of changes to GitHub.
For example the node modules. Yes, you don't want to push them in GitHub. This is s
omething which we already discussed in the past.
So now I will just say git add dot and git commit m message. My first commit yes. An
d now it's asking me to configure first my username and email in the bass.
So let me do that. So I paste and my email ID is this is my corporate git ID for my cor
porate account and I will set my name. I did that and now I am going to do a push.
So let's do a git commit first. Yes, it's committed. Now you can see everything is com
mitted and you can see here all the changes are gone and it's time to do a push.
So we have to do set remote. Let me just check the command to set the remote repo
sitory for GitHub. I think the command is set remote only.
Let me just check for my local repository. I have to set the remote repository. So git r
emote add yes, that's a command to add a remote repository to tell where the chang
e will go on internet.
So I have to just use this git remote ad and then I will get my repository link and I pa
ste that here enter oops no guys, I think there is some other code. Git remote add an
d then we need to give an option also I think git remote or just git remote add is not
required. Just git remote is required.
I think it let's see the commands here. Git remote, add t branch origin, master remote
add master and the remote repository. Perfect.
And now we do a git push. So git remote, git push and then I have to give the name
of my branch actually. So git push master.
Okay, we have to first set the master branch as upstream branch. Okay. There are the
se commands which it is telling me constantly.
Let me do so. And now it's asking my git username. So let me give that and my pass
word of GitHub account.
It's not allowing me to do the push because there is already a README file which we
have inserted which is not yet downloaded to my local machine. Yes. So we will now j
ust remove this README file from our local and we will just get it from the internet fr
om the GitHub.
So let me also commit my change first locally so we'll not have a conflict. Git add, git
commit and then I will say git pull. Git pull is to get the latest changes downloaded fr
om internet git pull master and I will just get the changes from the internet.
So we will get the README file in our project. Now let me see if it has come. No, it di
dn't come.
Counting object total three out of three. Done. I don't know.
Let's try your git push now. Do I need to set every time the remote branch? I don't th
ink so. Let's give a try.
Fail to push. There's something wrong. Let me just go back and find the right comma
nds.
They will come when you create a new repository usually. No, I don't need to give UR
L every time. I don't need to.
I don't need to guys, the commands will come here, you see. Git add, git commit git
branch m this is the right command we have to use and then add the remote. Okay, l
et me just use this command.
Copy paste and then we will also set our remote branch. This one and it's git remote
ad origin yes, we did git remote ad master we should do git remote ad origin and th
en we have to just paste. Okay, now let me do a git pull.
Git pull origin master perfect. Refusing to merge. It's saying I don't know why.
Let's do a git push. After git add, we have to say git push u origin master so this is rej
ecting because our changes are not up to date from the internet branch. See non fast
forward.
It's not pulling actually. So I have to say git pull. There is no tracking information in th
e current branch.
Please specify which branch you want to merge with. So we have to say we want to
merge with origin master something is going wrong. It's unable to do the push.
I have to cross check this also and I will come back to you in the next class. There is s
omething wrong. I think we are messing up with the commands.
It's not doing it proper. Okay, there's some command which we messed up actually b
y creating our branch incorrectly. So this is why it's creating a problem.
I have to just check this and get you the right command sequence so that you will als
o be able to push and I will push these changes to the repository. Okay? And once a
gain, you guys have to send me your git names or maybe I will just do one thing. I'll t
ake the existing Git names which are added to current branches and I will move them
to the new git also.
So you all can check out this project. Any questions before we close today's lesson?
Anyone? ANov that decimal error, why it was not coming in vs code? Decimal error. I
don't know why it was not coming in Vs code.
Maybe it's because of Escalate version. Because here, if you see the version which we
are using for Escalate is lower version Escalite at the rate three we used. Yes, you see
three.
But on the bass, the version which we are using for Escalite is Escalate five. I only see
that could be the reason. Yeah, version incompatibility.
All right guys, this is Rakesh. One quick question. So is this the first session of CAPA
M anubhav? No, I think you guys are from different company joined it for the first ti
me.
Mukda rakesh NAN. Right. Okay, so let me tell you about the batch history.
By far, we have completed almost 32 classes. So they are already there on our trainin
g blog. So it's BTP training.
This is our training blog. You must have got the link already in the subscription email.
Yes, we have started this training like about a month ago, where we covered the basi
cs of what is CAPAM? Sorry? What is cloud foundry in general? What is BTP in genera
l? The very basic considering that you are absolute beginner in the cloud foundry in t
he BTP.
So these are all the chapters which we started with. You should cover actually at least
these two classes first. And after that you can directly jump if you want to learn CAPA
M, directly jump to this class where we started introduction CAPAM is not so far you
can cover up over the weekend.
CAPAM, we started here. Here. 28.
Yes. So 28, 29, 30 and 31 is what you missed by far for CAPAM. So today's lecture, yo
u might have understood very little because you missed out these lectures.
But still, my strong recommendation to also cover the node JS basics from here. So f
or you, if you directly want to jumpstart and start with CAPAM for your use cases in y
our company, then you would at least cover session number one. Session number tw
o, which is introduction session number three.
These three. And then jump to node JS basics which is session number 22, 23, 24 and
25. Yes, up to 25.
These are node JS basics which are mandatory for everyone to know. And then you j
ump to directly CAPAM unit number 28, 29, 31 and 32. It was today's lecture.
We don't have a class next two days you have time to cover this one of an hour lectu
re. I guess about eight to ten lectures maximum. So that you can also come parallel t
o this bath.
Okay, that's great. Thank you very much for that. Yes.
And I'm always available. So your company have also taken complimentary support h
ours. Yes.
So you can utilize those support hours, book an appointment with me and I will be p
resent one to one with your employees so that we all can discuss together if you guy
s are stuck anywhere. But this class is always open to ask questions at the end. So bas
ically, those hours we have taken for BTP side by side extension and mobile services
but anyway, that will we will also cover in this training the side by side extension scen
ario.
Amazing. Yes, we'll cover that. So I know I spoke to okay, 1 second.
Let me stop recording.

You might also like