Emerging market trends — such as in-memory, cloud, and mobile technology — bring with them a range of opportunities for building new, custom applications or extending existing solutions, such as SAP Business Suite. App stores for modern mobile devices, such as smartphones and tablet computers, enable you to download new apps in seconds. Cloud environments let you access applications and data from anywhere (often from mobile devices) and allow for a completely new level of collaboration. In-memory computing allows you to accelerate your core business processes and custom applications.
However, these technologies also put a burden on developers. When developing mobile apps, you need to be aware of a wide variety of platforms and development kits, from iOS to Android to Windows 8. Development for the cloud often involves complex integration scenarios bridging new, lightweight, on-demand software structures and existing, on-premise back-end systems with defined update schedules and very small maintenance windows. And while the relational database model followed by in-memory technologies enables you to reuse your existing SQL development skills, you still must revisit and refine those skills to fully benefit from the columnar storage style that facilitates the rapid data aggregation. In many cases, you need to combine all of these different technologies — think of a mobile app that runs in the cloud and accesses huge amounts of data that can only be analyzed with a modern in-memory database such as SAP HANA.
To enable organizations to benefit from these technologies in their business applications while lessening the burden on developers and lowering the total cost of ownership, SAP NetWeaver 7.4 introduces end-to-end developer scenarios — step-by-step tutorials that explain how to implement the various technologies supported by SAP NetWeaver in typical customer scenarios.
End-to-End Scenarios from SAP Ease the Developer Burden
The end-to-end development scenarios are shipped with SAP NetWeaver 7.4, which is optimized to support the use of SAP HANA and to bring cloud and mobile technologies into the SAP technology platform, while still supporting your existing investments (see sidebar). The scenarios can be used in your on-premise SAP NetWeaver environment, in an on-demand cloud environment supported by SAP HANA Cloud Platform, or in a hybrid environment bridging SAP NetWeaver and SAP HANA Cloud Platform (note that SAP HANA Cloud needs to be licensed separately).
Each development scenario focuses on an end-to-end developer experience and includes customizable code and data models, as well as detailed guidelines that explain every step in the development process by following a consistent story line based on an example application that is typical to SAP customer needs. Think of an integration scenario in which some of the integration is executed on premise (typically by SAP NetWeaver Process Integration) while other integration steps are executed in an on-demand environment. The aim of the end-to-end scenarios is to not only show the code, but also explain all of the configuration and customization steps needed to run the complete integration scenario. These steps are often neglected or underestimated, which can result in unpredictable behavior and enormous development and operation costs. The end-to-end scenarios not only help avoid these risks during development, but also demonstrate the significant value that can be derived from the different technologies when they are carefully combined to work together.
A full list of the scenarios included with support package 2 for SAP NetWeaver 7.4 (partially in conjunction with SAP HANA Cloud Platform) and documentation of the tutorials are available at http://scn.sap.com/community/developer-center. The most popular scenarios are:
- Develop an ABAP application, optimized for SAP HANA, for SAP NetWeaver 7.4
- Develop a Java application that runs purely on SAP HANA Cloud Platform, leveraging built-in services like persistency and identity management
- Develop a Java application that runs on SAP HANA Cloud Platform, but accesses on-premise back-end systems through the OData protocol
- Develop one of the above use cases and combine it with a new user interface (UI) built with the UI development toolkit for HTML5 (known as SAPUI5), which is SAP’s adaptation of the HTML5 standard
- Develop a mobile application that combines several of the above technologies
This article focuses on the first use case combined with the SAPUI5 use case because this is a straightforward one that should give you a solid foundational understanding. Other use cases will be presented in future columns.
End-to-End ABAP Development
The basic idea behind the ABAP development scenario for SAP NetWeaver 7.4 is to push down code from SAP NetWeaver AS ABAP into the SAP HANA database to benefit from its high-speed aggregation capabilities. You also have the option to use SAPUI5 to create a compelling UI, which requires modeling your data with SAP NetWeaver Gateway tools to ensure proper exposure of the data through the OData protocol. SAP HANA, SAPUI5, and SAP NetWeaver Gateway are integrated into SAP NetWeaver 7.4, so you don’t need to install them or set them up separately, but you do need to perform some customization and configuration to make the required connections.
The application example used in this scenario and the underlying data model centers around sales orders, represented by corresponding invoices, from business partners. The data for the scenario is contained in three tables; two tables have the header and line item information for the invoices, while a third has the business partner information. Using this data, the data model calculates important measures, such as tallying the number of days for open sales orders, summing up the amount owed for the open items per business partner, converting prices to euros, and providing a means of customer tagging for handling payment reminders.
While the full details of the tasks involved in executing the end-to-end scenario are beyond the scope of this article, it will provide an overview. The fully detailed steps (as well as the code, which you can also examine live in your SAP NetWeaver 7.4 system) are available in the scenario documentation at SAP Community Network.
Note: The ABAP development scenario requires SAP NetWeaver AS ABAP 7.4 running on an SAP HANA database (SPS5).
Step 1: Install the Development Tools and Configure the Server
To begin, you must ensure that the required SAP development tools, which are based on the Eclipse platform, are installed. To work with SAP HANA artifacts, such as attribute views, analytic views, calculation views, and stored procedures, in the ABAP development scenario, you need to locally install the SAP HANA studio, which is available for SAP customers via SAP Service Marketplace at http://service.sap.com/swdc.
Next, you can install the Eclipse-based plug-ins you will need, which are available for download from the SAP update site at https://tools.hana.ondemand.com (see sidebar below). To enable access to SAP HANA artifacts from ABAP, you must install the ABAP in Eclipse plug-ins (ABAP Development Tools for SAP NetWeaver). For the UI development, you need to install the SAPUI5 plug-ins (UI Development Toolkit for HTML5) and the SAP NetWeaver Gateway plug-ins (SAP NetWeaver Gateway Productivity Accelerator).
Once you have installed the required tools, you need to ensure that your SAP HANA system is present in the SAP Logon dialog. On the server side, you then need to make sure that the test data is available (all development scenarios come with a data generator that can generate one million sales orders with corresponding line items) by running the ABAP development object containing the data that is included with the scenario. You must also release internet communication framework (ICF) services to enable access to back-end functionality from a browser session, and perform the customizing steps for the scenario, for SAPUI5, and for the SAP NetWeaver Gateway services. Most of the customization steps are integrated into the reference IMG included with all standard SAP systems.
Step 2: Push Down the Code to SAP HANA
Deciding on the code to execute at the database level is critical to leveraging SAP HANA. It does not make sense to delegate code that merely drives the UI of the running application; it’s the database-intensive operations that access many records to build sums and aggregates that need the processing strength of SAP HANA.
SAP HANA offers the concept of a calculation view for handling complex data calculations that involve multiple data sources. A calculation view contains fields that are computed when the view is accessed from the ABAP level. The view’s logic is expressed with SQL Script, which is a collection of extensions to SQL that provide the basic functionality to build a database procedure — functionality such as executing SQL statements, binding variables in the WHERE clause and in the result set, passing parameters between procedures, looping, and control structures. For the average ABAP programmer, a database procedure is similar to an update task function module in the classical sense. But with a database procedure, the data can be returned to the caller (which is not the case in the update task).
To execute the data calculations on the SAP HANA database, you need to define a calculation view for the scenario using the SAP HANA studio. This studio provides dialogs and wizards, both in graphical and textual representation, to complete the definition. Once you have created the calculation view, you can test drive it visually within the SAP HANA studio, without the need for an ABAP program. You can display the results of the calculation view (or any other supported artifact) in a simple table format, or as charts to provide even further analytical insights. For instance, Figure 1 shows the amount owed by business partners for open items in bar chart form.
||Previewing the results of the newly defined calculation view in the SAP HANA studio.
Step 3: Make the SAP HANA Artifact Available to ABAP Programs
Next, SAP HANA artifacts need to be made visible in the Data Dictionary (DDIC) to be accessed from ABAP programs. In the ABAP perspective, create a DDIC definition for the calculation view using the New ABAP Repository Object wizard. Figure 2 shows the calculation view as seen from the ABAP perspective, with the SAP HANA data types represented as DDIC or ABAP data types.
||The Data Dictionary definition of the calculation view.
Once the DDIC definition of the SAP HANA artifact is visible and active, you can write a simple ABAP program with Open SQL to access the view and display it as a simple ABAP list by mapping it to an ALV grid. All of the underlying code of the calculation view is now executed inside the SAP HANA database. But, of course, you need to carefully decide which statements should be executed on the database level.
Step 4: Define the SAP NetWeaver Gateway Service
To create a modern, browser-based UI that leverages HTML5 capabilities, you need to define SAP NetWeaver Gateway services to properly expose your SAP data to the browser through the OData protocol. Until SAP NetWeaver 7.31, SAP NetWeaver Gateway was a separate instance or add-on that needed to be installed to use SAP NetWeaver Gateway services. With this release, SAP NetWeaver Gateway is an integral part of the ABAP application server.
To expose the calculation view data via an SAP NetWeaver Gateway service, you use the OData modeler. The OData modeler allows you to define entities, such as those that make up the fields of the calculation view, and the relationships between them following the OData specification. Once you have modeled the desired entities, you can save your model to an XML file and import it into an ABAP 7.4 back-end system using the SEGW transaction on the ABAP server. From there, you need to generate the model and implement the corresponding model and data provider classes in ABAP using ABAP in Eclipse or transaction SE80. In the example application, the calculation would be accessed with a SELECT statement within the provider class for the result set.
With the generated SAP NetWeaver Gateway URLs, you can then test drive your SAP NetWeaver Gateway service in a browser session, which displays the data in XML formatting.
Step 5: Generate an SAPUI5 Interface for the SAP NetWeaver Gateway Service
The final step is to generate a list/details application based on SAPUI5 that will consume the newly created SAP NetWeaver Gateway service and display the data from the calculation view that is exposed by the service.
To create the SAPUI5 application, you walk through a series of wizard screens. The steps here include selecting a standard layout template for the list/details display, specifying the SAP NetWeaver Gateway service and connection to use for the service, defining the fields to display, and connecting to the ABAP repository on SAP NetWeaver AS, where the SAPUI5 application will be stored. Creating this server connection means that all artifacts related to the SAPUI5 application are stored in the ABAP repository (which, physically, is located in the underlying SAP HANA database). Connecting to the server also means that anytime you create or update the UI, a corresponding logon dialog pops up to confirm access to the server.
Once you have completed the steps, you can run the SAPUI5 application. Figure 3 shows the results of the SAP NetWeaver Gateway service call as a simple SAPUI5 table.
||The results of the SAP NetWeaver Gateway service call in an SAPUI5 table.
Innovations in cloud, mobile, and in-memory technologies open up a world of opportunity for transforming your applications into state-of-the-art solutions with the agility to meet your business needs. Navigating these technologies can also pose tremendous challenges for developers, however, who must manage the complexity of classical development approaches combined with new deployment models, and balance it all against business requirements.
SAP NetWeaver 7.4 end-to-end development scenarios help developers shoulder this burden by guiding them through the jungle of available technologies. Not only do the scenarios provide step-by-step tutorials to ease development tasks, they also demonstrate how the technologies can work in your organization, so that you can choose the ones that best meet your particular requirements, and greatly reduce the total cost of development and operation of your SAP solutions.
Karl Kessler (firstname.lastname@example.org) joined SAP AG in 1992. He is the Product Manager of the SAP NetWeaver foundation — which includes SAP NetWeaver Application Server, Web Dynpro, the ABAP Workbench, and SAP NetWeaver Developer Studio — and is responsible for all rollout activities. Currently, Karl’s work centers on how SAP NetWeaver powers SAP ERP and SAP Business Suite software, with a focus on lifecycle management.