Sunteți pe pagina 1din 16

openSAP Introduction to Software Development on SAP HANA

This document contains a transcript of an openSAP video lecture. It is provided without claim of reliability. If in doubt, refer to the original recording on https://open.sap.com/.

WEEK 6, UNIT 1 00:00:13 Welcome to week six of the Introduction to Software Development on SAP HANA course. Now this week is a little bit shorter than the other weeks, primarily because we wanted you to have time to prepare for the exam, yet it still contains many important topics as well as a wrap-up of everything weve seen so far. In this first unit, lets talk about lifecycle management with SAP HANA. Now weve made a couple of comments about lifecycle management and delivery units, sort of preparing you for this topic, but in this unit we will see really how it all comes together, how we can deliver content into other systems, whether thats another system in our own landscapesuch as moving from a development to a QA to a productionor whether thats acting as a vendor and delivering content to your customers. So lets begin by talking about lifecycle management in general. All the lifecycle management capabilities for SAP HANA are really built into HANA either through parts of the HANA studio or on the HANA server itself. Of course, on the HANA server itself we have the content repository. Weve already seen extensively in this course how we use the content repository to store design-time artifacts that then generate runtime artifacts, such as the hdbtable content repository artifact that in return generates a table within a catalog schema. Well, this same repository is used for the source code management, the version management, but also the overall lifecycle management, so really the total management of software releases as well. Theres a specialized tool built into HANA called SUM for SAP HANA. This is your software update manager. This is the tool that helps you import whole new support packages and revisions into your HANA system, but also to take additional software packages and install them into SAP HANA. So we have some optional software packages, like the ENA search services or the DXC, the Direct Extractor Connection. These are shipped from SAP as delivery units and are imported via the SUM for HANA, and the tools were going to show you here, in the same way that you would move content from any other HANA system into your HANA system. So the lifecycle management built into SAP HANA is responsible for all the version control, even of these external objects that are imported. It manages the whole product development lifecycle, as weve seen extensively in this course, and it lets you monitor all the software and application packages that are installed on to your system. So the main unit of work that we deal with when we talk about lifecycle management is the delivery unit. And weve mentioned this a couple of times. Weve mentioned how you want to create objects within packages because eventually well be able to transport those packages and their content as a delivery unit. So in its most fundamental form the delivery unit is the transport medium to be able to move content from one HANA system to another. But it also is very much like an application because a single delivery unit can have both versions and patch levels. Particularly when you get a delivery unit from SAP, it really represents an application that can be installed onto your HANA system. Now the delivery unit is really a collection of packages, and its through the package assignment that we get the

00:00:33

00:01:05

00:01:53

00:02:21

00:02:38

00:03:01

00:03:28

00:03:56

00:04:18

00:05:00

00:05:15

00:05:56

00:06:24

00:06:38

00:07:13

00:07:39

00:08:16

00:08:52

individual development units into a delivery unit. So theres no way to assign any sort of artifact to a delivery unit without first assigning it to a package. You see here the delivery unit maintenance screen. On the top part of the screen you see all the delivery units that are installed in a particular HANA system and when you select one delivery unit, you see all the packages that are assigned to that delivery unit. We only have the option to add and remove packages, so everything is done at the package level. Then when we export or import the delivery unit, what we get is a zip file and .tfz file. Literally, this file can be opened from your file system using any sort of regular zip archive tool. And you can open it and see the contents. The contents are stored in a textual format, although with some additional header information, so its nothing that youd want to alter directly. You never want to change the delivery unit file itself, but you can look inside a delivery unit file and look at the content, so its not a proprietary or binary format. Now the delivery unit definition requires that you set up a few things. You have to give each delivery unit a name. We have to assign a vendor ID. Ill talk more about that in a second and show you where we go into the system and assign a vendor ID. So your HANA system will have one vendor ID, and every delivery unit you create in that system will automatically have the vendor ID attached to it. Then you also have to maintain a responsible owner and a version number, and this is really just is textual information. Its up to you what you want to put in there. You can see various options that we use inside of SAP. Sometimes well put the individual team that created the content. Sometimes itll say SAP. But you will notice almost all of the vendors, in this case, is SAP.com. Everything that comes from SAP to customers or partners should be the SAP.com vendor. So when you maintain the delivery unit, when you create a new delivery unit, you first have to assign the vendor. But really you dont assign it; it will automatically look up the vendor that youve maintained in the system. And you should absolutely maintain your vendor ID because this then gets assigned to the delivery unit and all the packages that are assigned to the delivery unit so you should really put yourcompany.com as the vendor ID for your content. And then you see there's simply input fields to directly maintain the responsible party, the versions for package, the patch version. These are all just textual fields and theres no validation on them, so you can input whatever you want. So at this point let me go into the system, let me show you where you maintain that vendor ID. So if I go into the Administration tool and then I go to Configuration and then to indexserver.ini and then under repository, you have content_vendor. And Ive maintained SAP.com on this system because its an SAP internal system. Now when you want to create a delivery unit, what you generally do is go to the Modeler tool and get this quick launch. Now when you have this quick launch tool, make sure youre logged on to the right system and the right user ID so when it first launches its attached to a particular system, but not necessarily the first one on your list. You may have to say Select System and choose the one you want from your list. Now at this point I want to create a new delivery unit, so Ill just say Setup>Delivery Units. And this brings up a dialog that shows me all the delivery units that are currently installed in this system. And then as I said, for each delivery unit I can then click on the delivery unit and I see the list of packages and I can say Add package and I can add additional packages to it. Whats nice is that I can choose one root level package and then say Select all sub-packages and then assign everything underneath that hierarchy to this delivery unit. Now the other thing that I can do from the screen is I can create new delivery units. I could come in here and I could say OPENSAP_DEMO and its already pulled in my vendor ID from when I configured my system. And Ill just say Course Instructor, version 1, support package 0. I really dont have to fill in any of the rest of these. Some of these are SAP-internal fields which you will not use. So Ill go ahead and say OK and I have no packages assigned. At this point I could come in here and maybe I take my working package that I have here in sessiona.00 and go ahead and

Page 2

Copyright/Trademark

00:09:06

00:09:38

00:10:33

00:11:03

00:11:44

00:12:08

00:12:50

00:13:03

00:13:24

00:13:46

assign all the content to it. Now the other thing that I could have done is that I could also come to...once Ive created a delivery unit, maybe Ive created it but I havent yet created the packages, so I can't assign them at that time. I could instead go into the Content view in the SAP HANA Systems and go to my particular package and right mouse click on a package. And I should be able to edit. When you create a new package, for instance, I could also maintain the delivery unit at this level. For instance, I could reassign this package to a different delivery unit. But the drawback is that this doesnt have any options to automatically pull in all sub-packages. I have a tendency to sort of ignore the delivery unit maintenance at the individual package level. Otherwise youre going down through the entire package hierarchy and having to maintain them over and over again. I prefer to go into the delivery unit. Even if I would create a couple of new packages in this hierarchy I would just come here to the delivery units and I would add them according to the hierarchy level in this tool. I find that to be much easier. Now, switching back to our slides, this just shows some of the same content, what we just discussed. Of course you have the root package level and thats got the SAP folder in it. Automatically, thats restricted. You, as a customer or partner should never create content in the SAP root package, you should always create your own root package for your own company. Wed recommend that you use your company name as your root package. Weve used workshop in this case to keep it out of the SAP hierarchy, but that gives you some idea of where you would create your content in the root package. And then you would create your packages, your delivery units, your applications according to whatever hierarchy works best for you. I mean we have a naming standard that we follow inside of SAP. You see this a little bit if you go under SAP. Theres an SAP HANA and then inside there we have XS and then we have some sub-folders for various pieces of functionality thats delivered as part of the core XS. And youll see this pattern repeated in other applications, other application areas, but all under the SAP root package. Now, the process to export and import the delivery unit. The export process is pretty simple. You choose File>Export and then you choose Delivery Unit from the first menu that comes up. You have the option to either export it as a file to the file system, or to save it as a local file on your client machine, or to place it into an ABAP transport. So the ABAP transport option is just there for those of you whos HANA systems are also integrated with the Business Suite or ABAP-based technologies, and then you can write your HANA delivery unit into an existing ABAP transport. So you can use the CTS+ functionality. If you aren't familiar with the ABAP world or CTS+, dont worry about it. That functionality is there for those who do know about that and who do want that functionality. Usually in a HANA standalone scenario, well simply export the file to the HANA server and then move that file physically to the target server, and then well do an import. The export process itself will choose the delivery unit we want to export. Well see our list of packages and then youll have your options that you see here: Export to Server, Export to Client, or Add to a Transport Request. The other thing that we have here, we do have this Filter by Time option, but you have to be very careful with how you use the Filter by Time. If you use the Filter by Time, you put in a start and end time and well only insert into the exported delivery unit file the development objects that were changed or created during that time. But there is no automatic change recording. Theres nothing in the system that tells you what times to choose. Its possible that if you would use this mechanism and you left gaps in your time intervalssay you exported every day but there was some gapyou could be missing development objects. So theres no guarantee that youll get all change development objects unless youre really good at keeping track of your time. So we strongly recommend that for now, until we have object level change tracking for export of the delivery units, that you export the complete delivery unit each time, which is the default

Page 3

Copyright/Trademark

00:14:01

00:14:39 00:14:48

00:05:18

00:15:38

00:16:07

00:16:21

00:17:07

00:17:27

00:18:10

00:18:25

00:18:52

option. And then the import process is very similar. You say File>Import. You tell the dialogue whether to read the file from the server or from your client PC. And then theres a couple of options should you want to overwrite inactive versions that already exist on the system. So if somebody was in the middle of developing something and theres a new object coming in and you want to overwrite what theyve been working on and sometimes thats perfectly fine if youve been editing an object and youre just importing from another system, maybe thats keeping things in sync. Or maybe you want to say No, dont overwrite any inactive versions; I dont want to lose something that Im currently working on. Then theres an option to Activate objects. So if you wouldnt choose this and everything would be brought in it would be inactive and youd still have to mass activate all the objects. Then theres an option to bypass the client-side validation roles and only use the server-side validation roles. It will take a few seconds on the import. The system will do a scan and even before you start the import it will give you a proposal of what it thinks will happen. It will do this import simulation and it will tell you if you have any objects that will fail or any objects that will produce warnings. You have a chance to go back to the source system and correct those problems before you actually perform the import. So lets go back to my system now and lets show you this process. Its really quite simple. Well do File>Export and then under SAP HANA Content well choose Delivery Unit. Say Next and we choose which system and which user ID we want to use to do the export. Ill go ahead and use my system user. Ill choose my delivery unit, so lets do my OPENSAP_DEMO. We see a preview of all the packages which its going to place in this export, and Ill go ahead and say Export to Client, and Ill have to browse and find a file location to store this in. Lets just put this in the C: drive and lets just put it in my hdbstudio. Ill say Next, just confirming that these are the options that we want. Ill say Finish and youll see that its running right here, down in this window. Its actually completed already. It doesnt take very long for one of these to run. So lets just bring up a file explorer and look at the file. Youll notice that it shows up as an archive file, a zip file. I can open this with a standard zip tool. And inside here you can get a little feel for what the contents look like. Theres some header information, some organization information. But pretty quickly you see your list of packages that are contained in here, so if we look at this package-infos itll show us all the packages in this file. Well just look at this in Notepad. So we see the list of all the sub-packages contained in this delivery unit. And lets go up and we can see our list of all objects organized into packages. So maybe we want to look at data, and then theres a folder for each of the extensions. So if we want to look at our hdbroles, theres our workshop user role. And lets just go ahead and look at this one in Notepad. You see it puts a little bit of header information onto the front of this, so this would all be header information added as part of the delivery unit. Like I said, youd never want to edit this directly, but if you did want to look at the content before you imported it, it is possible to see the source code and make it out pretty well. Like I said, you definitely would not want to edit it as theres control information in here for viewing. I know some teams inside of SAP will even check the delivery units into a source code repository, and do version management, do diffs, between different versions of the delivery unit because it is, at its heart, a textual format. So thats the export process. Now lets import this in. This shouldnt be too impressive because were going to import it right back into the same system that we exported it from. Hopefully this shouldnt give us any problems, but I can at least show you the process. So Ill say Import>SAP HANA Content>Delivery Unit, tell it which system I want to import into. Get the file from the client so lets browse, hdb studio, theres our exported file. Its done a simulation already on this. Looks like all green check marks, which is what I would expect as were importing it right back into the system we just exported it from. Ill say Finish. The import is off and running. This will take slightly longer than the export did

Page 4

Copyright/Trademark

00:19:17 00:19:27

because it actually has to do activation on all the objects, but you see it did not take terribly long. It is completed, it is completed successfully. We do have a log here. If there had been any errors we could come in here and we could see the errors. We could say just show me errors of which there were none, thank goodness. But if we want to narrow it down to only show errors, if there were any errors it would tell us pretty well, we would get the activation messages as if we activated it manually. So in this unit weve shown you the basic lifecycle management capabilities of SAP HANA and weve seen how to both set up delivery units and to import and export them. So youre all prepared, particularly if youve been following along and creating content in your HANA system, following along with this openSAP course. You have the ability to export all of that content as a delivery unit and save it for the future now.

Page 5

Copyright/Trademark

WEEK 6, UNIT 2 00:00:13 This is week six, unit two: SAP HANA UI Integration Services. In previous weeks, weve already seen how you can build user interfaces using SAPUI5 or other HTML5based tools. But in this unit we want to introduce you to an additional UI development tool called SAP HANA UI Integration Services. 00:00:36 Now this tool does not replace SAPUI5. In fact, it uses the same UI5 rendering libraries and capabilities. The SAP UI Integration Services is a higher-level user interface design tool. It also allows you to take widgets and arrange them together into a page, so its a bit of a lightweight portal-building application if you will. 00:01:03 It allows you, as an application developer, to focus on the user interface of your particular application, exactly what you want it to do, without having to worry about how it will fit in to a larger overall framework of, say, navigation with multiple tabs and things like that. 00:01:20 So the idea is that weve shipped this UI Integration Services as a standard part of SAP HANA now. It is integrated into HANA. As I said it allows you as an application developer to really focus on the UI part for your application without having to worry about all the plumbing and the overhead and all the interconnectivity between your little panel with your input fields and maybe another panel that you want to reuse. 00:01:53 So we give you this option. Now, an important thing to note is this shipped with HANA SP5 Revision 47 but it is shipped as non-automatic content, which means that it is not automatically installed into your system. You do have to go in using the techniques we learned in the previous unit and import it as a delivery unit. 00:02:14 The delivery unit is sitting on the file system of your HANA system already. All HANA systems as of SP5 Revision 47 have it sitting there but its not imported into the database. So you do have to go to the delivery unit and say File>Import and say From Server and youll see it already in your list of files that can already be imported. 00:02:38 Now when it imports it installs basically, an XS application, so thats where the core REST-based services would reside. It also installs some additional database tables and some stored procedures in those tables that will persist in the configuration that you create for your pages, which we call application sites. 00:03:04 And it also installs additional repository plug-ins on the server side so it know how to activate some new development artifacts. And it installs some additional plug-ins as part of SAP HANA studio. So there is some dedicated development tools, as youll see in the studio. And just like SAPUI5 all the presentation logic is executed on the client side. It is using the SAP UI libraries. Its designed that the inner content that runs inside the UI integration services would also be SAPUI5. So it builds on top of everything weve already learned about user interface technology and just gives us another layer, another capability on top of everything we already know how to do. 00:03:53 So the core features of SAP HANA UI Integration Services. First and foremost, it is a pagebuilding tool. So it has a state of the art design environment for application layout and content arrangement. Well see this when I do the exercise in the system, but basically it runs in a Web browser, we have our library of all of our UI widgets that you can just drag and drop into the page and resize them to however you want and wherever you want on the page. 00:04:24 The other thing that it does, is it does property persistence and customization. So inside a widget you can define properties that get persisted for that instance of that widget and the user can come in and customize. So maybe you expose a property like, whats the default currency you want displayed? The end user then goes in as he runs the user interface and says I always want to see euros, and thats persisted into the server for that user ID. Every time they run that application it will automatically reload that users customization. 00:05:01 We also have property personalization. So widgets can define properties and these properties are also persisted on a user level, so those might be set by some activity in the application as opposed to being set interactively by the end user, which would be customization. 00:05:19 We also have a Publish and Subscribe model for communication events that can go between

Page 6

Copyright/Trademark

00:05:45

00:06:19

00:06:41

00:07:02

00:07:27

00:07:45

00:08:02

00:08:44 00:08:56

00:09:18

00:09:44

00:10:02

widgets on a page. So you can design your widget and another designer can be designing their widget and you dont have to know that much about each other. You just have to know which events each expose, and you could register for those events and all the communication happens on the client side within a JavaScript eventing framework. And then finally widgets can have a context. This is data that can be shared between widgets. It is also reflected into the URL, so it allows for parts of the context, because it's part of the URL, to be also part of the bookmark. If you save a favorite for your Web site, that data can be saved into it. Or if you cut and paste that URL and send it to somebody via e-mail, then you have a sharing mechanism which also sends that data along with the base URL to the page. So the main benefits for you as application developers is that it allows you to quickly build and reuse application components that conform to the UI Integration Services widget pattern. So you can take your existing knowledge about SAPUI5, and its not that difficult to take an SAPUI5 application and turn it into a widget. And this allows you to design the overall flow of the application quickly and easily, and to also change the flow of the application without disrupting the coding of the inner UI blocks, the widgets. And of all of this arrangement of the overall design of the application is all done in a Web browser using the application site designer. So its even something that maybe you dont have to do yourself as a designer, but could give the end user to do. Not the end end user but maybe a functional person, a business process expert, something like that. The person specifying what the user interface should be, you build their widgets with all the interconnected framework and communication framework and they only have to drag and drop them and arrange them in this screen as they want them. All this is done via the HANA studio, and all the artifacts are stored in the HANA content repository like all the other development artifacts weve seen. And theyll be transported with the delivery unit, so this follows the same lifecycle management capabilities weve seen with everything else. This allows the end user to have personalization and customization built in and you dont have to program the frameworks to be able to do that. You dont have to create the tables to persist the data in. This is all handled by the UI Integration Services framework. And then finally, this also allows easy customer and partner extensibility of SAP-delivered applications or customer extensibility to even partner-delivered applications. So SAP can deliver the widgets and then the customer can decide well, I want an additional widget. So they can create the widget in their own application namespace. They can add it to the existing application site, and it doesnt change or break the SAP code. The eventing is done on the client side with JavaScript so its not like you have to get in and change the SAP widgets to be able to move data around, so it really lends itself very well to customer and partner extensibility. And then finally, it lets you as the developer really focus on the application logic and the core application UI without having to deal with all the framework stuff. So a couple of pieces of terminology. We have to create a widget. This is the main design-time object that will take any existing HTML page and expose it to the catalog of the application site so it's able to then be embedded inside the HANA UI Integration Services application site. Now for every widget we need a widget specification XML file. Now this file either has the complete HTML of a page or it has a relative URL pointing to that page on the HANA server. This is how we can either take an existing application and run it and make it a widget, or we can literally just code the whole HTML inside the widget specification XML. And finally we have an application site. So this is the main page. This generates the URL for this application. Its also the design-time artifact that we choose to edit and it will bring up the Web browser-based design tool. Once were in the design tool, on the left-hand side we see a preview of the page weve built up so far. We can add additional pages and subpages to this, so we can build up our navigation hierarchy and then we see our widget library, and we simply drag and drop widgets from the widget library onto the page. We immediately see them render exactly as they would look in the

Page 7

Copyright/Trademark

00:10:34

00:10:55 00:11:05

00:11:42

00:12:39

00:13:10

00:13:31

00:14:05

00:14:34

00:15:04

00:15:42

00:16:09

final application site. Even the inner widget content will render in place and be fully functional, so you can test your application site from inside the site designer. We then activate the site. Every time we make a change it sort of auto-saves into the repository. We go back to the HANA studio and activate the site. There are a couple of site properties that will show us who created it, when was it last changed, and so forth. And then finally with our APIs to allow programmatic communication between the various widgets and to customize the widget properties. Ill show you an example of this in the system. I think at this point its a good time to go into the system. And what Ive done is that Ive created another folder called uis inside our existing package. At this point I want to start by creating a new widget specification file. So Im just going to say File>New>Other. And there are wizards for all of these, so Im going to start here with the widget itself. Actually lets back up here. Im going to start with the widget specification file and say New>file and Im just going to say widget1.xml. This is my widget specification file and Ive got this already prepared, so Im just going to cut and paste it. So I go back to HANA studio and theres not a whole lot to this. We do have to define...we have module preferences, this is where Im just giving it a title and then we have some content. That would be that were going to embed HTML in here. The other option would be to create a widget specification file that points to a relative URL, I will show you that example in just a minute. First lets start with the simple example. This may look familiar. This is our basic SAPUI5 example with the Hello World button. That disappeared when we pressed that button. Were going to turn that into a widget by cutting and pasting the XML directly in here. Save this and Im using the standard Eclipse XML editor here, which allows you to either edit things in this form-based design editor or go and look at the source. So this is going back to some of the earlier discussions about the benefits of using standard Eclipse-based tools and this approach with the team provider. This is another example where were able to use the standard Eclipse XML editor. We didnt have to create a specialized editor for this specification XML; its a pure XML file. So that is saved, lets go ahead and activate that. Now we can create the widget itself, so Ill do New>Other and here Ill say Widget, Next, and Ill have to give it a file name. Just call this widget1 as well, and notice that it adds .xswidget as the file extension automatically. Then I have to point it to my specification file. So Im going to go into my project, uis, and point it to that XML file. And we can put in some additional information here, openSAP Sample, and if you want to add a little thumbnail image thats what will show up in the widget library, you can add that here as well. Im just going to leave it with the title and the description and well get the standard thumbnail. Now Ill go ahead and activate this. If we were to look at this directly its a simple little JSON notation file and basically the options it pulled up in the little wizard: the name of the file, the spec URLthis just points us to the path for the XML fileand the description and the icon. You can also maintain the content directly in the .xswidget file after the fact. The final artifact that I need to create is the application site itself. So Ill say New>Other and then Ill choose Application Site and lets give it a name here: appsite1. Notice it adds .xsappsite as the file extension and well name this openSAP and openSAP Demo. Ill say Finish. Lets commit this to the repository. Now that this is committed I can go ahead and double-click on it. Unlike all the other artifacts, this does not open in place in SAP studio; it launches in a Web browser. So I will go ahead and login here and we see the basic empty site designer tool. We have the ability to come in here and add additional pages. Maybe Ill add a second page here called...Ill get really creative and call it Second Page. You can add multiple pages to this hierarchy. You have the ability to change the layout settings. Right now that mostly impacts the navigation bar, so we can choose a Full navigation, a Narrow navigation, just the Headerbut then you cant have more than one tabor None, and also there you cant have more than one tab.

Page 8

Copyright/Trademark

00:16:38 So lets go back to the Full and I can acknowledge these now and change them all back. And now I can go to the Widgets library and I have the ability to see all the widgets in the system or I can narrow this down to a particular package. 00:17:06 And there I see my widget. I drag and drop it on to the page and give it a second and it will render. I have the ability to resize to whatever size I want. There are other properties here. I can Rename it, Remove it, Display the frame area around it. I can also make it go full screen or not full screen, which means Im resizing it exactly right here in my window. Basically, once I get it the way I want it then I can go to the Site Properties. And I would see my user name as the last user, but I can also go back here to the HANA studio and I can now activate this. 00:18:08 And lets just go back here and refresh our application page...there we are. I did not pull in my widget, so lets add my widget again. And of course we have the full URL, this would be the URL you would give to someone to run the site. And if it didnt pull in my widget, I would have to go and activate it again for it to persist my widget, but you do see the two pages added here as well. 00:18:50 Lets actually go and look at another sample that I have already prepared, and this is a little more complex. Remember the whole Purchase Order Worklist that we had, that has the search capabilities, the reports, the purchase order header and item table. 00:19:12 Well what we want to do is create a version of this running in SAP HANA UI Integration Services. So I look down here in this other project Ive prepared. Ive first broken up that one monolithic SAPUI5 application into several separate applications. Ive got the report, Ive got the search, the table and the tabs as four different HTML pages. 00:19:36 And it wasnt too terribly difficult to do and they were already modeled view controller. I just broke up the individual view controllers into separate applications and then I created XML specification files for each of these HTMLs. And instead of embedding the HTML into the XML specification, I gave it the absolute path URL from this server for finding that HTML page. 00:20:08 And then each of these specification XML files has a widget so theyre now all exposed to the widget library. And we have one new application site. So Ill go ahead and launch this application site. 00:20:30 And here youll see in just a second, even though Im in the design tool, this really does work. I can come in here and type in the search and get just the records from Santa Fe. And you notice that the Purchase Order Worklist refreshes, even though these are no longer one application. Theyve been separated out and theyre doing their events. The fact that I triggered an event here thats now just using the publish/subscribe model and its triggering a JavaScript notification so that the Purchase Order Worklist knows about that change. The same thing here. If I select an item, then the Purchase Order Details knows about that change and displays the correct one. 00:21:11 We can also personalize the Group By criteria here as well. This was all built the same way and obviously the sizing could be a bit better. I put this together quickly just to demonstrate from an existing application how you can technically break it up and then reassemble it as separate widgets. I would probably, if I were really building this application, I would do a little redesign so that it looked a little nicer, but you get the general idea. 00:21:41 I can run this now as a standalone application without the design tool and you see all the same capabilities here, all the events between the various widgets. And the APIs are all JavaScriptbased, so they're very easy to integrate into SAPUI5 and it was easy to take the existing event handlers, make just a couple of changes, so instead of directly calling the controller of another object to give it an event, it simply publishes the other event and the other controller listens and subscribes to that event. So it was only a couple of lines of code change to adapt the existing SAPUI5 application to run inside the UI Integration Services site. 00:22:30 So in this unit weve given you an introduction to the UI Integration Services. Showed you a little of the value of utilizing this to build the overall framework and allowed you, as the application developer to focus on the core user interface of your particular application and not have to worry about the overall site that its embedded within.

Page 9

Copyright/Trademark

WEEK 6, UNIT 3 00:00:13 This is week six, unit three: Wrap-Up. In this, our final unit together, well look back at many of the high-level topics weve discussed and well also see a demo of an application that puts together many of the development techniques that weve gone through as well. 00:00:30 So just to review, HANA applications are architected a little differently than your traditional application. We do more of the processing logic down in the database in order to take advantage of the many benefits of SAP HANA in-memory processing, the massively parallel processing, and if we do that and at the same time we also embrace client-side user interface and push all the presentation logic to the client side in the form of JavaScript HTML5, that leaves a very thin layer in the middle that is yet unserved. This control flow layer, or service enablement layer, thats what would be left over for a traditional application server. And this is where SAP has decided to build a lightweight application server called HANA Extended Application Services and embed it directly inside of the database itself. 00:01:25 And this really controls the core tenets of the development paradigms weve talked about here, either data-intensive logic in the form of SQL views and SQLScript being this calculation logic thats deeply down inside the database, our SAPUI5 and UI Integration Services, which renders completely on the client being our presentation logic, and then our OData services and our custom server-side JavaScript being the control flow and the lightweight imperative logic layer that sits in HANA Extended Application Services. 00:02:01 And once again, to reiterate: traditional model versus the HANA model. In the traditional model we had a large application server and we did most of our programming and most of our logic executed at the application server layer. 00:02:17 This meant going and retrieving large amounts of data from the database, bringing it back to the application server layer, and doing the processing there. Or even if we were using highly optimized SQL statements, if often meant we needed to bring together multiple results sets from different SQL statements. The only way to do that was to bring them back the application server. 00:02:38 So we increased the processing load on the application server. We increased the need of the memory size of the application server layer, and it really became the focus of our programming model and also the way we tuned the system as well. 00:02:53 Now we compare that to the HANA approach where we take the code to the data and instead of moving the data to the code. And we write more of our logic down in the database, even if this just means using SQLScript, so when you have multiple result sets they can be chained together and processed inside your SQLScript procedure so the data transfer doesnt have to go back and forth between the database layer and application server layer. 00:03:19 And we try to minimize that result set that we finally do transfer up to the application server layer as much as possible. We want to do our sorting, our filtering, group by, our WHERE conditions and as weve seen even, our unit-of-measurement conversions and currency conversions and other types of business logic down in this database layer. And only if you follow this approach will you be able to really maximize your investment in SAP HANA. 00:03:46 Just looking at the programming model, the XS programming model, once again remember as weve said several times, completely client-side UI rendering. This is our SAPUI5 and our UI Integration Services, all HTML and JavaScript. 00:04:06 And then down inside the database our data-oriented application logic, our data-intensive logic, and here we primarily write in SQL views and SQLScript. Then the programming languages at the XS layer, this is where we put our lightweight procedural logic. We have our server-side JavaScript, we have the built-in OData service generation, other built-in service frameworks in there as well. So this is our application server and this is our Web server. So we have our complete development environment inside our HANA studio, we have our complete deployment to our HANA instance, so it does everything that we need it to do in this case, it has the complete application lifecycle. 00:04:52 Looking in detail as a refresher once again, when the client connects to the HANA system over HTTP or HTTPS, theyre communicating with a process on the operating system level known as

Page 10

Copyright/Trademark

00:05:11

00:05:39

00:06:07

00:06:27

00:06:42

00:07:07

00:07:53

00:08:39

00:09:30

00:09:51

00:10:17

the ICM, thats the Internet Communication Manager, and that is the Web server for HANA. This process, in turn, talks to the XS Engine process, the SAP HANA Extended Application Services, which serves the purpose of being the lightweight applications server. And then this XS Engine process communicates with the index server, the index server being the real heart of the HANA database where the memory for the in-memory store is actually allocated to this process. Theres a very special relationship between the XS Engine and the index server process. The XS Engine is an extended version of the index server. All the code thats in the index server is in the XS Engine. The XS Engine can really think of itself as an index server; it understands how the index server processes and therefore its able to pre-process SQL requests before it even sends them to the index server. So this is part of the advantage that the XS Engine has, as opposed to other application servers that have to be completely disconnected, they have to use open interfaces to communicate to the database server, which is good, but always means having to move data across the network. It means that they have to do data transformations on the data. The XS Engine process understands the HANA native data types because it is, in essence, an index server. It understands what the index server does and we have very efficient interprocess communication between these two processes at the operating system level. So these are some of the low-level technical advantages to using this particular architecture. And once again, to look at the programming model, weve talked about these various different artifacts. Weve shown you examples of how to create database tables in the repository and then have them generate into the HANA catalog. Weve seen the lower level data intensive logic that we can write in SQLScript, SQL and views which is also something called the application function library. This is a more advanced topic but just to give you an idea this is where SAP can write business logic, we write it in C so we write it at a very low level in HANA and then we expose it to the model as SQLScript procedures. Were able to generate SQLScript procedures so you, the customer, or partner can call these functions. So theres the predictive analytic library and theres the business function library And both of these are exposed to the SQLScript programming model via this AFL. AFL stands for application function library. Now weve also seen the application server programming model, the server-side JavaScript, the OData service framework. Weve talked a little bit briefly about some of the other specialized frameworks that are available inside the XS Engine as well. There is an XMLA interface for hierarchical data, a VMDK type interface, and then we have the InA, our information access for building search services, so a specialized UI and services for the search scenario. And then finally our user interface, the SAPUI5 and the UI Integration Services. Now one last thinganother advanced topic that we do not talk about in here and a little look ahead to the futureis CDS, something called Core Data Services. So this is planned for HANA 1.0 SP6. The idea is that this goes beyond what we can do with today with hdbtable, hdbstructure, hdbview, and gives us a single syntax for defining data definition and query language, and allows us to do this abstracted from SQL, so at a higher level than SQL. And in doing so, we still generate SQL-compatible objectstables, views and SQL syntaxbut it gives you a higher level language to do this, even higher level than what we saw with the hdbtable and the other catalog artifacts. So maybe I show you this, which is a preview. And I want to stress that this is not something that you will be able to do in your system just yet. This is a preview of new functionality thats being developed for SP6 but I think it does a nice job of showing you how were going to continue to evolve the aspects that weve talked about in this workshop. So Ive created a single file that I call .hdbdd for HANA data dictionary. And then inside this file I declare which schema I want all these objects created within and then I can declare useable types and I define entities. And these entities when I activate will generate either tables or views. And we can even define relationships between these entities for instance the MyEmploye as an association to MyAddress and they're joining on the ID column. So this would be the same as

Page 11

Copyright/Trademark

00:10:54

00:11:10

00:11:32

00:12:12

00:12:55

00:13:26

00:14:23

00:14:59

00:15:20

00:15:39

creating an inner join in SQL and representing that as a view, but we can do this in this more comfortable syntax and we can then, in the query language, say MyEmployee.MyAddress and instead of having to write the join conditions or call a view we can use this more simplified syntax. At the end, when I activate this, this will generate multiple objects, structures, tables all at once. So unlike the several hdbtables and the corresponding hdbsequence and hdbview, we could replace that all with one single file and this new syntax that will be introduced. The techniques weve taught in this class do not go away. We still support the single standalone hdbtable, hdbview, and so forth, but this is something that well introduce as another optional way of doing things that has its own set of advantages. And just a little bit more of where you can find additional resources. There is a variety of other resources out there to continue your education on development on SAP HANA. Some are for cost, some are free. For example, we have SAP educational offerings where they have a variety of different types of education, everything from traditional classroom training to Virtual Live Classrooms, to e-learnings. And the SAP education offering does come at a fee, but also comes with levels of certification as well. On the other hand, we have the SAP Community Network. This is a great way for you to continue to connect with other professionals that are interested in the same technical topics that you are interested in. There you can find blogs, technical documents, and forums where you can both ask and answer questions. This is a great way for you to continue to grow your knowledge even if youre just going out there and reading the questions that other people are posting and seeing the answers that are being posted. But I also encourage you to give back to the community. As you learn how to do interesting things or you know the answer to somebody elses problem. share that knowledge and build a reputation in the community. And then inside the SAP Community Network we also have the SAP Developer Center, and this is the primary resource for this particular topic. So inside the developer resource center we have the HANA developer resource space. This is where youre going to find all the key topics and all the key information for doing development on SAP HANA. This is not an exhaustive list by any means. A more extensive list will be sent out in an e-mail that will accompany the end of this course. So now weve talked about various resources and weve reviewed the architecture, I want to show you one last demo. I want to go back to the system. And this is a demo weve actually seen a couple of times, at least the user interface. Ive shown you this Purchase Order Worklist and some of the functionality it has. It has search capabilities that I type, I get a federated search. I have OData services that are tied to that, so when I change the search criteria of my OData, service fires and I see the results that match the search criteria. Then I have linkage here so that when I select one entity in my OData service then I get the corresponding child entity displayed in a subtable. And then I have these reports, so these are running on top of analytic views and Im visualizing that analytic view in an SAPUI5 chart control. Now this search is a custom XSJS service. This chart is a custom XSJS service. The tables controls are OData services. The update actions, so my ability to come in here and accept a PO and change the status on it so now that Ive accepted that, now its approved, that is a custom XSJS service. And my export to Excelis very similar to one of the exercises we did,this is a custom XSJS service as well. So lets go behind the scenes a little bit and see how we put this application together. It makes for a nice learning tool because it takes many of the concepts weve discussed so far and weve seen in their individual exercises and now puts them together in one larger scale application which is more realistic of what you would be creating yourself. So Im going to go to the project for this particular application and I go into the data folder and you can see theres quite a few objects here. So this is where the underlying EPM data model was defined. Weve been using these tables all throughout this learning series. But if youre interested in how each of them are defined, theres hdbtables for each of these and theres hdbtid, hdbtim, and csv files for each of these tables as well. This is how we load our initial

Page 12

Copyright/Trademark

00:16:10

00:16:53

00:17:22

00:18:07

00:18:25

00:19:23

00:20:12

00:20:38

00:21:00

00:21:26

set of data into the system. And if you remember I showed you there is a data generator. And there is some logic in that data generator that will replicate out the small set of data thats delivered in the initial CSV and allow you to grow the data to whatever amount you want. This is also nice, the fact that we have this base set of data that is stored in the content repository because from that same data generator program...Ill just pull it up real quick here...if you were to mess things up, accidentally delete some of the data or update some of the data, you can always say Reload. Reload Master Data, Reload Seed Data, so that we reload the transactional data. All that does is make a call to the content repository and reactivate this content so we can reload the base data from the content repository back into the core tables. In here we also have sequences. We have the schema definition. We have a couple of roles and we have some views as well. Basically all this content then generates out to the schema you see here, the SAP_HANA_EPM_DEMO schema. All the various tables and views that you see in here all came from the source project. Now in addition to these catalog artifacts, we have a series of attribute, analytic, and calculation views as well, so theyre here in the Content package. So if I would go sap>hana >democontent>epm. And then in the models, weve got a series of attributes views for the buyer, product information, the Purchase Order Worklist. Weve got analytic views for purchase order with a currency conversion, sales orders with the currency conversion and without. We have our calculation views for purchase order and sales overview. We even have our analytic privileges that we created earlier as well. So Im not going to go into the details of all these because most of the interesting aspects we already saw in the detailed week. We see now that weve layered a lot of business logic on top of our base data model simply by creating a series of views. From there we also had the ability to create additional SQLScript procedures. But most of our logic in this case is actually in the form of services. Unlike our simple service example, in here we have our poWorklist. So this was a simple example like the one we did in our exercise, where were going to take an attribute view. And the main difference here from the simple exercise that we did is when we have an attribute view we have to specify the keys, but we have our join condition with the header and the item. And this is the OData service that sits behind those two table controls in the user interface that I showed you. And then we have a poWorklistQuery, and inside here we have the logic for being able to do the federated search. Basically were just searching across multiple tables and viewsthe business partner, the buyer table, the product tableand then we take all those results and we build a JSON object ourselves. So this allows us to have a custom output format and thats how were easily able to take multiple results sets that are different in criteria. Sometimes were pulling company names, sometimes were pulling city. We couldnt just pull those together in one result set via a join, of course, with all these different fields. We are able to do this at the server-side JavaScript layer. Inside this query we also have the logic to getTotalOrders. In this case, this is where were calling our analytic view that has our currency conversion in it, so were able to say SELECT SUM on converted gross amount, on our analytic view, and you notice here we even have the ability...our input parameter, our IPO target currency, can be put into the SQL statement as well. So we can pass in the currency from the outside. We can build our groupBy condition dynamically and in these cases what were doing here is to protect against SQL injection. So we cant use a parameterized statement here with the groupBy or some of these other fields, or even the currency. Were able to just do a test. I want to make sure nobody passes in extra characters or other conditions on the end of that group like a groupBy and something else and throw off my calculation. So Im just going to take the value thats passed in to the groupBy input parameter and Im going to do a switch case on it and if its anything else than one of the possible values that I expect, then Im going to throw an error message. So this is also the kind of validation logic you would expect to see in a server-side JavaScript as

Page 13

Copyright/Trademark

00:22:20

00:22:36

00:23:05

00:24:08

00:25:00

00:25:44

00:26:07

00:26:34

00:26:59

well. We have our download to Excel, exactly like in our exercise, and then the same thing with our update. We have the ability to update. DeletePO is really just updating the status flag on the PO, were really not deleting it from the database. But in either of these conditions, either approve or reject or delete, what were doing is were first reading the status of the PO that has been selected. Well do a bunch of checks to see if its applicable to be deleted or approved. So theres just rules about the checks, for instance, if the lifecycle manager is closed, then it cant be deleted. So we do all these imperative logic level checks here in the server-side JavaScript. And then if we pass all the checks, we can perform the update on the database. And you notice the main difference here if youre performing an update then you call the prepared statement executeUpdate and youll get a number of rows that were impacted back. So you see some slight variations in the logic building on top of the concepts that weve already learned. And then finally if we already look at the user interface. A little more complex than the examples that we saw before were broken down into multiple parts here. But, for instance, if we look at the table control, its not all that different from what we saw before, with each of the table controls we create a model object. The model object is bound to the OData service itself and when you create the individual tables they bind to a particular entity in that table. For instance, we have the button events in the controller for the table, simply called the serverside JavaScript service. In this case I have a special function for the download to Excel. I want to call it via Ajax but still have it function as a download. This was a sample implementation that I found on the Internet, this download function. So you see how were able to take existing code, third-party code, open source code, example code, and easily integrate it into our applications. In other instances here for other buttons we're simply calling the correct functions, just like we did in our exercise, the input, the live update on the calculation, well this is no different. I press the button, I build my URL to my XSJS service, and I call that XSJS service. In the Search.view, also not that different, there is a special UI element called SearchField. Thats how were able to get the search completions as we type. The event handler for that is here in the Search.controller, so we have the set filter so when we can get a new value from the search all we have to rebuild the call to the OData control. Because that event came from outside the table control, we have to trigger it. Remember, if we use the sort or the filter, thats built in. The event handler for that is built in to the table control itself. But you also see a really nice example here if we want to recall the OData service. All we have to do is call the oTable.bindRows to the entity once again. That will cause another request to go back to the OData service. So anytime we have an external condition, like here we want to build a new filter criteria, we just go ahead and build that filter criteria into the model object and then were able to pass that model object into the bindRows. We dont have to concatenate that URL to the OData request. The table control still is the one that knows how to build that URL and does that work for us. We see if we reset the parent here, we also need to reset the item level as well, so thats some of what were doing here. Heres the call to the search itself, when we want to initiate the search on the server side. Ince again just calling the XSJS service and if its successful, then we parse the JSON, so this is where Im going through and parsing the JSON, and building up the suggestion object thats going to back into the UI element. And then the same thing here, the Detail. Theres a lot of UI elements in here and Ive broken them up into smaller chunks. Each tab is rendered in a sub-function. This gets pretty big as theres a lot of UI elements on the screen, but theres really not a lot to this once you know how to do one text view then a block of text views is like cutting and pasting and changing IDs and names. Now maybe here this isnt interesting, this is where Im building the dropdown list box for the possible values in the report section. And then heres the UI5 controls for building the chart, so I build a flattened data set and then I create a Pie control and then I bind the Pie control and set the model. The model for that Pie control will be filled in the controller when the service is initiated by the

Page 14

Copyright/Trademark

change in the dropdown list box. Then were going to be able to call the query service on the server side. We get the data back, and once I get the data back its a matter of parsing through that JSON data and building another JSON object that gets bound to the chart control. So we use Json a lot as the model object as well, so thats where it works really nice with server-side JavaScript. JSON is so easy to create and process in the server-side JavaScript, and its equally easy to consume, and many of the UI elements are designed for JSON on the client side as well. 00:27:48 This final examplealthough we went through it fast, you can study it in more detail in your own systemI hope it's given you an idea of where all these development techniques that weve talked about over the previous weeks fit together, how they come together to create full scale applications. And I hope overall weve given you a nice view of native application development on SAP HANA and that you feel confident and comfortable moving forward and doing this type of development.

Page 15

Copyright/Trademark

www.sap.com

2013 SAP AG or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Please see http://www.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.

S-ar putea să vă placă și