Technical Overview of CDS View – SAP HANA Part IAshish Saxena
SAP HANA has introduced new paradigms to SAP ABAP application programming. Before SAP HANA, development paradigm in SAP was based on DATA-to-Code where intensive calculation was done at the application layer and database utilization was minimized. New programming paradigm in SAP HANA is Code-to-Data, where the intensive calculation is done at the database layer and less programming at application layer.
Technical Overview of CDS View - SAP HANA Part IIAshish Saxena
It is very important that a developer understands that technically, CDS is an enhancement of SQL which provides a Data Definition Language (DDL) for defining semantically rich database tables/views (CDS entities) and user-defined types in the database. Unlike the SAP HANA CDS, ABAP CDS are independent of the database system. The entities of the models defined in ABAP CDS provide enhanced access functions compared with existing database tables and views defined in ABAP Dictionary, making it possible to optimize Open SQL-based applications. And it is because of these unparalleled advantages that ABAP CDS is the most preferred form of methodology when it comes to Code to Data paradigm.
Technical Overview of CDS View – SAP HANA Part IAshish Saxena
SAP HANA has introduced new paradigms to SAP ABAP application programming. Before SAP HANA, development paradigm in SAP was based on DATA-to-Code where intensive calculation was done at the application layer and database utilization was minimized. New programming paradigm in SAP HANA is Code-to-Data, where the intensive calculation is done at the database layer and less programming at application layer.
Technical Overview of CDS View - SAP HANA Part IIAshish Saxena
It is very important that a developer understands that technically, CDS is an enhancement of SQL which provides a Data Definition Language (DDL) for defining semantically rich database tables/views (CDS entities) and user-defined types in the database. Unlike the SAP HANA CDS, ABAP CDS are independent of the database system. The entities of the models defined in ABAP CDS provide enhanced access functions compared with existing database tables and views defined in ABAP Dictionary, making it possible to optimize Open SQL-based applications. And it is because of these unparalleled advantages that ABAP CDS is the most preferred form of methodology when it comes to Code to Data paradigm.
Beginner's Guide: Programming with ABAP on HANAAshish Saxena
The focus of this blog is to present an overview of the new programming techniques in ABAP after the introduction of HANA database. The focus will be towards providing a guideline on why and how an ABAP developer should start transitioning its code to use the new coding technique’s.
As an ABAP Developer, we often have to develop ABAP reports that displays some data from the database. SAP provides a set of ALV (ABAP List Viewer) function modules which can be put into use to embellish the output of a report. Object oriented ALV is more robust and is more advanced when compared to Traditional ALV.
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsGaruda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
We, Garuda Trainings are provide SAP ABAP Online Training over globe.
For More:
http://garudatrainings.com/
Mail: garudatrainings@gmail.com
Phone: +1(508)841-6144
Beginner's Guide: Programming with ABAP on HANAAshish Saxena
The focus of this blog is to present an overview of the new programming techniques in ABAP after the introduction of HANA database. The focus will be towards providing a guideline on why and how an ABAP developer should start transitioning its code to use the new coding technique’s.
As an ABAP Developer, we often have to develop ABAP reports that displays some data from the database. SAP provides a set of ALV (ABAP List Viewer) function modules which can be put into use to embellish the output of a report. Object oriented ALV is more robust and is more advanced when compared to Traditional ALV.
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsGaruda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
We, Garuda Trainings are provide SAP ABAP Online Training over globe.
For More:
http://garudatrainings.com/
Mail: garudatrainings@gmail.com
Phone: +1(508)841-6144
Azure Identity (AD,ADFS 2.0,AAD,ADB2C,OAuth,OpenID,PingID,AD Custom Policies) ,
Azure PaaS (Azure Functions, Serverless computing, Azure Comsos DB, Webhooks, API Apps, Logic Apps, Kudu, Azure Websites), Azure Functions, Lamda Function, Event Functions, Serverless architecture, Implementing azure functions on GIT HUB comment feature, Why Azure Functions, Azure Virtual Machines, Azure Cloud Services, Azure Web Apps & WebJobs, Service Fabric, Consumption Plans, Billing Model, Benefits of Azure Functions, What is serverless, Implementing bigger solutions into smaller azure functions, Microservices, Use cases, Function App, Implementation storing unstructured data using Azure functions into Cosmos DB, Cosmos DB, Custom Azure functions, Azure Cosmos DB, IOTS, Document DB, Doc DB, How to setup a Jenkins build server and automatically trigger code from Visual studio online,Azure App Service, App service Environment, Azure Stack, Managing Azure App services, Azure Powershell, Azure CLI, REST APIS, Azure Portal, Templates, Kudu Console access, Run GIT Commands on Kudu Console, Locking Azure Resources, Configuring Custom Domains, Adding Extensions to Azure Web App/Websites, App service Deployment options, Data Services in Azure , Azure SQL, Azure SQL server, Azure SQL database vs SQL server in a Azure VM, SQL Tiers, DTU, Data Transactional Unit, Planning & provisioning azure SQL databases,Migrating SQL Databases, Azure SQL Server, SQL server transactional replication, Deploy database to Microsoft Azure Database Wizard, DAC package, DAC, SQL compatibility issues, Migrating SQL with downtime, DMA, Data Migration Assistant, Database Snapshot, Migrating SQL without downtime, DTU, Data Transactional Unit, Recommendations for best performance during SQL Import Process, Transactional Replication, T-SQL, Task to implement what ever you learnt till now,
RDBMS to NoSQL: Practical Advice from Successful MigrationsScyllaDB
When and how to migrate data from SQL to NoSQL are matters of much debate. It can certainly be a daunting task, but when your SQL systems hit architectural limits or your Aurora expenses skyrocket, it’s probably time to consider the move.
See a discussion of how best to migrate data from SQL to NoSQL, and how to get heterogenous data systems to communicate with each other effectively in real time. Get important architectural considerations, tips and tricks and several real-world use cases.
From this webinar you will learn:
Key differences between RDBMS and NoSQL, and how to know when it’s time to migrate
How to harness the greatest strengths out of both classes of databases, SQL and NoSQL
Migration techniques proven in the field
Modeling differences between RDBMS and NoSQL
Managing releases in NoSQL vs RDBMS
Scylla features and services that help with migrating from a relational database
HEAP SORT ILLUSTRATED WITH HEAPIFY, BUILD HEAP FOR DYNAMIC ARRAYS.
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements.
A review on techniques and modelling methodologies used for checking electrom...nooriasukmaningtyas
The proper function of the integrated circuit (IC) in an inhibiting electromagnetic environment has always been a serious concern throughout the decades of revolution in the world of electronics, from disjunct devices to today’s integrated circuit technology, where billions of transistors are combined on a single chip. The automotive industry and smart vehicles in particular, are confronting design issues such as being prone to electromagnetic interference (EMI). Electronic control devices calculate incorrect outputs because of EMI and sensors give misleading values which can prove fatal in case of automotives. In this paper, the authors have non exhaustively tried to review research work concerned with the investigation of EMI in ICs and prediction of this EMI using various modelling methodologies and measurement setups.
Water billing management system project report.pdfKamal Acharya
Our project entitled “Water Billing Management System” aims is to generate Water bill with all the charges and penalty. Manual system that is employed is extremely laborious and quite inadequate. It only makes the process more difficult and hard.
The aim of our project is to develop a system that is meant to partially computerize the work performed in the Water Board like generating monthly Water bill, record of consuming unit of water, store record of the customer and previous unpaid record.
We used HTML/PHP as front end and MYSQL as back end for developing our project. HTML is primarily a visual design environment. We can create a android application by designing the form and that make up the user interface. Adding android application code to the form and the objects such as buttons and text boxes on them and adding any required support code in additional modular.
MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software. It is a stable ,reliable and the powerful solution with the advanced features and advantages which are as follows: Data Security.MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software.
ACEP Magazine edition 4th launched on 05.06.2024Rahul
This document provides information about the third edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
3. Our Agenda
About CDS / How to Create
Basic ABAP CDS View
Other Features ABAP CDS
HANA CDS and Native SQL
4. What is CDS?
• Core Data Services, or CDS, is a “semantically rich” Data Definition Language (or DDL)
created by SAP. It provides an easy to understand and reusable tool that ABAP
developers can utilize to execute the “code pushdown” paradigm.
• CDS comes in different flavors , a HANA version and an ABAP version:
• HANA CDS - The lesser used option for ABAP coders is HANA CDS, the database
language that can be used to create tables, views, and structures on the HANA
database itself. Views created in HANA can be consumed from the Netweaver AS
using Native SQL.
• ABAP CDS – This is the CDS flavor that will almost be exclusively used in most SAP
business software systems. ABAP CDS is usually the best choice when designing
and creating database views that will need to access the HANA database.
5. What is CDS?
• ABAP CDS, made available with SAP Netweaver 7.40 SP5, allows coders to achieve the “code-to-data”
programming paradigm using a reusable resource that can be used across different programs and
projects.
• “Code-to-data”, also sometimes referred to as “code-pushdown” is the process of moving data intensive
programming logic from the application later down to the database layer.
• CDS achieves these primarily through the use of “Views”, however the views in the context of CDS go
beyond those classical SE11 since much of the logic previously left to the programming level (i.e. ABAP
program logic) can now be outsourced to the database level.
• Although CDS performs well with the HANA database and takes advantage of many of its features, it is
actually an OPEN DDL (data definition language) language. The term Open meaning that it will work
with all traditional databases that can be used to run the latest versions of the SAP NetWeaver
products.
• An ABAP CDS file can ONLY be create within the Eclipse IDE (there is no transaction to do this from SAP
GUI). CDS files are written in an augmented form of SQL Script
10. Creating First CDS
View (Using AWS)
Opening Annotations – These declare high
level data about the CDS view:
• @AbapCatalog.sqlViewName is the only
mandatory annotation for a non-
extending CDS View source file.
• @AbapControl.authorizationCheck
specifies whether an authorization check
should be performed for the current CDS
view.
11. Creating First CDS
View (Using AWS)
Datasource Declarations-
This section will come after the opening
Annotations, but before the first curly
bracket. Within this section, the developer
specifies:
• the type of view (define or extend view)
• the CDS view name (in this case
ZJON_CDS_VIEW_EXAMPLE),
• the source table or view (SNWD_SO)
• Any parameters (more on this later)
• Any joins/associations (more on this later)
12. Creating First CDS
View (Using AWS)
Field Declarations and Specifications
• After the first curly bracket comes the
desired fields from the table, as well as
any fields that are to be computed.
• This is the section that a developer will
primarily utilize to take advantage of
code-pushdown.
• The CASE function allows a particular
value to be returned based on the value
of a table field.
• We define the field returned as
‘payment_status’. To the calling program,
there’s no difference between this
generated field and a regular database
field.
13. Creating First CDS
View (Using AWS)
Select Conditions, Restrictions, and
Grouping Declarations
The last section of the DDL source file is
where you would add any selection
restrictions (such as a where clause) in
addition to any aggregation instructions
(such as GROUP BY). We will be covering
both of these options in later examples.
14. Previewing a CDS View
• CDS Views can be previewed right within
the Eclipse editor. To do this, right-click on
the created view, select “Open With” and
then select “Data Preview” from the
submenu. (Note that in other versions of
the ABAP Development Tools, the “Data
Preview” option may appear immediately
in the menu when you right click.)
• Notice that, along with the data we have
selected from the snwd_so table, we also
have the calculated field payment_status
that was created using the CASE function.
15. What happens on the
HANA DB?
• When you create an ABAP CDS View, a
corresponding view is created on the
HANA DB matching the CDS view created
on the ABAP side.
• This view will have the SQL View name
that you provided (after the
@AbapCatalog.sqlViewName annotation)
and will be generated automatically after
you create the CDS view.
• The corresponding HANA view does not
require a separate transport to move
between HANA DBs. Once the view is
transported and executed on SAP
NetWeaver, the HANA View will be
generated automatically in the
corresponding HANA DB.
• You can view the create SQL view in
Eclipse by using the SQL HANA
Administrator Perspective (described on
the next slide).
16. What happens on the
HANA DB?
1 – Open the SAP HANA Administrator
Console
2 – Log into the HDB system (password
should be the same one for all
usernames/windows login.
3 – Open the Catalog folder
4 – Navigate to the SAPA4H schema (which
holds all tables/views for SAP NetWeaver)
5 – Click find table and type the
sqlViewName you used for your first view (or
any other CDS view you’ve created).
NOTE: Theres no requirement that his SQL
View name be the same as your CDS view
name! This SQL view name will be in the
annotations section.
17. What happens on the
HANA DB?
Double click on the SQL View name
corresponding to your CDS view, and you
should see a display with two tabs.
The first tab, Columns, displays the columns
that are available with your CDS View.
The second tab shows the SQL statement for
your view, which should look familiar. It
should be nearly identical to the CDS View
you coded on the NetWeaver side, with a few
syntax adjustments to make it compatible
with the HANA DB.
18. Using a CDS View in an
ABAP Program
Using a CDS view simply requires using an
Open SQL statement that selects from our
CDS Entity (ZJON_CDS_VIEW_EXAMPLE). As
an added benefit of ABAP CDS, a generated
CDS Entity name can also be used in DATA
declarations to create structures of a
compatible TYPE:
19. Associations
Associations are essentially reusable JOINS
that relate two CDS Entities (tables or views)
to each other. CDS Associations have the
added benefit of being able to specify
cardinality ([1..1], [0..1], [*], etc.). Many of
the features of ASSOCIATIONS are available
as JOINS, however ASSOCIATIONS are the
preferred and more elegant option when
merging two CDS entities.
20. Aggregate Functions
The aggregate functions available in CDS Views
are the same ones that are available in the new
Open SQL. Although they are readily available
during a regular Open SQL Select, it is still an
extremely useful tool to have in CDS Views.
Using the CDS approach, developers can make
certain summary data uniform across projects
and systems without having to maintain entirely
separate summary level tables. As you can see
in the above example, any time you use these
aggregate functions in the field declaration
section, you are required to include the GROUP
BY addition in the Selection Restriction and
Condition section.
Removing the GROUP BY clause while having
either of these functions remaining will raise a
syntax error, which is logical since you cannot
have summary level data item level records.
21. Aggregate Functions
The data preview shows that, instead of
showing every single SO in the system, we
are now showing the data summarized by
company.
Using our CDS View with aggregate functions
allows your us to view every company with
unpaid sales orders with gross amounts over
$500, who many of these sales orders they
have, and the total gross amount of the sales
orders.
Before HANA, a calculation like this would
require selecting all this data into an internal
table, looping through the documents one by
one, and keeping track of totals.
Using CDS/HANA we can view this data much
faster with all the work already completed
for us!
22. CDS View Parameters
• CDS Views also allow for parameters to
be used to help in building more dynamic
views.
• Parameter can be used to provide
variable conditions to search conditions
(similar to what one would achieve by
using a WHERE clause.
• Parameters can also be used to provide
values for CASE statements, arithmetic
calculations when calculating fields, and
performing other alterations to functional
operations that would not be possible
with a classical SELECT statement.
• All CDS Parameters are MANDATORY.
23. Using CDS Views with
Parameters
• To use the parameters in a SELECT
statement, you would need to use
parentheses after immediately following
the CDS View name. This is similar to how
you would pass parameters to a method
call.
• You can use variable values in the
parameters by using the ‘@’ symbol
before the variable name (which is
common the new Open SQL syntax).
• If you prefer to use hard coded strings or
values instead, the ‘@’ is not required.
24. Extending Views
• Existing CDS Views can also be
“enhanced” by creating a separate
Extend View that contains additional
fields you would like to include.
• For instance, in this example we
would like to extend our original
view ZJON_CDS_VIEW_EXAMPLE.
• To do this we create a NEW view
ZJON_VIEW_EXAMPLE_PAID_EXTND
as shown to the right.
• This will EXTEND the original view
and add the field “so_status”.
• This is useful when trying to modify
views original created by SAP with
customs fields.
25. Extending Views
The original views source code will be
modified with a familiar icon, which indicates
it has been extended by another view
26. Creating a HANA CDS
View (Prerequisite)
If you try to create a HANA CDS View with
the default settings, you will get a strange
encoding error. Update your workspace
settings BEFORE creating your HANA CDS
View (or you will have to delete it and
restart)
Follow the menu path:
Window->Preferences->General
With the general section expanded, click on
the Workspaces text.
Change your encoding from the default
cp1252 to UTF-8 (under other)
27. Creating a HANA CDS
View
• Click the New Perspective icon in the top
right of the window (to the left of the
ABAP icon)
• Locate the SAP HANA Development
perspective and hit OK.
28. Creating a HANA CDS View
2 – Click the “Systems” Tab
3- Double click the HDB system
4 – Enter your password (same as password
for everything else)
1- Ensure you are in the SAP HANA
Development Perspective(it looks very
similar to the ABAP Perspective)
29. Creating a HANA CDS View
• While still in the SAP HANA
Development Perspective, navigate to
the Project Explorer tab (you will still
see your ABAP projects listed, which is
fine)
• Right click in the white space, then
navigate to New->Project…
• Follow the menu path SAP HANA-
>Application Development then click
XS Project
• Give the project a name (for the
source code to work as provided the
name must be ZJON_CDS )
• Select the Default workspace
• Deselect the to access objects and hit
finish.
30. Creating a HANA CDS View
• Right click on the new project, the
navigate to New->Other
• Then navigate to SAP HANA->Database
Development-> DDL Source File
31. Creating a HANA CDS View
• Enter the desired name of your CDS
View (it must be ZJON_CDS for the
source code to work)
• Select the project that was just created
• Hit Finish
32. Creating a HANA CDS View
• To the right is an example CDS view.
You will notice that it does not have
the same annotations as the ABAP CDS
view.
• Instead, it does have the namespace
keyword followed by the project name.
• In addition, it has an @Schema
notation followed by the schema that
will be used (this should match the
schema that contains your database
tables, in this case SAPA4H.
• Lastly, note that the field names MUST
BE CAPITALIZED (or the code will no
compile, leaving you with a very
confusing error message)
• While this HANA CDS view is still
selected, hit the green arrow to
activate this CDS view
33. Creating a HANA CDS
View
• To utilize a HANA CDS View, a Native
SQL call is required. This is because the
ABAP Data Dictionary has no
knowledge of this view since it was
defined outside of the NetWeaver AS.
• Native SQL can be extremely finicky,
and debugging any issues can be
extremely difficult.
• Compare this code to the first CDS
view in terms of complexity,
maintainability, and flexibility. Its clear
to see why ABAP CDS is always the
better option, unless there is some
feature that is only accessible through
HANA CDS.