GeneXus for SAP Systems First Build and Run

Official Content
This documentation is valid for:

Now, the Transaction that was created in the previous steps has to be tested.  To do so, GeneXus will build the application, create the database, and do all the necessary things to get the programs ready to be run and tested. This test cycle that you undertake before the application is ready is called prototyping.

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, you can prototype in any of the programming languages supported.

To set the necessary information to connect with the database and the web server, you must select the Preferences tab or press F5. This function key is used very frequently because it generates all the objects required, as well as compiles and runs the main object. 

In this case, press the Rebuild All option in the Build Menu. Because it is the first time that is pressed, this window asking for the server and database details is displayed:

image_20221121172356_1_png

Note: In this guide, the new environment was created, setting Microsoft SQLServer as the database to prototype the application. A way of building applications that use SAP HANA database is through the Cloud platform available from SAP, called SAP Business Technology Platform. 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

Press Finish after setting the connection information.

GeneXus will build the application from the main object known as Launchpad, containing all the objects' Fiori List Reports. As there aren't any yet, this object is not useful right now. Therefore, GeneXus needs 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. 

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

image_20221121173135_1_png

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 you examine the report, you can see that a new table called Customer will be created:

image_20221121173351_1_png

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

image_20221121173540_1_png

As you can see, GeneXus will also create an index by CustomerId automatically. This concept will be explained later on.

image_20221121173852_1_png

If you agree to have this table with this definition created in the database, 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.

image_20221121174824_1_png

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 the application does what is meant to do, which in this case is to enter customer details). Also, You are informed if the result was successful, or if there were any errors or warnings.

GeneXus open your default browser and here you can see the application running: 

image_20221121175159_1_png

It is the Fiori Launchpad, but in this case without options because a template to generate the CRUD UI for the Customer Transaction needs to be applied.

To run the Transaction, go to the option View > Other Tools Window > Launchpad and click on the Customer name. This will open the browser:

image_20221121175424_1_png

Here, you have a page that allows you to add, change and delete customers. Enter the first customer's details.

image_20221122135031_1_png

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@mail.com

image_20221122135159_1_png

Click on Confirm and a message informing that the data has been successfully added is displayed. Meanwhile, the form is cleared and ready for entering another customer:

image_20221122135620_1_png

Now, add the second customer, identified 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@mail.com
 

Click on Confirm. Once again, a message informing that the data has been successfully added is displayed.

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

image_20221122135824_1_png

John's full details are displayed and some information can be changed from here, such as his phone number.

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

You 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:

You can also look for a specific customer using the Select button.

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

image_20221121181848_1_png

Note that if the screen size is changed, the controls are adjusted to the available space. 

image_20221122135313_1_png

This means that 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 show different layouts depending on the screen size of the device.

Now that you’ve seen everything that was automatically generated by GeneXus using the Customer Transaction that you've created, go back to the development environment.

Error in the first table creation when you use SAP HANA database

If you are using SAP HANA database to generate your application, the first time that you try to create the database this error may appear in the output window

image_2022112118238_1_png

You'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

You solve it by copying it to the directory of this Java Environment, within the Drivers folder. Go to Tools > Explore Target Environment Directory to open this folder in the Windows Explorer.

Where do you take it from? It can be downloaded from SAP's website (you need the ngdbc.jar file) https://tools.hana.ondemand.com/#hanatools.

Download it to the folder where everything related to HANA is saved and copy the ngdbc.jar file

GeneXusForSAPSystems_FirstBuildAndRun_Image26

Last, Rebuild All again.