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:
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.
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):
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.”
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:
Also, that this table structure will have the following attributes:
As we can see, GeneXus will also create an index by CustomerId automatically. We will explain this concept later on.
Since we agree to have this table created with this definition in the database, we click on the Create button
So, GeneXus starts to create the necessary programs to create the Customer table in the database, with this structure.
Next, GeneXus executes those programs.
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:
We solve it by copying it to the directory of this Java Environment... within the Drivers folder.
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:
Now we press F5 again and click on Create.
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.
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:
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.
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 email@example.com
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:
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 firstname.lastname@example.org
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.
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:
Also, we can look for a specific customer using this window:
This window was automatically created by GeneXus, and it corresponds to this object:
Note that if we change the screen size, the controls are adjusted to the space available.
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.