 So, what we have in Agenda, we're going to talk about the old SAP, the new SAP, what is Python have to do with SAP. We're going to see examples using Python at ERP and also Python in SAP HANA. So we're going to talk about not your grandfather's SAP, because SAP had changed before. So most people used to see SAP as an all-close and really expensive German company that produces software for big companies. Also it was really hard for individuals or development developers to actually use it. Because you needed a tons of RAM, you needed a really big machine, it was pretty difficult to style, it has really ugly graphics and interface that everybody hates. But right now we have the new SAP, which is still German, but it's all around the world. So right now it's really easy for individuals or external developers to use it. It still needs a lot of RAM, but we provide really nice alternatives for that. It's really easy to install now. It's very friendly, even for people who haven't used before any SAP software. This is still kind of ugly, but we're working on that. And it's actually very committed to open source. Most people doesn't know that. But SAP contributes a lot on Eclipse, because most of our new tools are based on Eclipse. So we're doing a lot of contributions there. So this is a bit of marketing, so sorry about that. But these are some of the new technologies that SAP provides. We provide SAP HANA, which is an in-memory database. We also have PowerBuilder, which I don't know how many people use that anymore, but it has a new interface, it's based on .NET, so it's supposed to be kind of cool. We also have the SAP Model Platform, which allows you to create mobile applications that will run on BlackBerry, iPhone, Android, wherever. So we have SAP NetWeaver Cloud, which is a platform as a service software, sorry. SAP UI5, which is a set of libraries based on HTML5. We have SAP NetWeaver Gateway, which allows us to create a rest on all data services. And we also have the SAP NetWeaver Sneak Preview, which is for ABAP developers, being ABAP the main source of development in SAP. So what should we care about this, because SAP now provides most of the latest technologies for free. In some cases, it's completely free, 45 days, one or three months. So we have free developer licenses. You can try, you can develop, you can share, you can sell, you just need to go to developers.sap.com. I have a couple of stickers, so if you want some stickers, just come to me. So what we get for SAP, we have two options. We have 30 days, totally free of charge on cloudshare.com, or we have free developer licenses. You just pay Amazon Web Services for the host team. And in the case of NetWeaver Cloud and SAP UI5, it's completely free. You can use it on the laptop. So we cut the marketing from there, and we go straight to the Python and SAP. So most of the people might not be aware of this, but SAP has always used Python internally, like forever. But in the last months, SAP has started to actually provide more ways for external people to use Python, both ERP and SAP HANA. Because we believe that Python is a really solid, powerful, awesome, stable technology, and it allows us to leverage more power to our applications. So we're going to see an example using Python and ERP. Actually at first, we didn't have a real connector, so PS Harding, which is an SAP Hacker Hero, created a library to connect Python and ERP. But now we have a new way to do it, because the value prototype in Germany created the PyRPC, which is a better way to connect Python and ERP. So we have even managed, sorry. This new connector is being used by SAP not to create real products for customers, but it's more like prototypes. So we're using it for even management, time management, web cloud applications, and even RFID scanner, mobile printers, et cetera. So here we have an example of using a PyRPC. So we have a file, a CFG file. So we're going to have all the connection parameters to the ERP. So we just need to import the library. We need to import the config parser to read the file. So basically the most important part here should be, this is where we're going to read and we're going to set to the selection, the parameters that we have read for the file. And this application is only going to say that we have a successful connection or we couldn't connect to the server. So it's very basic just to know how it works, right? So now what we're going to do is we're going to create an SE16 emulation. SE16 is an ERP transaction which allows to see all the data from a table, for any table. So it's very useful in size SAP. So for this I use ECG. I'm not going to show for sure the whole code because it's kind of long and I'm pretty sure you all know ECG. So we're just going to show a couple of lines, right? So we define the login, which is going to be basically the same thing. We're just going to read the file, we're going to ask for the user and the password because we don't want that to be in the file. So basically we're going to connect and if we have a successful connection, the most important thing from here, we're going to call RPC read table, which is a remote function call, which is on the ERP. We're going to say, okay, I want to read this table and I want to get all the contents. Here we're going to read what the ERP or the ERP is returning us. We're going to make some total selections. We're going to try to put that into a structure. So in the end, this is how the program is going to look. We're going to have on the face screen, we're going to put our username, our password. It's on the Aspera table and we're going to show all the content of the table, which is basically what you can do on ERP using SC16. So this is sort of emulation. So we can pass any table and we're going to see all the data from the table. But PRPC is not only a client, meaning that we're not only going to read information for the ERP, but we can also use PRPC as a server. So actually the ERP is going to go to PRPC, PRPC is going to do some stuff and it's going to send it back to the ERP. So basically what we need to do is we need to go to our ERP server. We just create a very simple function module, which is going to have this little code, which is going to be like, concatenate, hello, name from SAP, blah, blah, blah. So if we execute it, we're going to pass the name of the parameter and it's going to return as hello, from SAP. So this is only from the ERP. Now we have here the code. This is going to create a PRPC server. So here we're going to say hello from PyRPC and we're going to grab the name of SAP parameter. So when we run this, you see it's going to create a server. Here in the ERP, we're going to execute the same. We want to say that we want to use our PyRPC as a server. So actually the real response for the ERP is going to be hello, albaro from PyRPC. So as you can see, we run it first from the ERP and now we are running from the ERP but calling PyRPC. So actually you can put whatever functionality you want on Python and it's going to return to the ERP, which is really great. And that comes apart where we're going to use Python and SAP HANA. When we still SAP HANA client, it provides a lot of drivers for connectivity and there's one called dbappi, which is an already compiled library to make a native connection between Python and SAP HANA. Initially it was kind of hidden. I mean you install it but you really don't know that it's there. So actually I was the one that made it public on the SAP community. I wrote a blog called Python and SAP HANA just there. So I actually showed the SAP community that they can use Python together with SAP. Of course I got some problems because they told me, oh, this is not really for customers, you shouldn't have to write this blog, blah, blah, blah, but I really don't care because I wanted to show people that there's more languages outside SAP and Python is really cool and you can use it with SAP HANA. So it was cool. So this is SAP HANA. So here we're going to create a calculation view. You're going to see we have two tables that we're going to join. We're going to create a projection. Then we're going to join this projection with an attribute view. We're going to have the output and actually what we're going to do here is we're going to create a calculated measure. Actually what happens in SAP HANA is that when we create this calculation view, it's not going to be stored on the database. Actually every time we execute it or recall it, all this is going to get executed and also all the calculated measures that we create. Everything happens on the fly. SAP HANA is a really, really, really fast in-memory database. Everything happens on main memory. So there's no need to save this on the database. So what we're going to do here is we're going to create a calculated measure called discounted. So basically we're going to see if the carrier ID is equal to American Airlines, we're going to have a discount price of 80 percent, otherwise we're going to leave the price as it is. So we're going to use the DBAP and SAP HANA to read that calculation view. We're going to just bottle to provide a simple table with information. I'm pretty sure you all have to just bottle. So we're just going to see how it works, right? So basically what we have here is the DBAP connect. We just pass information. We pass the URL for the SAP HANA, the port, the username, and the password, right? Here what we are doing is we are sending commands straight to SAP HANA. So we're going to, first, we're going to drop this type test out if it exists. If it doesn't exist, we're going to pass it. We're going to drop a procedure called PyTest. If it doesn't exist, we're just going to go in a way because we're going to execute this query. We're going to create a type, which is some sort of temporal table, right? And we're going to create a procedure, which is going to receive a table. It's going to read our calculation view, and it's going to take this data, right? The carrier ID, connection ID, the price, and the discounted price. What we're doing here, what we're saying with result view, proc view, is like we're going to have some sort of a temporary table that we're going to be able to read after the calculation view is done. So basically here, what we are doing is we're creating some SQL code inside Python, and this code is going to be executed in SAP HANA, so we're going to create a procedure, we're going to read the calculation view, and we're going to get the information back. So basically, when we run the PyTest on the model page, you're going to see the first three ones. You can see this is the reapplies, this is the discounted price, and you're going to see that actually there's a discount of 80%, and the other ones will remain the same. So the cool thing about this is that it's not an ODBC connection, it's a native collection between Python and SAP HANA, and SAP HANA, as I told you, is going to execute the calculation view on the flight. So there's no need to save it on the database. It's going to calculate it just when you want it, and it's really, really, really fast. So actually, if you have an opportunity to try it, please do it, as I told you, on developers.sap.com, it's really, really fast to use.