Sap Abap 751 Why
Sap Abap 751 Why
Sap Abap 751 Why
The main driver for 7.51 is to provide ABAP enhancements that support the transition from SAP Business Suite to SAP S/4HANA, and for this reason, it is not a full SAP NetWeaver
delivery — it consists solely of SAP NetWeaver Application Server (SAP NetWeaver AS) ABAP, supported by the 7.49 ABAP kernel, and related development tools. So, does that
mean this a release only for SAP S/4HANA customers?
The answer is no. ABAP 7.51 delivers an enhanced ABAP programming model that extends CDS to include transactional as well as analytical
application development and supports custom code management. Not only do these enhancements provide a structured approach for
transitioning from a traditional SAP Business Suite implementation to SAP S/4HANA along with powerful custom development capabilities, they
also extend the advantages of CDS modeling to the development of any custom ABAP-based transactional applications.
This article provides an overview of the ABAP features included in an upgrade to 7.51 (see the sidebar “Upgrading to 7.51” for more on
upgrading), and walks through an example that demonstrates how these features work together to help you create sophisticated SAP Fiori-based
transactional applications.
Upgrading to 7.51
So, will only SAP S/4HANA customers get the 7.51 version as an indirect shipment? Fortunately, the answer is no. SAP is also releasing SAP
NetWeaver Application Server (SAP NetWeaver AS) ABAP 7.51 as a standalone development and runtime environment, meaning that any
SAP customer with a valid SAP NetWeaver license can download it from SAP Service Marketplace (http://service.sap.com) or run a cloud
image via the SAP Cloud Appliance Library.
Upgrade options for ABAP 7.51 are offered for SAP NetWeaver start releases 7.4 and 7.5 when the usage type is restricted to ABAP development
and execution. Java usage types can skip the 7.51 release and later upgrade to a successor version (not yet planned) offering Java 9 support.
Similarly, SAP Business Suite (enhancement package 8) usage types, which run on the full SAP NetWeaver 7.5 release, can skip 7.51 and
upgrade to a (not yet planned) later release.
In parallel to the 7.51 shipment, SAP has released a couple of add-ons for 7.4 and 7.5, including a governance, risk, and compliance (GRC) add-
on (SAP Note 2323497 documents the available add-ons). These add-ons require only an SAP NetWeaver AS ABAP release, underscoring the
value of 7.51. Other add-ons that require a full SAP NetWeaver stack, similar to the SAP Business Suite usage type, can skip 7.51 and wait for a
later release.
CDS offers a variety of built-in functions for customizing the resulting data set, including calculation functions and extensibility options for adding
fields.
For example, you can use the CreationDateTime data to determine how many days a particular invoice has been open — by calculating the
difference between the creation and the actual date and time in seconds (function tstmp_seconds_between) and dividing by 86400 (the product of
60*60*24) — and add a field (DaysOpen) to display the results (see Figure 4).
Figure 5 shows an added field convGrossAmount that is calculated by the currency_conversion function, which converts the actual currency to
US dollars.
CDS offers a variety of built-in functions for customizing the resulting data set, including calculation functions and extensibility options for adding
fields.
For example, you can use the CreationDateTime data to determine how many days a particular invoice has been open — by calculating the
difference between the creation and the actual date and time in seconds (function tstmp_seconds_between) and dividing by 86400 (the product of
60*60*24) — and add a field (DaysOpen) to display the results (see Figure 4).
Figure 5 shows an added field convGrossAmount that is calculated by the currency_conversion function, which converts the actual currency to
US dollars.
Figure 1 — The source code for the example sales order invoice CDS view
Figure 2 — Press F2 to view the technical information, including associations, for the base view
Executing the view (by pressing F8) displays a list of the specified fields and retrieved data in a table format (see Figure 3).
Figure 3 — The results displayed by executing the example sales order invoice CDS view
CDS offers a variety of built-in functions for customizing the resulting data set, including calculation functions and extensibility options for adding
fields. For example, you can use the CreationDateTime data to determine how many days a particular invoice has been open — by calculating the
difference between the creation and the actual date and time in seconds (function tstmp_seconds_between) and dividing by 86400 (the product of
60*60*24) — and add a field (DaysOpen) to display the results (see Figure 4). Figure 5 shows an added field convGrossAmount that is
calculated by the currency_conversion function, which converts the actual currency to US dollars.
Figure 4 — Use built-in functions to customize the results display — for example, use a calculation function to calculate the number of days an
invoice is open
Figure 5 — Adding a field to the results display that shows the converted gross amount for an invoice
Figure 7 — Select a smart template for developing the SAP Fiori application
Figure 8 — Select the SAP Gateway service that will provide the application with access to the back-end ABAP system
We then generate the SAP Fiori development project and run it. The result is shown in Figure 9. It shows sales order invoices grouped by
company, and shows all the aggregated columns such as average open days, gross amount, converted amount, and creation date. All the
grouping and sorting capabilities are built into the template automatically, meaning no need to write any code for it.
Figure 9 — The generated SAP Fiori sales order invoice application
To view the details of a particular line item, select the item and click on Show Details, which takes you to a display that groups the details into
general information on the upper half and all the positions of the sales order on the lower half (see Figure 10). Again, all this functionality is
automatically provided by the template and requires no additional manual coding efforts.
Figure 10 — The detail display for a selected sales order invoice
Now, let’s see how the transactional services capabilities provided with ABAP 7.51 come into play.
In the annotations of this CDS view, you see several lines that start with the prefix @ObjectModel to indicate that BOPF-based transaction
services will be linked to this view. While many of these annotations are self-explanatory, such as createEnabled and updateEnabled, you can
always open the online help by pressing F1 on the annotation. You can open the technical properties by clicking on the spiral ( ) icon displayed
in the leftmost column of the editor, which shows that a BOPF business object has been generated for this view (see Figure 12). Clicking on the
hyperlinked Business Object text takes you to the BOPF editor in ABAP in Eclipse (see Figure 13).
Figure 12 — Press F2 to view the technical information, including any generated business objects, for the view
Figure 13 — The business object displayed in the BOPF editor in ABAP in Eclipse
The BOPF editor manages all the components of a business object definition, most notably the structure of the object, which consists of a root
node (in the example, the product review records) and any child nodes (none are shown in the example, but these would be similar to sales order
positions, for instance). From the Business Object Overview in the BOPF editor, you can quickly navigate to overview information about the root
node of the business object by clicking on the hyperlinked text (Go to the ROOT node). On the Node Overview screen (see Figure 14), you find
various technical artifacts, such as the underlying physical database table, structures and table types for business object processing, and
semantic information such as BOPF associations, alternative keys, and properties. The overall BOPF framework offers a wide range of options,
but for our example, we need only a small subset of artifacts. 5
Figure 14 — The Node Overview information for the root node of the business object
The Node Behavior section on the Node Overview screen lists Actions, Determinations, and Validations that provide programmatic access
through predefined method interfaces. We are interested in the Determinations, which change the state and attributes of a business object, so we
click on the hyperlinked Determinations text, which takes us to a list of the determinations configured for this node (see Figure 15). In the
example, we have a determination that is implemented as an UPDATE_ATTRIBUTES method in the implementation class
ZCL_DEV210_D_ATTRIBUTES_SOL whenever a new business object is created. This behavior is controlled by triggers, which enables you to
apply fine-grained control and include only triggers that are required by your application context. From here, you can navigate to a Determination
Overview display (see Figure 16) where you can view general information for a determination and configure any triggers.
Figure 15 — Determinations configured for the example node
Figure 16 — The Determination Overview displays general information about the node’s determination and configured triggers
From the overall list of determinations, you can navigate to the implementation class by clicking on the name of the class. This takes you to the
ABAP class editor (see Figure 17) where the code for the implementation class is executed, during which time the BOPF framework will transfer
control to the methods implementing the business object. Since the code is regular ABAP code, you can manually modify it, but following the
BOPF philosophy of standardized development, you mainly just want to enforce consistency of the business object and ensure proper error
handling. There is not much to do in the case of our product review example since these records are simply inserted into the persistent table of
product reviews in the underlying database. The corresponding SQL commands and commit work statements are executed by the BOPF
framework, meaning no manual coding is required.
Figure 17 — The source code for the BOPF implementation class
On the product detail screen that follows (Figure 20), you can enter a rating (such as 2), which populates the overview screen with the review
(see Figure 21).
Figure 20 — Add a rating for the product
Figure 21 — The completed product review overview screen with a product rating displayed
Figure 22 — Add a table function to the sales order invoice CDS view to add a field for the standard deviation
Figure 23 — The SQLScript code for implementing the standard deviation table function
The average rating and standard deviation are then computed and displayed in the overview screen (see Figure 24).
Figure 24 — The display results of the sales order invoice CDS view with fields added for the average rating and standard deviation
Summary
The example described here has demonstrated how ABAP 7.51 enables you to combine all the various technologies and artifacts that make up
the modern ABAP programming model in a simple, streamlined, and standardized way using ABAP in Eclipse (for the back-end part) and SAP
Web IDE (for the front-end part). You start with CDS views, expose them to the OData protocol, and consume them with SAP Fiori smart
templates. You add transactional services based on the BOPF framework and then create new records that can be aggregated with the help of
the many built-in functions from CDS or, if necessary, natively on SAP HANA.
To be successful, an innovative programming model must meet customer needs with the right development tools and methodologies. With its
focus on both analytical and transactional capabilities and its support for ABAP in Eclipse and SAP Web IDE, ABAP 7.51 delivers.
1 For more on SAP NetWeaver 7.5, see my SAPinsider articles “A Foundation for the Future: What’s Coming Next with SAP NetWeaver 7.5” (July-September 2015) and
“ABAP for the Modern Age: A Look at the Latest ABAP Enhancements in SAP NetWeaver 7.5” (January-March 2016), available at SAPinsiderOnline.com. [back]
2 Learn more about BOPF on SAP Community Network at http://scn.sap.com/community/abap/bopf. [back]
3 For more on CDS development, see my SAPinsider articles “Enhanced ABAP Development with Core Data Services (CDS)” (October-December 2015) and “ABAP for the
Modern Age: A Look at the Latest ABAP Enhancements in SAP NetWeaver 7.5” (January-March 2016), available at SAPinsiderOnline.com. [back]
4 For more on SAP Fiori development, see my SAPinsider articles “ABAP for the Modern Age: A Look at the Latest ABAP Enhancements in SAP NetWeaver 7.5” (January-
March 2016) and, with Monika Kaiser, “SAP Fiori Application Development in the Cloud” (April-June 2015), available atSAPinsiderOnline.com. [back]
5 The overall BOPF framework is documented in detail at the SAP Help Portal site at help.sap.com. [back]
Karl Kessler
Karl Kessler (karl.kessler@sap.com) joined SAP SE in 1992. He is the Product Manager of the SAP NetWeaver foundation — which includes
SAP NetWeaver Application Server, the ABAP Workbench, and the Eclipse-based ABAP development tools for SAP NetWeaver — and is
responsible for all rollout activities.
Source http://sapinsider.wispubs.com/Assets/Articles/2016/October/SPI-Introducing-ABAP-751