S4H410 SAP S/4H 4HAN ANA A Em Embe bedd dded ed Analyt Analytic ics s and Modeling with Core Data Services (CDS) Views D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
.
. PARTICIPANT HANDBOOK INSTRUCTOR-LED TRAINING
. Course Version: 04 Course Duration: 2 Day(s) e-book Duration: 6 Hours 30 Minutes Material Number: 50135541
Typographic Conventions American English is the standard used in this handbook. The following typographic conventions are also used.
This information is displayed in the instructor’s presentation
Demonstration
Procedure
Warning or Caution
Hint
Related or Additional Information
D i s c o v e r y E d i t i o n .
. n o i Facilitated Facilitated Discussion t i d E y User interface control r e v o c Window title s i D
© Copyright. All rights rights reserved.
Typographic Conventions American English is the standard used in this handbook. The following typographic conventions are also used.
This information is displayed in the instructor’s presentation
Demonstration
Procedure
Warning or Caution
Hint
Related or Additional Information
D i s c o v e r y E d i t i o n .
. n o i Facilitated Facilitated Discussion t i d E y User interface control r e v o c Window title s i D
© Copyright. All rights rights reserved.
Contents vii
Course Overview
1
Unit 1:
Introduction into VDM and CDS
2
Lesson: Virtual Data Model
8
Lesson: The Core Data Services (CDS) Views
15
Unit 2:
Required Tools
16
Lesson: Prerequisites for using CDS Views
19
Lesson: Install Eclipse and ABAP for Eclipse
24
Lesson: Connect ABAP for Eclipse to the S/4HANA System
27
Exercise 1: Getting Started with S/4HANA Application and Gateway Server
35
Exercise 2: Start SAP HANA Studio, Create a New ABAP Project, and Add yourDevelopment yourDevelopment Package Unit 3:
The Data Model Lesson: The used data model Exercise 3: Examine the Tables used in the VDM Lesson: Build a CDS view
. n o i t i d E y r e v o c s i D
Exercise 4: Create Two Simple DDL Sources Unit nit 4: 4:
Int Introducti uctio on int into o Ann Anno otati tation ons s Lesson: ABAP Annotations Lesson: Analytics Annotations Lesson: Semantics Annotations Lesson: ObjectModel Annotations Exercise Exercise 5: Adding Annotations
Unit 5:
The Basic View Lesson: Basic View Lesson: Build Basic views Exercise Exercise 6: Create the BASIC In terface Views
Unit 6:
The Composite View Lesson: Composite View Lesson: Build Composite View Exercise Exercise 7: Create the Composite Interface View
© Copyright. All rights rights reserved.
D i s c o v e r y E d i t i o n .
Unit 7: 7:
The Co Consumption Vi View Lesson: Consumption View Lesson: Create Consumption Views Exercise 8: Create the CONSUMPTION Interface View
Unit 8: 8:
CDS Vi Views in in BI BI Tools Lesson: The Query Browser Exercise 9: Use the Query Browser Lesson: Lesson: The KPI Modeler Exercise 10: Create a Fiori Tile with the KPI Design apps
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved. reserved.
Course Overview
TARGET AUDIENCE This course is intended for the following audiences: ●
Development Consultant
●
Help Desk/CoE Support
●
Technology Consultant
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.
UNIT 1
Introduction into VDM and CDS
Lesson 1
Virtual Data Model
2
Lesson 2
The Core Data Services (CDS) Views
8
UNIT OBJECTIVES ●
Understand the concept of the Virtual Data Model
●
Understand the idea behind Core Data Services (CDS)
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.
Unit 1 Lesson 1 Virtual Data Model
LESSON OBJECTIVES After completing this lesson, you will be able to: ●
Understand the concept of the Virtual Data Mo del
Virtual Data Model Business Example Your end users want to be able to query the data in the ERP system by themselves, like in a self-service Business Intelligence scenario. This data also needs to be available for several different applications. To fulfill these requirements you are designing a Virtual Data Model that gives the end users access to the data they need.
. n o i t i d E y r e v o c s i D
D i s c o v e r y E d i t i o n .
Figure 1: Virtual Data Models
SAP's focus is to create a Virtual Data Model using Core Data Services (CDS views) to support operational reporting in the context of S/4HANA (and replace all other standard ABAPrelated operational reporting). This is true for all cloud-based deliveries (public/managed) as well as our new on-premises solution shipped in Q4/2015.
© Copyright. All rights reserved.
Lesson: Virtual Data Model
Figure 2: Virtual Data Models as part of transactional systems Example: SAP S/4HANA
The advantage of this approach is full ABAP integration, allowing for re-use of existing reporting authorizations, etc. Furthermore, the a nalytical engine (built-in Business Warehouse (BW) functionality) supports elaborate hierarchy display. This allows for the creation of way more use cases for this Virtual Data Model: S/4HANA Analytics supports not only generic operational OLAP reporting, but also built-in Analytics for hybrid transactional and analytical applications (for example SAP Embedded BI or SAP Smart Business Cockpits) based on the same models. Read-access for Search/Fact Sheets is also supported. We are also planning new extractors for EDW staging into BW to create consistency between the models.
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D Figure 3: The old world
Traditionally, different applications and frontend tools used different interfaces and programs and views to retrieve data from the database. The created coding and database logic could not be reused. This meant that the developers had to reinvent the wheel over and over again, slowing down the implementation of new features, and making the process more expensive.
© Copyright. All rights reserved.
Unit 1: Introduction into VDM and CDS
Figure 4: The new world
The Virtual Data Model (VDM) represents the simplified and harmonized business oriented model. The term "Virtual" refers to the fact that the VDM may deviate from the traditional persistent model of database tables, in a way that makes it easier to understand. The VDM is a semantic model of the application data, represented in ABAP CDS views. It is stable, extensible, and available for reuse.
. n o i t i d E y r e v o c s i D
This additional layer makes it possible for the different applications and frontend tools to reuse the coding and database logic created in the Virtual Data Mo del (VDM), simplifying the implementation of new features and keeping the costs down.
Figure 5: The Virtual Data Model (VDM)
The VDM presents the business data of an SAP system as an understandable, comprehensive, and executable model for consumers in transactional and analytical applications and external Interfaces. The VDM has the following benefits:
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: Virtual Data Model
●
Improved performance
●
Extensibility
●
Security and privacy
●
Consistency
The VDM is a reusable, stable, and compatible platform for SAP internal development, partners, and customers, increasing development efficiency and fostering ease of consumption.
. n o i t i d E y r e v o c s i D
Figure 6: The Layers in the Virtual Data Model (VDM)
The key principle of the VDM is to build a semantic layer on top of the existing database model. The figure, The Layers in the Virtual Data Model (VDM) , shows a high-level view of the VDM. Technically, all views are defined as ABAP Core Data Services (CDS) views. The most important component in the VDM is the Interface view. It consists of a consistent model of reusable entity views, which focus on business semantics. Interface views are subdivided into two view types: the Basic interface views and the Composite interface views. In the top layer, the Consumption views are defined. Consumption views are created on top of Interface views, and they address specific application requirements. Different consumption domains (for example, Analytics or Search) use Interface views to consume data, or create queries to consume the data exposed by the Interface views. An important consequence of the layered architecture of the VDM view model is that database tables must not be accessed directly by consumer views of the VDM, by-passing the Interface layer. For example reports based on analytical queries (which are modeled as CDS consumption views) will select data from interface views (for instance from composite views with the analytical data category #CUBE) and not from database tables.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 1: Introduction into VDM and CDS
Figure 7: Interface Views Divided into Basic and Composite Views
Basic views are further categorized into Core Entity views, Text views, and Hierarchy views.
. n o i t i d E y r e v o c s i D
Core Entity views carry business semantics, along with all data that semantically belongs to the Core Entity. Independent from clients, Core Entity views contain the keys that represent the core entity. Core Entity views also contain the associations to all other business objects ('external relationships') and to the other directly-related BO nodes if they exist ('internal BO structure'). The Core Entity views are often used for master data like SalesOrderHeader, SalesOrderItem, CostCenter, ControllingArea. Text views contain language-dependent texts for a specific business entity. Hierarchy views contain hierarchy nodes (including parent/child assignments) for a specific business entity.
Figure 8: How the Analytical Engine uses Analytical Query and View
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: Virtual Data Model
The Core Data Services (CDS) view represents the Analytical Query that serves as the metadata description for the Analytical Engine. The Analytical Engine knows the dimensions views by analyzing the associations in the Analytical View. The corresponding SQL view is NOT executed by the A nalytical Engine and should not be called by other consumers. The Analytical View assembles all measures and dimensions that might reasonably be used in a certain type of query. The Analytical Views also contain all associations to referenced dimension views. No additional joins can be defined in the Analytical Query in the current setup.
. n o i t i d E y r e v o c s i D
Figure 9: View Categorization for Analytics via Analytical Engine
SAP aims to deliver cubes (also known as Analytical views) as interface views and consequently as part of the public and stable VDM. Nevertheless, specific applications may not want to grant general availability for their cubes, and so would deliver cubes as part of the Consumption views. The figure, View Categorization for Analytics via Analytical Engine , shows two analytical queries. Query 1 is based on a cube view. The data is read from the cube via Open SQL, and the additional master data is read from the master data view. So these are two reads on the database. Query 2 only needs some master data for some reporting on the master data. This data is read directly from the Master Data view. The Analytical engine reads additional data for all dimension views that are contained in the Analytical Queries. LESSON SUMMARY
You should now be able to: ●
Understand the concept of the Virtual Data Mo del
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 1 Lesson 2 The Core Data Services (CDS) Views
LESSON OBJECTIVES After completing this lesson, you will be able to: ●
Understand the idea behind Core Data Services (CDS)
The Core Data Services (CDS) Business Example Your company wants to use the SAP S/4HANA Core data Services (CDS) view technology. Now your developers need to gain insight in the concept and structure of CDS views as well as the syntax.
Core Data Services (CDS)
. n o i t i d E y r e v o c s i D
●
Core Data Services is SAP’s strategic modeling approach for Business Entities.
●
SAP HANA views are created from scripted ABAP code.
●
CDS is highly flexible for further multiple use cases (for example, Search).
●
CDS is Scripted (SQL with extensions).
●
CDS is fully integrated with ABAP: Lifecycle, Authorization Management, and so on.
SAP HANA supports SQL as a means to define, read, and manipulate data. On top of SQL, many technologies introduce higher-level models to add semantics and ease of consumption, for example, OData EDM models, the semantic layer in the BI platform, JPA and enterprise objects in Java, and the b usiness objects frameworks in ABAP. Those higher-level models share many similarities, but are usually specific to their technology. This prevents their re-use across stacks, and increases effort for application developers. To address this, SAP introduces a set of domain-specific languages (DSL) and services called Core Data Services for defining and consuming semantically rich data models. CDS are to be supported by several SAP platforms. They are an integral part of SAP HANA, and can be leveraged in the ABAP stack. CDS in ABAP supports the code pushdown to the database layer and simplifies the consumption of relational data models by means of ‘view entities’ in ABAP. You can now define semantically rich data models in DDL Source objects which are integrated in the ABAP Dictionary. The code pushdown is supported through extended view functionalities such as UNION, UNION ALL, and association, which are not provided in Open SQL. Nested views, where one view consumes another view, are supported. Associations between view entities can be defined and used within WHERE-clause as well as within expressions. CDS is fully integrated in the ABAP infrastructure and Open SQL can be used on view entities. ABAP CDS are available on all databases The entities of these models provide enhanced
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: The Core Data Services (CDS) Views
access functions, compared to existing database tables and views defined in the ABAP Dictionary, making it possible to optimize Open-SQL-based applications.
Lifecycle and Database Support The best part about DDL sources and CDS entities is that they are managed by ABAP. This means that the entire lifecycle of the CDS entities are controlled by the ABAP Change and Transport System (CTS). In addition, the SP5 CDS features are "open". This means that your CDS view definitions can be deployed on any database that is supported by SAP.
. n o i t i d E y r e v o c s i D
Figure 10: CDS Enhancements
The release of SAP NW ABAP 7.4 SP5 brings the first installment of CDS support in ABAP. This provides you with advanced view building features, which you can use to optimize your data models. The new CDS tooling is only available in ABAP in Eclipse. ABAP Development Tools for Eclipse (ADT) 2.19 is a prerequisite. New features of ABAP in Eclipse include: ●
DDL source file creation
●
Definition viewing
●
Data source joining
●
Aggregations and SQL functions
●
Semantically rich data models
●
Extensibility
Domain Specific Languages Core Data Services are a collection of domain-specific languages (DSLs) and services for defining and consuming semantically rich data models in a simplified way, regardless of the technology used.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 1: Introduction into VDM and CDS
Figure 11: A Family of Domain Specific Languages
Data Definition Language (DDL) CDS provides an optimized programming model for all application domains, for example, transactional and analytical. Technically, it is an enhancement of SQL. It provides you with a data definition language (DDL) for defining semantically rich database tables/views (CDS entities) and user-defined types in the database. The enhancements include:
. n o i t i d E y r e v o c s i D
●
Annotations to enrich the data mode ls with additional (domain specific) metadata
●
Associations on a conceptual level, replacing joins with simple path expressions in queries
●
Expressions used for calculations and queries in the data model
●
CDS is supported natively in both the ABAP and the HANA Platforms. You can finally define and consume your data models in the same way (syntax, behavior, etc.) regardless of the SAP technology platform (ABAP or HANA).
Query Language (QL) CDS entities can be consumed in ABAP programs using the Open SQL query language. Open SQL has been extended to provide support for CDS entities. In addition, it is possible to query the CDS features supported by the underlying database before executing the Open SQL statement to enable a lternative implementations.
Data Control Language (DCL) The DCL (Data Control Language) is used to define authorizations for CDS entities in a modeled, declarative way. The ABAP CDS authorization concept makes it p ossible to check the authorization of a user for the ABAP CDS entities as specified by the underlying data model. The CDS authorization concept is new, but it co-exists with the classic authorization concept. It can be used independently or in combination with the classic concept. With the classic authorization concept, which is based on authorization objects, the authorizations are checked either implicitly (for example, when transactions are called) or explicitly (using the statement AUTHORITY-CHECK). The CDS authorization concept is based on implicit checks, automatically performed by the ABAP r untime when the CDS entity is accessed using Open SQL.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: The Core Data Services (CDS) Views
Data Definition Language (DDL) Syntax Rules Table 1: Data Definition Language (DDL) Syntax Rules ●
●
●
●
●
●
●
. n o i t i d E y r e v o c s i D
●
●
●
●
© Copyright. All rights reserved.
Must be all uppercase, all lowercase, or in lowercase with an uppercase initial letter. Other mixes of uppercase and lowercase are not allowed. Names are not case-sensitive. A name can have a maximum of 30 characters. A name can consist of letters, numbers, underscores (_), and slashes (/). A name must start with a letter, slash character, or underscore. Underscores are recommended as the naming convention for associations. The separator for names with multiple parts is a period (.). Names with multiple parts can be paths, columns with a prefixed data source, and annotations. The following CDS keywords cannot be used as names: ALL, AND, AS, ASSOCIATION, AVG, CASE, CAST, CROSS, COUNT, DISTINCT, EXISTS, EXTEND, FROM, FULL, GROUP, HAVING, INNER, JOIN, KEY, LEFT, MAX, MIN, NOT, NULL, ON, OR, ORDER, RIGHT, SELECT, SUM, UNION, VIEW, WHEN, WHERE Numeric literals must always be specified in full and a decimal point (.) used as a decimal separator if necessary. Character literals are enclosed in single quotation marks ('). Two forward slashes (//) or two hyphens (--) introduce a comment, which continues until the end of the line. Comments within lines or that span multiple lines are enclosed by the characters /* and */. Statements can be closed using a semicolon (;). This is optional. Certain keywords are protected and cannot be used as self-defined names. The reserved names that cannot be used are specified in the database table TRESE.
D i s c o v e r y E d i t i o n .
Unit 1: Introduction into VDM and CDS
Note: ●
●
The closing semicolon after a statement is optional because one piece of CDS source code can currently only contain a single statement. SELECT, select, and Select are all valid ways of specifying a keyword. seLect and SeLect, on the other hand, p roduce syntax errors.
●
●
MYVIEW , myview, and myView all identify the same operand. 0.5 is a valid numeric literal, but .5 is not.
More information on the General ABAP CDS Syntax rules can be found here: https:// help.sap.com/abapdocu_750/en/abencds_general_syntax_rules.htm
Data Definition Language (DDL) Syntax Rules ― Key Words and Additions
. n o i t i d E y r e v o c s i D
DEFINE VIEW ... AS
Defines a CDS view
WITH PARAMETERS
Defines input parameters of a CDS view
SELECT [DISTINCT] ... FROM
SELECT statement of a CDS view
INNER JOIN ... ON
Inner join in a SELECT statement
LEFT|RIGHT OUTER JOIN ... ON
Outer join in a SELECT statement
ASSOCIATION ... TO ... AS ... ON
Defines an association for a path expression in a SELECT statement
1:
Attribute of a path expression
INNER ... WHERE
Attribute of a path expression
LEFT OUTER ... WHERE
Attribute of a path expression
KEY ... AS
Element of a SELECT list
$EXTENSION.*
Elements of an enhancement in a SELECT list
WHERE ...
WHERE clause of a SELECT statement
GROUP BY ...
GROUP-BY clause of a SELECT statement
HAVING ...
HAVING clause of a SELECT statement
UNION ALL ...
UNION clause of a SELECT statement
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: The Core Data Services (CDS) Views
Data Definition Language (DDL) Syntax Rules ― Expressions
MAX, MIN, AVG, SUM, COUNT
Aggregate expression in a SELECT statement
+, -, *, /
Arithmetic expression in a SELECT statement
CASE, WHEN, THEN, ELSE, END
Case distinction in a SELECT statement
CAST
Cast expression in a SELECT statement
=, <>, <, >, <=, > =, BETWEEN, LIKE, IS NULL, Relational expression in a SELECT statement NOT, AND, OR
Data Definition Language (DDL) Syntax Rules ― Predefined Functions
. n o i t i d E y r e v o c s i D
Function
Meaning
ABS, CEIL, DIV, DIVISION, FLOOR, MOD, ROUND
Numeric function in a SELECT statement
CONCAT, CONCAT_WITH_SPACE, INSTR, LEFT, LENGTH, LPAD, LTRIM, REPLACE, RIGHT, RPAD, RTRIM, SUBSTRING
String function in a SELECT statement
BINTOHEX, HEXTOBIN
Byte string function in a SELECT statement
COALESCE
Coalesce function in a SELECT statement
UNIT_CONVERSION, CURRENCY_CONVERSION, DECIMAL_SHIFT
Conversion functions in a SELECT statement
DATS_IS_VALID, DATS_DAYS_BETWEEN, DATS_ADD_DAYS, DATS_ADD_MONTHS
Date function in a SELECT statement
TIMS_IS_VALID
Time function in a SELECT statement
TSTMP_IS_VALID, TSTMP_CURRENT_UTCTIMESTAMP, TSTMP_SECONDS_BETWEEN, TSTMP_ADD_SECONDS
Time stamp function in a SELECT statement
More information on the ABAP CDS Language Elements can be found here: https:// help.sap.com/abapdocu_750/en/abencds_language_elements.htm
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 1: Introduction into VDM and CDS
Data Definition Language (DDL) Syntax Rules ― Key Words and Additions
EXTEND VIEW ... WITH
Enhancement of a CDS view with an CDS view enhancement
More information on the ABAP CDS Language Elements can be found here: https:// help.sap.com/abapdocu_750/en/abencds_language_elements.htm
LESSON SUMMARY You should now be able to: ●
Understand the idea behind Core Data Services (CDS)
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.
UNIT 2
Required Tools
Lesson 1 Prerequisites for using CDS Views
16
Lesson 2 Install Eclipse and ABAP for Eclipse
19
Lesson 3 Connect ABAP for Eclipse to the S/4HANA System
24
Exercise 1: Getting Started with S/4HANA Application and Gateway Server
27
Exercise 2: Start SAP HANA Studio, Create a New ABAP Project, and Add
35
yourDevelopment Package
. n o i t i d E y r e v o c s i D
UNIT OBJECTIVES ●
Name the prerequisites for using the ABAP Development Tools (ADT)
●
Install Eclipse and ABAP for Eclipse
●
Connect ABAP for Eclipse to the S/4HANA System
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 2 Lesson 1 Prerequisites for using CDS Views
LESSON OBJECTIVES After completing this lesson, you will be able to: ●
Name the prerequisites for using the ABAP Development Tools (ADT)
Prerequisites for Using CDS Views Business Example You want to create and maintain ABAP Core Data Service (CDS) views. Therefore you need to install Eclipse and the ABAP Development Tools (ADT). Your first task is to make sure that your IT system has all the prerequisites in place.
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D Figure 12: ABAP Development Tools (ADT) for Eclipse Architecture
ABAP Development Tools provides the following: ●
A brand new ABAP development experience on top of the Eclipse platform
●
An open platform for developing new A BAP-related tools
●
A set of open, language- and platform-independent APIs that developers can use to build new custom tools for the ABAP environment
With ABAP Development Tools in Eclipse you can capitalize on the usability, speed, and flexibility of Eclipse, while also benefitting from proven ABAP Workbench features. It's the best of both worlds. ADT improves developer productivity by offering better refactoring functionality, code completion, auto-insertion, and code templates. It also includes an invaluable Quick Fix feature, and it is highly navigable. ADT allows you to connect to multiple ABAP systems, and provides session failover, reducing the impact of lost connections. It also en ables cross-platform development by integrating ABAP and non-ABAP development tools in a single powerful IDE. In addition, ADT is tightly
© Copyright. All rights reserved.
Lesson: Prerequisites for using CDS Views
integrated with Eclipse (SAP HANA Studio can also be used), SAP UI5 tools, and JAVA. The architecture of ABAP Development Tools for SAP NetWeaver is an architecture designed for ease of use and flexibility. It is designed so that developers use a single Eclipse client, installed locally, that connects to several ABAP back-end systems of different releases using an RFC/REST-based protocol. This allows developers to control all activities in a central location and helps avoid timeconsuming context switches. The client provides a set of standard Eclipse development tools, such as the project explorer for system browsing and search views.
. n o i t i d E y r e v o c s i D
Figure 13: ABAP Development Tools (ADT) in Eclipse: Native in Eclipse vs. Integrated SAP GUI
The ABAP CDS views are in the ABAP system, but you need Eclipse and the ABAP Development Tools (ADT) to process the DDL sources. The advantage of this is that you can use the user-friendly Eclipse Integrated Development Environment together with the SAP ABAP lifecycle management tools like version control and the transport system.
ABAP Development Tools (ADT) ― Testing Environments The ABAP Development Tools (ADT) are tested and supported on the following environments:
●
●
© Copyright. All rights reserved.
Windows 7 and 8 Linux (SUSE, Red Hat, Ubuntu LTS, HP-UX, IBM AIX, and Oracle Solaris)
●
Apple Mac OS X (64 bit)
●
Oracle JRE/SDK 7 or 8 for Windows, Linux, or Apple Mac
●
IBM JRE/SDK 7 or 8 for Windows, Linux, or Apple Mac
●
Open JDK 7 for Red Hat
D i s c o v e r y E d i t i o n .
Unit 2: Required Tools
●
Eclipse 4.5 (Mars)
●
Eclipse 4.4 (Luna)
●
Windows: SAP GUI for Windows
●
Linux or Apple Mac: SAP GUI for Java
LESSON SUMMARY You should now be able to: ●
Name the prerequisites for using the ABAP Development Tools (ADT)
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.
Unit 2 Lesson 2 Install Eclipse and ABAP for Eclipse
LESSON OBJECTIVES After completing this lesson, you will be able to: ●
Install Eclipse and ABAP for Eclipse
Install Exclipse and ABAP for Eclipse Business Example You need to install Eclipse and ABAP Development Tools (ADT) so that the developers in your company can create and maintain the A BAP Code Data Service (CDS) views that are required in your company.
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D Figure 14: Installation Eclipse 4.5 (Mars)
The easiest way to install Eclipse 4.5 (Mars) is to use the Eclipse installer. The installer is available on the Eclipse website. The ABAP Development Tools (ADT) require (at a minimum) Eclipse IDE for Java Developers. The installation steps are as follows: ●
Download the Eclipse installer here: http://www.eclipse.org/downloads .
●
Start the Eclipse Installer.
●
Select Eclipse IDE for Java Developers.
●
Accept the Eclipse Foundation Software User Agreement.
●
Wait for the installation to complete.
© Copyright. All rights reserved.
Unit 2: Required Tools
●
Start Eclipse using the LAUNCH button.
●
In the Workspace Launcher, accept the default workspace.
●
The Eclipse 4.5 installation is complete.
Figure 15: Eclipse 4.5 Getting Started ― Choosing a Workspace
Eclipse will ask for a "Workspace" location when you start it for the first time. The workspace contains a collection of Eclipse specific resources. From the user's perspective, there are three different types of resources: projects, folders, and files. All stored in the location you select during that first startup.
. n o i t i d E y r e v o c s i D
Select the Use this as the default and do not ask again checkbox to set the selected Workspace as the default location. If necessary this can later be changed via the path: Window Preferences General Startup and Shutdown Workspaces . →
→
→
→
Figure 16: Install the ABAP Development Tools (ADT)
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: Install Eclipse and ABAP for Eclipse
The ABAP Development Tools (ADT) can be installed by adding a software repository. All of the Eclipse SAP tools are hosted on the website: https://tools.hana.ondemand.com . To add a new software repository in Eclipse, perform the following steps: ●
Choose Help
●
Choose Add.
●
●
→
Install New Software .
In the Add Repository window, enter a meaningful name and the location: https:// tools.hana.ondemand.com/mars . Press OK.
Now the new software repository is scanned for available software.
. n o i t i d E y r e v o c s i D
Figure 17: Install the ABAP Development Tools (ADT)
As soon as repository scan is finished, the Available Software is shown. To install the ABAP Development Tools (ADT), proceed with the following steps: ●
Select the ABAP Development Tools for SAP NetWeaver and choose Next.
●
Review the Installation Details and choose Next.
●
Accept the terms of the license agreements.
●
Press Finish to start the installation.
●
When the installation completes, restart Eclipse to finish the installation of the ABAP Development Tools (ADT).
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 2: Required Tools
Figure 18: Open the ABAP for Eclipse perspective
By default, Eclipse will start with the Java development perspective, but this can be easily changed to the ABAP for Eclipse perspective. To open the ABAP for Eclipse perspective, perform the following steps:
. n o i t i d E y r e v o c s i D
●
Click the Open Perspective button.
●
Select the ABAP perspective.
●
Choose OK.
To make sure that the ABAP for Eclipse perspective is opened by default perform the following steps: ●
Select the Java Development button and open the context menu with a right mouse click.
●
In the context menu, choose Close.
●
Restart Eclipse to save these settings.
The software used for the ABAP Development Tools (ADT) is available on different locations. Please use the following download locations as these are the official download locations. These download locations will contain the newest patch levels of the applications. Always check with your local IT department if you are allowed to install and use these tools. ●
●
Download Java SE8 JDK here: http://www.oracle.com/technetwork/ java/javase/ downloads/index.html Download Eclipse IDE for Java Developers version 4.5.2 (Mars 2) here: https:// www.eclipse.org/downloads/packages/release/Mars/2
●
Download ABAP Development Tools (ADT) here: https://tools.hana.ondemand.com/mars
●
Download SAP GUI 7.40 here: https://launchpad.support.sap.com/#/softwarecenter
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: Install Eclipse and ABAP for Eclipse
Note: ●
●
●
●
The Java SE8 JDK is required for runn ing Eclipse 4.5.2 (Mars 2) and the SAP ADT tools. Download the latest Java SE8 JDK version without the NetBeans as we will use Eclipse as an Integrated Development Environment (IDE). On the time of publishing (June 2016) the current ABAP Development Tools (ADT) support Eclipse 4.5.2 (Mars 2) and n ot Eclipse 4.6 (Neon). Ensure that you download the correct version as given above. Also you only need the package Eclipse IDE for Java Developers. The ABAP Development Tools (ADT) don't n eed to be downloaded separately, as you will configure Eclipse to use the URL https:// tools.hana.ondemand.com/mars as a new software site. The SAP GUI version 7.40 needs to be installed as well. Go to the SAP Software Download Center URL and follow the path: By Category SAP Frontend Components SAP GUI for Windows for S/4 SAP Gui for Windows S/4 7.40 Installation. Select and download the newest version and install it. →
→
→
→
LESSON SUMMARY
You should now be able to: ●
Install Eclipse and ABAP for Eclipse
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.
Unit 2 Lesson 3 Connect ABAP for Eclipse to the S/4HANA System
LESSON OBJECTIVES After completing this lesson, you will be able to: ●
Connect ABAP for Eclipse to the S/4HANA System
Connect ABAP for Eclipse to the S/4HANA System Business Example You have just installed Eclipse and ABAP Development Tools (ADT) and you now need to start an ABAP Project so that you can create and maintain the ABAP Core Data Services (CDS) views in your S/4HANA system.
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
Figure 19: The S/4HANA Training Landscape
The figure, The S/4HANA Training Landscape , shows the SAP S/4HANA used in the SAP Education landscape. The landscape contains an S/4HANA system called T41, a nd an SAP NetWeaver 7.50 system called T4N as a Gateway server for Odata and the SAP Fiori user interface. Later in the course you will create ABAP Core Data Services (CDS) views in the S/4HANA system (T41). Later these CDS Views will be connected to tiles in the SAP Fiori user interface.
© Copyright. All rights reserved.
Lesson: Connect ABAP for Eclipse to the S/4HANA System
You will use a browser to look at the created tiles and work with the data provided by the CDS views. The required hostnames, usernames, and password will be provided in the exercises.
Figure 20: Create an ABAP project in Eclipse (1)
To be able to create Core Data Services (CDS) views, the ABAP Development Tools (ADT) in Eclipse need to be connected to an SAP S/4HANA system. A connection to an SAP S/4HANA system needs to be defined in an ABAP Project in Eclipse.
. n o i t i d E y r e v o c s i D
In Eclipse the ABAP Project is used to specify the ABAP logon information to the SAP S/ 4HANA. This information can be retrieved from the SAP Logon, so you don't need to fill in all the connection-specific information.
Figure 21: Create an ABAP project in Eclipse (2)
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 2: Required Tools
In Eclipse, the ABAP project requires the S/4HANA logon information. Enter the ABAP client, user, password, and language to connect to the ABAP system. When the information is correct, the Project Explorer shows the ABAP project in the overview. In the Project Explorer , you can navigate to the System Library and have a look into all of the objects in the ABAP Repository. There is also a Favorite Packages folder that shows the different packages that you are working with. It is possible to add additional packages here. After closing Eclipse, it might be necessary for you to re-enter your credentials.
. n o i t i d E y r e v o c s i D
Figure 22: What About Transaction SE80?
The Core Data Service (CDS) views are stored in the ABAP S/4HANA system, but you need Eclipse and the ABAP Development Tools (ADT) to process the DDL sources.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 2 Exercise 1 Getting Started with S/4HANA Application and Gateway Server
Business Example Before you can start creating Core Data Services (CDS) views, you need to check if you have access to the correct S/4HANA system and frontend server. You also need to add the required roles to start the Fiori Launchpad.
Note: is the placeholder for the group number that the instructor assigned to you.
Use Remote Desktop Connection (RDP) to logon to the S/4HANA training system landscape based on the information provided by the trainer.
. n o i t i d E y r e v o c s i D
Log on to the S4/HANA ABAP backend Application Server following credentials.
with SAP GUI, using the
System
T41
Client
400
User name
S4H410## (don’t forget the before ##)
Password
Welcome1
Logon Language
EN
Write down the version information in the table below.
S/4HANA database SAP HANA database S4CORE SAP_BASIS SAP_GWFND (SAP Gateway)
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 2: Required Tools
Open the system status and check and write down the SAP S/4HANA software components and SAP HANA database version.
Create an ABAP development package. Start the transaction SE80 and create an ABAP development package ZS4H410-## below package ZS4H410. To create the package, use the date in the following table:
Package
ZS4H410-##
Short Description
Package S4H410-##
Application Component
CA
Software Component
HOME
Transport Layer
ZT41
Superpackage
ZS4H410
Package Type
Development Package
Log on to the Gateway server, check the SAP NetWeaver component and SAP ASE database version, and add the required roles to your user account Log on to S4/HANA ABAP Gateway and Webdispatcher Application Server T4N with SAP GUI, using the following information:
. n o i t i d E y r e v o c s i D
System
T4N
Client
001
User name
S4H410## (don’t forget the before ##)
Password
Welcome1
Logon Language
EN
Open the system status and check and write down the SAP NetWeaver Software Components and SAP ASE database version in the following table:
SAP NetWeaver SAP ASE database SAP_BASIS (SAP Basis Component) SAP_UI (User Interface Technology) SAP_GWFND (SAP Gateway)
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: Connect ABAP for Eclipse to the S/4HANA System
Start the transaction SU01 and add the following best practice roles to your user S4H410##.
ZSE_SAP_BR_ANALYTICS_SPECIALIS
Analytics Specialist
ZSE_SAP_BR_CONTROLLER
Controller
ZSE_SAP_BR_SALES_MANAGER
Sales Manager
Launch the SAP Fiori Launchpad Start SAP Fiori Launchpad S4H400 and S4H410 from the SAP Easy Access screen, and log on using the following details:
User name
S4H410## (don’t forget the before ##)
Password
Welcome1
Logon Language
EN
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.
Unit 2 Solution 1 Getting Started with S/4HANA Application and Gateway Server
Business Example Before you can start creating Core Data Services (CDS) views, you need to check if you have access to the correct S/4HANA system and frontend server. You also need to add the required roles to start the Fiori Launchpad.
Note: is the placeholder for the group number that the instructor assigned to you.
. n o i t i d E y r e v o c s i D
Use Remote Desktop Connection (RDP) to logon to the S/4HANA training system landscape based on the information provided by the trainer. Choose the Windows button and enter Remote Desktop Connection In the Remote Desktop window, enter the name of the server (specified by your instructor). Choose Connect. In the target system logon page, choose Use another account. Enter your Remote Desktop user name ( train-##) and password ( initial), and choose OK. Log on to the S4/HANA ABAP backend Application Server following credentials.
with SAP GUI, using the
System
T41
Client
400
User name
S4H410## (don’t forget the before ##)
Password
Welcome1
Logon Language
EN
Choose SAP Logon from the Windows task bar. Double click the system connection T41. In the SAP GUI logon screen, type in your user credentials as shown in the table.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: Connect ABAP for Eclipse to the S/4HANA System
Write down the version information in the table below.
S/4HANA database SAP HANA database S4CORE SAP_BASIS SAP_GWFND (SAP Gateway)
Open the system status and check and write down the SAP S/4HANA software components and SAP HANA database version. Go to the main menu, choose System HANA database version.
→
Status. Write down the S/4HANA and SAP
Choose Component in the SAP System Data area, and write down the software component versions. Choose Continue twice to return to the main screen.
Create an ABAP development package.
. n o i t i d E y r e v o c s i D
Start the transaction SE80 and create an ABAP development package ZS4H410-## below package ZS4H410. To create the package, use the date in the following table:
Package
ZS4H410-##
Short Description
Package S4H410-##
Application Component
CA
Software Component
HOME
Transport Layer
ZT41
Superpackage
ZS4H410
Package Type
Development Package
Start the transaction SE80. In the Object Navigator, choose the Repository Browser and choose Package in the drop-down box. Enter the package name ZS4H410-## in the input field below the drop-down box and choose Enter. In the Create Pack. dialog box choose Yes. In the Create Package window, enter the details shown in the table and choose Continue.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 2: Required Tools
In the Prompt for transportable Workbench request dialog box choose Create Request . In the Create Request window enter a short description, for example, S4H410–## Objects. Choose Save, then choose Continue, and then Back.
Log on to the Gateway server, check the SAP NetWeaver component and SAP ASE database version, and add the required roles to your user account Log on to S4/HANA ABAP Gateway and Webdispatcher Application Server T4N with SAP GUI, using the following information:
System
T4N
Client
001
User name
S4H410## (don’t forget the before ##)
Password
Welcome1
Logon Language
EN
Choose SAP Logon from the Windows task bar. Double click the system connection T4N. In the SAP GUI logon screen enter your user credentials.
. n o i t i d E y r e v o c s i D
Open the system status and check and write down the SAP NetWeaver Software Components and SAP ASE database version in the following table:
SAP NetWeaver SAP ASE database SAP_BASIS (SAP Basis Component) SAP_UI (User Interface Technology) SAP_GWFND (SAP Gateway)
Go to the main menu and select System SAP ASE database version.
→
Status. Write down the SAP NetWeaver and
Choose Component in the SAP System Data area, and write down the software component versions. Choose Continue twice to return to the main screen. Start the transaction SU01 and add the following best practice roles to your user S4H410##.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: Connect ABAP for Eclipse to the S/4HANA System
ZSE_SAP_BR_ANALYTICS_SPECIALIS
Analytics Specialist
ZSE_SAP_BR_CONTROLLER
Controller
ZSE_SAP_BR_SALES_MANAGER
Sales Manager
Start the transaction SU01. Enter your user S4H410-## . Choose Change Select the Roles tab. In the Role Assignment area in Role column, enter the technical names of the roles from the table. Choose Save and then Back.
Launch the SAP Fiori Launchpad Start SAP Fiori Launchpad S4H400 and S4H410 from the SAP Easy Access screen, and log on using the following details:
. n o i t i d E y r e v o c s i D
User name
S4H410## (don’t forget the before ##)
Password
Welcome1
Logon Language
EN
In the SAP Easy Access screen for S4H410-##, choose SAP Fiori Launchpad S4H400 and S4H410 (at the bottom of the list). If the browser choice windows appears choose Internet Explorer. Log on with the credentials in the table. Get an overview of the available SAP Fiori Tiles.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 2: Required Tools
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.
Unit 2 Exercise 2 Start SAP HANA Studio, Create a New ABAP Project, and Add yourDevelopment Package
Business Example Before you can start the project to create several Core Data Services (CDS) views, you need to check if you have access to the SAP HANA Studio and can use the ABAP Development Tools (ADT) to create a new project.
Note: is the placeholder for the group number that the instructor assigned to you.
Start the SAP HANA Studio, and log on using the details in the following table:
. n o i t i d E y r e v o c s i D
Client
400
User name
S4H410## (don’t forget the before ##)
Password
Welcome1
Language
EN
Create a new ABAP project system connection to the T41 system. Open the new project a nd add your ABAP development package ZS4H410-##.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Unit 2 Solution 2 Start SAP HANA Studio, Create a New ABAP Project, and Add yourDevelopment Package
Business Example Before you can start the project to create several Core Data Services (CDS) views, you need to check if you have access to the SAP HANA Studio and can use the ABAP Development Tools (ADT) to create a new project.
Note: is the placeholder for the group number that the instructor assigned to you.
Start the SAP HANA Studio, and log on using the details in the following table:
. n o i t i d E y r e v o c s i D
Client
400
User name
S4H410## (don’t forget the before ##)
Password
Welcome1
Language
EN
Start SAP HANA Studio by selecting the SAP HANA Studio icon from the task bar In the StartUpTool ― Hana Studio window, choose Submit. In the Workspace Launcher window, choose OK. In the Secure Storage ― Password Hint Needed window, choose No. Create a new ABAP project system connection to the T41 system. In SAP HANA Studio choose Window Perspective Perspective Other... ABAP, and choose OK. →
→
→
Open
→
Close the Welcome view. Choose File
→
New
→
ABAP Project .
In the New ABAP Project window, choose Browse . In the Select Existing System window, select T41[SPACE] and choose OK. Choose Next. Enter the logon information given in the table above and choose Finish.
© Copyright. All rights reserved.
D i s c o v e r y E d i t i o n .
Lesson: Connect ABAP for Eclipse to the S/4HANA System
Open the new project a nd add your ABAP development package ZS4H410-##. In the Project Explorer double-click your T41_400_s4h410## project. Double click on Favorite Packages . In this folder you will see the $TMP ― S4H410##
package . To add your ABAP development package, right-click the Favorite Packages folder to open the context menu and c hoose Add a Package…. Enter ZS4H410-## into the input field, select your package, and choose OK.
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.
Unit 2: Required Tools
LESSON SUMMARY You should now be able to: ●
Connect ABAP for Eclipse to the S/4HANA System
D i s c o v e r y E d i t i o n .
. n o i t i d E y r e v o c s i D
© Copyright. All rights reserved.