Sunday, December 30, 2018

Structure of Business Objects in SAP Business ByDesign


 Business objects basically represent specific entities that are relevant to business. This could be something like a purchase order, a sales order; it could be an employee or an
account, generally a business partner. It could even be some type of activity. It's basically some entity that we want to represent within
the application itself.


Now business objects within SAP Business ByDesign contain what is called a number of
nodes, they contain actions, associations, different elements for each node, and this culmination of these items is basically what represents the object and the behavior that
that object has.


The framework that's in place provides all the typical
CRUD operations for us, to create, read, update, and delete. So we don't have to define these types of operations; the
framework automatically knows what to do with our business objects, and we can worry about the design of them and the specific behavior of that object.

There are many obviously standard objects that are delivered in SAP Business ByDesign. We have objects that we would create partner objects, sometimes called custom objects,
basically, something new that we have defined as developers within the SAP Cloud Applications
Studio.

To build our objects, we're going to use what's called BODL, the Business Object Definition
Language. This is the language that's in place to help us define the business objects and what these
different parts are, and it'll be slightly different than when we get date and time, whoever created it, who's responsible for that order. These types of details might be stored on the header level, or
the root of this object.

Now the object itself can have any structure of nodes you want. So there's always the root
node, but a root node will have sub-nodes, and those nodes could have sub-nodes of their own, etcetera, etcetera. And you can get as
complex as you want here.

For example in this purchase order, we have the purchase order root node and we have a
number of sub-nodes: Item, BuyerParty, SellerParty, and DeliveryTerms.
You can also see that the relationship, the cardinality of these nodes is in place as well.
So we'll have only one BuyerParty, SellerParty, or DeliveryTerms for the purchase order, but
we'll have one or more items as part of the purchase order. And so building up this type of structure will basically generate and create the business object
that we want.

You may have business objects that are very simple and only have a root node, you may have
some that are a lot more complex and have many nodes.
It depends on the use case and what the object is being used for.

Now every node itself will have elements. Elements are the attributes of that specific node.
Some type of data. So for a purchase order ID, you'll need an element on the root node that
represents purchase order ID.
 It could be as simple as a name of ID, or it could be purchase order ID itself.
00:04:02 When you're naming yours, try to use names that are relevant to what that actual element is.
You wouldn't need to say, let's say, item ID; maybe you just say ID because you know it's on the item node, same as just ID on the
purchase order, but maybe you have an external ID that's coming in that you want to specifically say external
order ID, something like that.


Now every element though will have a name and an associated data type: What kind of data
can be stored in this specific element.
Now there's a large number of data types that are available to us in the application. You can
use the link in this slide to see what all is possible, or in the Repository Explorer, which we'll see in a little bit. But to give an example, on the sales
order root node we have an ID, and that has a type BusinessTransactionDocumentID. This is a very common data type for IDs
within SAP Business ByDesign, you'll see it used a lot in standard objects. Also, for example, OrderedDateTime: This uses the
Global_DateTime data type. That way it gives us a general place to store a date and a time code associated with it.


Saturday, December 22, 2018

Customer-specific solutions in SAP Business ByDesign


Now let's go ahead and go into the studio, and we'll create our own customer-specific solution
that we will be ready to start development.

So you can log in to the SAP Cloud Applications Studio. In the left-hand part
is the My Solutions screen. These are all the solutions that exist on this tenant.

Let's go ahead and create one new solution here.

We are going to use this button at the top of the My Solutions part that says Create Solution.

And it gives me a screen here for some details for me to enter. What's the solutions type? You
can see there's Customer-Specific Solution and Solution Template.

For now, we're going to stick with a customer-specific solution. I can see what the customer is.
Now it's grayed out because this is considered a customer test tenant.

If I had a partner development tenant, I could develop solutions for any number of customers.
And I would have to say which customers I want to maintain or which customer am I building
this solution for.

And here, we don't have that, it's just a specific customer tenant, so we can continue on. I
would give it some type of description. Let's go ahead and say openSAP_DEMO.

And then a deployment unit. You see there's a large list of deployment units. We're going to go
ahead and select Customer Relationship Management for now.

We'll come back to what a deployment unit is in the next unit. For now, assume CRM. And
then I've some final details.

Basically, who's responsible for the solution. So now we can see that I'm responsible. Here's
my company here's my e-mail address, so that way if anybody wants to know anything they
can always come to contact me regarding this solution.

Let's go ahead and say OK. And now this is going to generate the solution for me.

So this solution is created by me and my user, but it's relevant and visible to all other
developers within this tenant. So that means if I have a colleague of mine that logs into the studio with their user, they would
also see the solution. They would be able to see any solutions that are created there, just like I
can.

There's no content that's developer-specific. So that means that any developer can log in to
the studio, and then they can go and maintain content with any solution. There are no restrictions
there.
If I have any kind of such restriction, I need to maintain and manage it myself with that other
a person or other people.

Now you can see that my solution is created. We have openSAP_DEMO, the name of the
solution that I gave it. You'll see there's this technical name: YOTWMM8, why?
00:07:13 This is the ID of my solution so to speak. You'll see this Y ID in a lot of different places going
forward,

And then on the right, you see, in the Solution Explorer, that it has the name as well there. It
says that it's in development, meaning I'm currently available to develop items and content
within a solution, and what content the solution currently has. Right now it's empty, so we don't have anything
but we will start maintaining it going forward.

One other thing that I want to mention about solutions in the studio is that every customer-specific solution that we use is specific only to itself and exclusive with its content.
That means that if I have more than one solution in a tenant – I have solution A and solution B
– the content of the two don't know each other that they exist, they cannot talk to each other.

So if I have a business object in solution A, I won't be able to directly use that business object
in solution B.

There's segregation between each solution that's there. This is a really important point when
it comes to developing.

You'll even see in the help content, it's recommended that you try to keep to one solution per
customer. This is just a recommendation, it's not a requirement, it's not a rule.

Really the reasoning is just that any content again that's built-in one solution cannot be reused
in another solution.

So this is something to keep in mind when you're building your solutions when you're
developing your content. It doesn't mean that you can't have more than one solution,

you very well may have different projects that will have no relevance to each other in the
future, in which case there's no reason not to use different solutions.

Really, the decision is up to you, and what you plan to do with this solution and the future of
that solution.

Solution Types in SAP BUSINESS ByDesign


What is a solution? A solution is really the package of development for the SAP
Cloud Applications Studio.


It'll have the collection of different development objects or artifacts that you will build and
create and maintain. And then we can use these to move this content to other tenants, whether it be a test or production, etc.
Now there are three types of solutions that we'll talk about. First one is a solution template,
the second is a customer-specific solution, and the third is a patch solution

Solution template. A solution template contains development objects that will be there for
reuse, meaning you can apply them to other solutions.


The development of a solution template would continue through different upgrades. So if you
have a solution template you can continue to maintain it through each release. And this content then can continue to be updated and deployed over and over again.

This means that if I have a customer-specific solution, I would take a solution template, I would
apply it to that customer-specific solution, and then I could continue to maintain the template, and keep applying it to the solution and keep the content updated in that customer-specific solution.

One restriction around solution templates is they cannot contain items, that requires what we
call “Admin Mode”.

This is things that consider analytics, forms, a few other items, which we'll see when they come
up. So this is something that I can develop on either my partner development tenant, on a
customer's test tenant, and I can apply it to any customer's specific solution. So I can reuse something ideally, something that I think I might use often or want to use more than once, I would put it in the
solution template. And then we'll need to further use it in the customer-specific solution.

Now, what is a customer-specific solution?
This is the main type of solution that we'll work within the Cloud Applications Studio.
A customer-specific solution is exactly that. It's a solution that's only for one particular
customer.


That means if I develop something for customer A, I cannot take that same customer-specific solution, and deploy it to customer B's tenant.

This type of reuse of a customer-specific solution is not allowed. If I have that type of scenario,
I would want to use a solution template, in which case I would develop as much as I possibly can in that template, and then I could
apply it to customer A's tenant as well as to customer's B's tenant.

So a customer-specific solution, it can contain any kind of content, including anything that
requires Admin Mode. And then I can apply that to a customer's production tenant or to other
test tenants.

One thing about these solutions is that we can only develop either in a partner development
tenant or in a customer's test tenant.

Now I would not be able to create new solutions in a customer's production tenant. We'll see a
little bit more about that when we get to the lifecycle.

But for now, we'll use a customer-specific solution in our test tenant.

The third type of solution is a patch solution. Now this still relates to a customer-specific
solution.
But a patch solution is after we've initially deployed the customer-specific solution, how do we
maintain it going forward?


A patch solution will be created off of any customer-specific solution, and then we would then
make our changes and updates within this patch solution

Help Content for SAP Business ByDesign


The different types of help content that are available in the studio are integrated and local. Now
what is integrated help?

Integrated help comes automatically when you install the studio itself. It's very easily
accessible and it never requires updating.


Why's that? When you go to the Help menu within the studio, you'll see some options up here. And the first one is the SAP Cloud Applications Studio Help. This is going to open an online
help page. So it's actually going to a help content that's already available online somewhere, it's always real time-updated, so any updates that are there, it's not local on your machine,
so you should have those updates, and it's very easy in the sense that you do not need to do anything extra to use this
help.
And this is the integrated help that's there in the studio. You can see there's lots of good
content in here. This is a very, very important page as a developer that you will reference often.

For example, let's look at Getting Started. I can see things about first steps, so how do I install
the studio? Here are all the details and things that we mentioned what are the
requirements, where do I go and how do I download? If I have trouble, who should I contact?

So you can see that if you do have issues downloading it, you can always contact
CloudSolutionPartner@sap.com.
Updating, there's also things like the user roles that we talked about. Also, how do I set up a
user?
There's also what's new within the studio, so in each release, obviously new content may come
out. And this will talk about what is new in each of those releases for you.

So very, very good content here in the help. We're going to look at this a lot because it shows
us code examples, what's the syntax for what we are doing, HowTos on some of these
different objects.

So this is the integrated help. Now if we go back, the other help content for us is the local help
content. Now, this is the same exact content, just a different way that we're going to access it. So this
also comes automatically when you install the studio, but you'll need to install the viewer that's
there. And that's specifically the Visual Studio Viewer to be able to view this content.

Now benefit of having it local, really a couple of benefits, one is that you can search for it. The
integrated help content online, you can't search directly for anything.

But with the local help content, you can search. So if you want to know elements specifically for
a business object, you can search for “element” and it'll help navigate you to the right place.

Also, this gives you context-sensitive F1 help. So if you're typing and you're wondering well,
when I define an element what do I do, you can actually click on the root element, then press
F1, and it's going to load the help content directly for an element.

So it can be really nice to have it local. It's updated every time you update your studio build
specifically, so it's always available to you there.

The local help content you can also find under Help, you'll see Help Content Installation, it'll
help you to install the actual Viewer if you need to, and then you'll have it available to you to view directly on your machine, so that's local, it's not
online but still the same content itself.
Now the online help, there's actually, you can very easily navigate to it if you go to help.sap.com.
So I'm here in the Help Portal. I'm going to go ahead to Cloud, and scroll down and let's look at
Software Development Kits (or SDKs) and the SAP Cloud Applications Studio.

Now, this great because it gives me a few different versions of the help. So I can see
specifically, a “What's new” section, the user resources – the majority of the help content  and some additional help areas that might not be specific help content but still can provide me
help in developing for the studio.

All of these, it gives me an online version, which is the integrated help we'd see. Also a print
version, which is a large PDF of all the help content.
So if you actually wanted to have a local copy or print it off somewhere, you'll be able to page
through and make notes, you could print the printed version, and have it locally for you in your
hand.

Now it also shows the help content for each of the past releases, so as each release goes on,
new help content will be posted here for you.
Now this is the bulk of the help that you use, you'll use this very extensively, but there are a
couple of other resources when it comes to helping that are really good.

Specifically one thing, the SAP Cloud Applications Studio page in SCN. So the SCN page is
very, very great. There are lots of great people on there, many good partners, customers, there's
SAP people, experts. And you can go on there, ask questions, look at blog posts, there are lots of HowTo videos that
people have posted for some of the different things that you can do in the studio. It's a very,
very good resource that's available to you.

You can access it either from the link there or, if we go to the studio, you can see there's
actually a link here: SAP Community Network Forum, which will bring you right to that page as
well in SCN. So it's a very great resource for looking at different things and getting feedback, bouncing
ideas off of other developers, very helpful. And the other help that you have is the book that's there. So there is a book that was published
a few years ago called SAP Business ByDesign Studio.



This has not been updated in a little bit, but it is a very good book! It talks in great detail about
the basics of the studio in most of the content that's there. And it can be really helpful in understanding, a lot of the deeper understanding in the studio,
really why certain things are built, and how really relates to building the different content, and
how they relate with each other.

So it's a great book, it's available on Amazon, the link's available here on the slide to you. I
recommend to go out and grab yourself a copy of that as well.
So this is really what help content is out there within the studio. Anything you need to do you
can find on one of these pages.

The help content itself, whether you use the integrated or local help, will give you details on
any functionality that's within the studio.
And then you can always go on the SCN page to look for more, expert advice or feedback from
other people. And then the book, like I said, will give you lots of real content.

User Setup In SAP Business ByDesign


Before we go creating a user, let's talk about roles. The typical user roles in relation to
SAP Business ByDesign and specifically the SAP Cloud Application Studio fall into one of 3 roles themselves. 

First is the developer role. 
As a developer, you are usually somebody who is creating and maintaining all of the typical content and development objects within the Cloud Studio itself. So that means you are creating new business objects, user interfaces, forms, web services, whatever it might be. 
They are really somebody who is doing the bulk of the work within the SAP Cloud Application Studio. 


Second, there is a studio administrator.
The administrator is someone who will usually create new solutions, delete solutions, can
maintain the lifecycles, so deploying them to another tenant. They also have the ability to maintain session locks. So as the developer develops on specific content, it will be checked
out for that developer. So an exclusive lock and then administrators can manage those locks.

The third one is someone who is not actually going to be in the Studio itself. It's a business
user. If you have been using SAP Business ByDesign, this is the type of user that you've been
using.

A business user is somebody who does not have access to the SAP Cloud Application Studio.
They are usually just using the front end, using the transaction UIs,
looking at reports, forms, etc. So we will use all of the 3 of these roles throughout the class.

The first 2 developer and administrator often times this is the same person. So you might have
it where many people are both the admin and the developer or you may choose to keep the administrative access only to a select few.
That's a choice that you will have to make for you, your team and your company.

We will use, users that are both admins and developers and then we will also use a separate
business user and the reason we are going to do that is we are going to use our business
users

For our testing and the developer user specifically for development. We won't mix the two
between. So we are going to keep a clear separation of the two because I never want to assign the Partner Development work center to a specific business user. It will be
specifically separate.



Well, there are a few things that we will need to do. First, we are going to go ahead and create a service agent. You could find this under business partner data or a couple other work centers that are available in SAP Business ByDesign and once we generate a new service agent, we
will want to click the request user action from there.

That will then provide a new entry the business user's Work Center View, under the
Application User Management work center. With this business user, we can now set their ID, set an initial password and then assign the proper access rights. The specific work centers that
we will need for someone who wants to use the SAP Cloud Application Studio are everything under the Business Analytics Work Center View or work center. They will need
a list of the views from Application User Management, which we will see in a little bit and then they are also going to need one or more views from the Partner Development work
center. Now the Partner and Development work center and its views are what really give
access to the Studio.

That's what really defines that the user is a Studio user and not, a developer or an
administrator. This is a work center that we should never assign to our business users within
the system.

Download and Installation of the SAP Cloud Applications Studio


The studio is version-dependent. That means that if I'm running SAP Business ByDesign
release 1811, I should also be using release 1811 of the SAP Cloud Applications Studio to do
my development

I wouldn't be able to, let's say, use release 1811 of SAP Business ByDesign in conjunction with
release 1808 of the SAP Cloud Applications Studio.

The content that we build though I will say is forward compatible. So that means that anything
that we build in 1808, would automatically be ready for 1811, and so forth.

Some commercial prerequisites: To be able to download from the SAP Service Marketplace,
you obviously have to have an S-user.

But more importantly, you have to have an authorized S-user to download the SAP Cloud
Applications Studio. How do you become authorized?

Well, you need to sign the correct contract, and then pay your associated fees, and then some
S-User at your company will become authorized.

You can manage your authorization as well by going to the SAP PartnerEdge Portal, so
sappartneredge.com

go to Partner Login -> My Partnership -> Manage My Partnership Application.


Technical prerequisites: You'll need to be running Microsoft Windows, specifically either XP,
Vista, or 7 and up

Now with this, we need this because we use Microsoft Visual Studio as our path or way of
doing development with the SAP Cloud Applications Studio.

So that means that it's technically not available on a Macintosh, or a Linux, or Unix – I
specifically, run a Mac but I also have Windows as a VM.

So you'll need Microsoft Windows to be able to install the studio itself.

Some other things that you'll need are that you'll need a Microsoft .NET Framework, you'll need
obviously Microsoft Visual Studio 2010 isolated shell.



If you already have Microsoft Studio, then you should be okay. And you also need Microsoft  Silverlight.

If you've already been using SAP Business ByDesign, you likely already have Silverlight
installed.

Now as you go and install the actual studio, it's going to do checks to make sure that you have
these things in place. And if not, it will help you in installing those different frameworks
correctly.

One last thing before we go into seeing where to download is updates. So every release in
itself will have a new version of the studio,

But even within a release, we have updates that come out. These updates will usually include
bug fixes, maybe minor changes, enhancements to documentation,

And you can want to make sure that you use the most recent updated version of the studio, so
you're getting the full benefit of it

Now you can always go back to the Service Marketplace to download those updates, or you
can also, within your SDK, the studio itself, be able to have it automatically check.

If you go into the Administration menu -> Options and Settings -> Updates, there's a place
where can say: “Check for updates”, and set some timeline when it should be continuously
checking.

We'll see this later when we get into the studio itself.

Okay, let's go ahead and look at the ... where to download. I am in the Service Marketplace
here.


I went to service.sap.com, and let's go to the SAP Support Portal.

In here, I'm going to look at Download Software – and you get logged in here, so it doesn't
keep asking for certificates.

OK, Download Software, and then we're going to use the search for software.

This is the easiest way to find it, I can go in and be able to search for “SAP Cloud Applications
Studio”. Let's go ahead and click Search.

And once this comes up, you'll see a list of the studio builds themselves in different releases.
So you can see there's builds back to 1302, 1305, etc. all the way up to 1811 where we are
today.

For us, we're going to be using 1811 currently, so I'm going to select my first result there and
say SAP CLOUD APP STUDIO 1811, # OS independent,

and then I'll add this to my download basket and download it.

Now once I go ahead and download this, it's going to give me a file that looks very much like
this.

You see it's an MSI file, and I can run this, and it'll go to actually try and install the studio. And here is where it'll check to make sure you have the proper frameworks in place, etc. And
once that's done, you should see a new icon on your desktop as well as a new menu for SAP
Cloud Applications Studio 1811.

Now I have it pinned down here on my taskbar since I use it quite often. And the first thing you'll see is that you get a login prompt here. I'm going to go ahead, we
need to be able to connect to a specific tenant to do our development,

Whether it's a test tenant, a production tenant to upload, whatever it might be.So we need to maintain the different tenants that we use. And we can do that, do this login just
by clicking on this pencil.And it's going to show us this Options menu. I can also get this by going to Administration and then Options from there. And the Connectivity tab will open up, and I'll see a list of entries.

Now you may have a lot of other entries in there, things that don't make sense. You can always
go ahead and just delete the one that is there.

I've gone ahead and added my own tenant, specifically that here, this is the test tenant that I
will be developing on throughout this course.

The important thing is that you give it a name, it could be any type of name you want. Keep it
descriptive for you as you may find that you'll have a large list of tenants that you develop on,
depending on what your scenario is. And then the hostname. And the hostname is the actual URL of your tenant. Notice to keep
out that I don't have HTTP or //, I've nothing after the .com

It's just a my3...sapbydesign.com.

After you have that, you may also want to check if you need a proxy. As I'm on a corporate
network, I need a proxy as well.

Then I'm going to go ahead and hit Save after I've made all my changes, and say OK.And now I actually have the studio ready, and I can start developing