ebook img

End to End Development Example in SAP® NetWeaver 7.4 & SAP PDF

71 Pages·2014·6.21 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview End to End Development Example in SAP® NetWeaver 7.4 & SAP

End to End Development Example in SAP® NetWeaver 7.4 & SAP® HANA SAP NetWeaver 7.4 Support Package 5 Author: Jasmin Gruschke – [email protected] Target Audience ■ Developers ■ Consultants For Public usage Document version 1.00 – April, 2014 Contents 1 Remarks before you start ............................................................. 3 2 What’s inside this guide? .............................................................. 4 3 Technical Prerequisites ................................................................ 6 Check some preconditions .................................................................... 6 4 Scenario Description..................................................................... 8 Data Model ............................................................................................... 8 Full Reference Application .................................................................... 8 5 CDS View Building in ABAP ......................................................... 9 Let’s create the CDS View(s) ............................................................... 10 6 ABAP managed Database Procedures (AMDP) ......................... 15 Let’s create the AMDP .......................................................................... 15 Let’s create the AMDP… now we really start! .................................... 21 7 Gateway OData Service ............................................................. 28 Would you like to test the GW service? ............................................. 42 8 Fiori-like Application.................................................................... 45 Local SAPUI5 Application Development ............................................ 45 Import of the SAPUI5 Application to the ABAP backend ................. 54 You would like to test the Fiori-like App, right? ................................ 58 Thanks for joining… ............................................................................. 58 Appendix .......................................................................................... 59 Installation Guides................................................................................ 59 Install Eclipse ............................................................................................................. 59 Install needed Eclipse Plug-Ins .................................................................................... 59 Add an ABAP Backend Connection (SAP Logon and ADT) ............................................. 61 System Configuration & Example Data Generation .......................... 63 Generate Example Data ............................................................................................. 63 ICF Configuration ....................................................................................................... 65 Customizing for UI5 & Gateway Services ..................................................................... 67 Appendix: ADT Shortcuts .................................................................... 69 Edit ............................................................................................................................ 69 Help .......................................................................................................................... 69 Navigate.................................................................................................................... 69 Run, Debug ................................................................................................................ 69 Appendix: SAP HANA Development Guide ....................................... 70 Appendix: SAP HANA SQL Script Reference .................................... 70 2 Remarks before you start 1 Remarks before you start  This demo can be executed on an SAP NetWeaver AS ABAP 7.4 SP05 or higher running on a SAP HANA database SPS6 or higher.  All screenshots have been made in an AS ABAP system with System ID (SID) “HANAABAP” installed in the HANA Database Schema “SAPHANAABAP”. Please consider to adapt this based on the SID and schema of your system.  All ABAP Entities have been created in the “$TMP” package of the user “DEVELOPER”.  You will need a user on SAP NetWeaver AS ABAP with the following roles assigned: o SAP_BC_DWB_ABAPDEVELOPER o SAP_BC_DWB_WBDISPLAY o /IWFND/RT_DEVELOPER (For Gateway Service Development)  A dedicated HANA User is not necessary, however, in case you would like to check on created artifacts, you need a HANA user with role ABAP_DEV assigned.  The screenshots in this end-to-end guide have been created based on HANA Studio version 1.00.70 (Build id: 386119) and may differ with respect to other HANA releases.  For more details, information and guides based on SAP NetWeaver AS ABAP and SAP HANA please visit our SCN Page: http://scn.sap.com/docs/DOC-35518. 3 What’s inside this guide? 2 What’s inside this guide? This document shows you an end-to-end development example from SAP HANA via ABAP to a Fiori-like application, which will look like: On the left-hand side of the application, a list of customers is retrieved, showing the name and the ID of the customers as well as a category which depends on the number of open invoices. Selecting one of the customers from the list populates the right-hand side of the application. In the header part some more detailed information on the selected customer is shown, in particular the address information as well as the aggregated gross amount of all open invoices for this customer. In the lower part, the list of sales order invoices with their creation date and the gross amount per sales order invoice are listed. All gross amounts in the application are converted to USD. From a technical point of view, the application is based on a SAP NetWeaver OData Service comprising the entity sets for the customer list (left-hand side) and the sales order invoice list (lower right-hand side) and an entity set for the detailed customer information (upper right- 4 What’s inside this guide? hand side). While the customer list entity set is based on a CDS view, the information on the right-hand side is retrieved from ABAP-managed database procedures (AMDP). If you now say “never heard from neither CDS nor AMDP” don’t worry, you’ll get to know these objects and their features while working yourself through this end-to-end guide . 5 Technical Prerequisites 3 Technical Prerequisites To follow this end-to-end guide you need an Application Server ABAP 7.4 SP5 (or higher) on SAP HANA SPS7 and an Eclipse-based development environment including ABAP Development Tools for SAP NetWeaver as well as the UI Development Toolkit for HTML5 (SAPUI5 Tools). Concerning the backend system, the easiest method is to set up and run the developer edition of the AS ABAP 7.4, which is provided as virtual appliance by the SAP Cloud Appliance Library (see http://scn.sap.com/docs/DOC-52323). Choosing this variant, there are no additional system configuration steps. If you are working on other backend systems, please consult the system configuration steps described in the Appendix (System Configuration & Example Data Generation). Using the virtual appliance as described in the document above, you can connect to your frontend image via a remote desktop connection. On the frontend image, you can find a SAP HANA studio installation including all necessary tools (ABAP development tools, UI tools). If you prefer a local Eclipse installation, please see the Appendix (Installation Guides) or the Additional Information chapter in the mentioned SCN document. Check some preconditions As mentioned above, if you are using the AS ABAP 7.4 SP5 as virtual appliance, you don’t have to do any system configurations. However, it’s worthwhile to check some preconditions. 1. Open the SAP Logon application and check that the ABAP system (in our case the connection to application server abapci.dummy.nodomain instance number 00) is maintained. 2. In the ABAP Perspective of the SAP HANA Studio, check that the ABAP Project for the backend system mentioned in the previous step exists. The ABAP Project belongs to user 6 Technical Prerequisites DEVELOPER (client 001) and the passwort is (initially) identical to the master password of the virtual appliance instance (see http://scn.sap.com/docs/DOC-52323). 3. Please also verify that the UI Development Toolkit for HTML5 (SAPUI5 Tools) are installed, e.g. via the context menu Help > About SAP HANA Studio, where you should be able to find the SAP UI5 development toolkit with version 1.16.6. 7 Scenario Description 4 Scenario Description The scenario you are going to implement is part of the reference scenario delivered with AS ABAP 7.4. Based on the open item analysis, the scenario will give you several business figures like a simple customer classification and open invoice amounts per customer (including currency conversion). Data Model The data model you will be using consists of four tables. Each table has a primary key (datatype GUID) called NODE_KEY and the key component CLIENT. Table SNWD_BPA contains the relevant information on the business partner complemented by a 1:1 relation to the business partner address data given in table SNWD_AD. The information on sales order invoices is given in tables SNWD_SO_INV_HEAD (header data) and SNWD_SO_INV_ITEM (position/item data). The business partner table can be connected via a 1:n relation to the invoice header table field BUYER_GUID. The invoice header table can further be connected to the sales order item table in a 1:n relation using fields SNWD_SO_INV_HEAD.NODE_KEY to SNWD_SO_INV_ITEM.PARENT_KEY. One special feature of the data model is that the invoice items table contains all items of a given invoice in different currencies. Full Reference Application The scenario described here is just a small part of the full ABAP for SAP HANA reference scenario. More details can be found in transaction SEPM_OIA in your AS ABAP or on SCN http://scn.sap.com/docs/DOC-35518. 8 CDS View Building in ABAP 5 CDS View Building in ABAP As mentioned in chapter What’s inside this guide?, the final application displays a list of customers including the customer name, the customer ID, and the customer classification category. While this could be performed by fetching the data into an internal table on the application server layer and perform all necessary calculation there, we’ll follow the code-to- data paradigm, i.e. we push data-intensive calculation logic to the database layer and only fetch the (display) relevant data to the application server. More information on the code-to- data paradigm can be found in http://scn.sap.com/community/abap/hana/blog/2014/02/03/abap-for-hana-code-push-down. The task at hand could be done using advanced functionality of Open SQL (see http://help.sap.com/abapdocu_740/en/index.htm?file=ABENNEWS-740_SP05- OPEN_SQL.htm). We’ve chosen an alternative approach; we’ll make use of a new feature in the AS ABAP 7.4, namely a Core Data Services (CDS) view. In general, Core Data Services (CDS) is an enhancement of SQL which allows a simple and harmonized way for the definition and consumption of semantically rich data models natively in HANA applications – independent of the consumption technology. The enhancements compare to SQL include:  Annotations to enrich the data models with metadata  Associations on a conceptual level, replacing joins with simple path expressions  Expressions used for calculations and queries in the data model You may say: We don’t want to create a data model in this end-to-end guide, which is entirely true. However, we can make use of the advanced ABAP view building capabilities to define a CDS view, facilitating the query on the data model described in chapter Data Model. CDS views, like the well-known dictionary views created and maintained in transaction SE11, are managed by the ABAP data dictionary. During activation, a database view is created on the HANA layer, yet only the ABAP CDS view (defined in a so-called DDL source) has to be transported via the ABAP Change and Transport System (CTS). Moreover, the functionality provided by CDS views can be used on all SAP supported databases, you don’t have to worry when transporting these objects in a heterogeneous system landscape. More detailed information on CDS View building can be found in http://scn.sap.com/community/abap/eclipse/blog/2014/02/04/new-data-modeling-features-in- abap-for-hana and references therein. 9 CDS View Building in ABAP Let’s create the CDS View(s) In our development example, we’ll create two CDS view:  ZCDSV_OPEN_INVOICE, used to calculate the number of unpaid sales order invoices per customer  ZCDSV_CUST_CLASSIFICATION, used to consume ZCDSV_OPEN_INVOICE and to additionally provide the customer name and ID information For the definition of CDS views in the ABAP data dictionary, an ABAP DDL source object (R3TR DDLS) has to be created. These new objects can only be created and maintained with the ABAP Development Tools for SAP NetWeaver, the artist also known as ABAP in Eclipse, so we’ll start the task in the ABAP perspective of our SAP HANA studio: Description Screen Shot 1. In the ABAP perspective of the SAP HANA studio, right- click on the $TMP folder of your ABAP project and select New > Other ABAP Repository Object from the context menu. 2. In the creation dialog window, filter on “ddl”, select Dictionary > DDL Source and continue with Next. 10

Description:
Appendix: SAP HANA SQL Script Reference The screenshots in this end-to-end guide have been created based on HANA Studio version 1.00.70 (Build id:
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.