GeneXus for SAP Systems First Build and Run

Official Content
This documentation is valid for:

Now we want to test the transaction we created in the previous steps. To do so, we'll have GeneXus build the application, create the database, and do everything necessary to get the programs ready to be run and tested. This test cycle that developers undertake before the application is ready is called prototyping.

The full version of GeneXus allows prototyping an application locally (that is to say, the programs and the database will be hosted on our network servers) and in a cloud that is available to GeneXus users. Also, we can prototype in any of the programming languages supported.

However, in the specialized version for SAP Systems, the database will be SAP HANA, the language will be Java, and the prototyping tasks will be done on the Tomcat server that is available to us. In our demo, it will be a local one.

To set the necessary information in the HANA database and the web server, we must select the Preferences tab or press F5. We will use this function key very frequently because it allows us to generate all the objects required, as well as compile and run the main object. 

Because it is the first time we press F5, this window is opened to ask us for the server and database details:

GeneXusForSAPSystems_FirstBuildAndRun_Image1

A way to build applications that use SAP HANA database is to do it through the Cloud platform available from SAP, called SAP Business Technology Platform.

For trial purposes, a free account may be created at hcp.sap.com.

image_2021329172441_1_png

To know all the details about how to create the DB in SAP BPT and how to obtain the connection data to be used in GeneXus see: How to use SAP HANA database on SAP Business Technology Platform

Once this is done, you are enabled to continue the work from GeneXus.

GeneXus will build the application from the main object known as Launchpad, which we will see later, but for now, we can say that it will contain all the Fiori List Reports of our objects. We don't have any yet, so this object is not useful to us. Therefore, we need GeneXus to run a developer menu to try all the objects that are being created, even if they don't have that Fiori pattern incorporated, without worrying about programming the invocation. 

Let's click on Cancel. In the Preferences tab, we see that the information we've just entered has already been configured in the corresponding properties. So, if we open the Data Stores information, we see that we have the Default option (SAP Hana) and if we enable the properties window (by pressing F4, or here on the right):

image_202183154149_1_png

Here they are!
Now, let's press F5.

The Output window informs us that the Developer Menu execution has started and will end with a report called “Impact Analysis.”

GeneXusForSAPSystems_FirstBuildAndRun_Image18

In this report, GeneXus examines the impact caused by the new definitions made in the knowledge base. Also, it indicates which additions or structural changes need to be made to the database. 

If we examine the report, we can see that a new table called Customer will be created:

GeneXusForSAPSystems_FirstBuildAndRun_Image19

Also, that this table structure will have the following attributes: 

GeneXusForSAPSystems_FirstBuildAndRun_Image20

As we can see, GeneXus will also create an index by CustomerId automatically. We will explain this concept later on.

GeneXusForSAPSystems_FirstBuildAndRun_Image21

Since we agree to have this table created with this definition in the database, we click on the Create button

GeneXusForSAPSystems_FirstBuildAndRun_Image22

So, GeneXus starts to create the necessary programs to create the Customer table in the database, with this structure. 

Next, GeneXus executes those programs.

GeneXusForSAPSystems_FirstBuildAndRun_Image23

Why did it fail? Why does it show a reorganization error? 

In the Output window, we're informed that the driver to connect to the database hasn't been found within the folder containing all the necessary files to run this application:

GeneXusForSAPSystems_FirstBuildAndRun_Image24

We solve it by copying it to the directory of this Java Environment... within the Drivers folder. 

GeneXusForSAPSystems_FirstBuildAndRun_Image25

Where do we take it from? It can be downloaded from SAP's website, as shown here.

We have downloaded it to the folder where everything related to HANA is saved: 

GeneXusForSAPSystems_FirstBuildAndRun_Image26

Now we press F5 again and click on Create. 

GeneXusForSAPSystems_FirstBuildAndRun_Image27

And the Customer table is created in the database. Next, GeneXus generates other programs (that is to say, all the necessary lines of code in the selected programming language, so that our application does what we want, which in this case is to enter customer details)... Also, we are informed if the result was successful, or if there were any errors or warnings.

 GeneXusForSAPSystems_FirstBuildAndRun_Image28

We're asked which browser we want to use to open the Developer Menu. We choose anyone we want. 

Here we can see the application running: 

GeneXusForSAPSystems_FirstBuildAndRun_Image29

We have one objects: the Customer transaction that we created. 

We right-click on the link and choose to open it in another tab.

Here we have a page that allows us to add, change and delete customers. We enter the details of our first customer.

GeneXusForSAPSystems_FirstBuildAndRun_Image30

This customer will be identified with number 1;
His name is John:
His last name is Smith:
He lives on Fifth Avenue.
His phone number is: 1111
And his email address is jsmith@homtail.com

GeneXusForSAPSystems_FirstBuildAndRun_Image31

We click on Confirm and a message is displayed to inform us that the data has been successfully added; meanwhile, the form is cleared and ready for us to enter another customer:

GeneXusForSAPSystems_FirstBuildAndRun_Image32

Let’s add the second customer... we identify her with number 2:

Her name is Susan:
Her last name is “Brown”:
Her address is on Seventh Avenue
Her phone number is 2222
And her email address is sbrown@gmail.com

GeneXusForSAPSystems_FirstBuildAndRun_Image33

We click on Confirm. Once again, a message is displayed to inform us that the data has been successfully added.

To look for John’s details, we enter his customer number (one) and press the Tab key. 

GeneXusForSAPSystems_FirstBuildAndRun_Image34

We see that John's full details are displayed and that from here we could change some information, such as his phone number.

Also, we could even delete customer John from the customer records using the Delete button.

We can also use the upper section buttons to browse customers by going to the next or the previous one, the first or the last one:

GeneXusForSAPSystems_FirstBuildAndRun_Image35

Also, we can look for a specific customer using this window:

GeneXusForSAPSystems_FirstBuildAndRun_Image36

 This window was automatically created by GeneXus, and it corresponds to this object:

GeneXusForSAPSystems_FirstBuildAndRun_Image37 

Note that if we change the screen size, the controls are adjusted to the space available. 

GeneXusForSAPSystems_FirstBuildAndRun_Image38

What does it mean? GeneXus generates responsive web applications, or sensitive applications, which offer optimum viewing, good navigation and excellent use of screen space.
This is achieved with design features that allow viewing all the information on the screen, using the functions provided by GeneXus to this end. They allow us to show different layouts depending on the screen size of the device.

Now that we’ve seen everything that was automatically generated by GeneXus using the Customer transaction that we've created... let’s go back to the development environment.