Abap On Hana

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

SAP FIORI

------------------------------------------------------------------------------------------------------------------

From CDS Views to Fiori Apps:


Simplifying Integration in SAP Landscapes
From CDS Views to Fiori Apps: Simplifying Integration in SAP
Landscapes

Table of Contents
From CDS Views to Fiori Apps: Simplifying Integration in SAP Landscapes .....................1
CDS View ......................................................................................................................1
Output.............................................................................................................................................. 3
Create Service Definition .................................................................................................................. 4
Create Service Binding ..................................................................................................................... 5
Check Added Service in Tcode /IWFND/MAINT_SERVICE ................................................................. 6
Execute SAP Gateway Client............................................................................................................. 6
OData Link ....................................................................................................................................... 6

Login to BTP .................................................................................................................7


Open Command Palette ................................................................................................................... 7
Fiori:Open Application Generator ..................................................................................................... 7
Select the Template:List Report Page ............................................................................................... 8
Connect to an OData Service ........................................................................................................... 8
Provide S4HANA Login Credentials ................................................................................................... 9
Entity Selection ................................................................................................................................ 9
Project Attributes ........................................................................................................................... 10
Application Information .................................................................................................................. 10
Preview Application ........................................................................................................................ 11
Preview Application with NPM Scripts ............................................................................................ 11
Run Fiori with S4HANA Login Credentials ....................................................................................... 11
Select Fiori Column ........................................................................................................................ 12
Final Fiori Output ............................................................................................................................ 12

Key Takeaways ............................................................................................................ 13


Personal messages from my end .................................................................................................... 13

CDS View
For a detailed explanation of the following CDS view, please refer to my previous
post. I utilized multiple left outer joins in the CDS view to generate a more
comprehensive and meaningful report for our learners .Be sure to follow SAP’s best
practices to address performance issues. This example highlights the power of CDS
views and their seamless integration with

• S/4HANA Fiori,
• SAP Datasphere and
• SAP Analytics Cloud,

demonstrating their efficiency and effectiveness in modern SAP Landscapes.

@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Aggregate Sales and Production Data'
@Analytics: { dataCategory: #CUBE ,dataExtraction : { enabled : true } }
@OData.publish: true
define view entity ZI_AGG_SALES_PROD
as select from ZI_MULTI_COMPONENT_REPLICATE

{
key CompanyCode,
key Fiscalyear,
key Currency,
@Semantics.amount.currencyCode: 'Currency'
sum(OpenItemAmount) as TotalOpenAmount,
@Semantics.amount.currencyCode: 'Currency'
sum(SalesAmount) as TotalSalesAmount,

count(distinct Documentnumber) as TotalDocuments,


count(distinct SalesDoc) as TotalSalesDocs,
count(distinct ProductionOrder) as TotalProductionOrders,
sum(ActiveEmployeeFlag) as ActiveEmployees

}
group by
CompanyCode,
Fiscalyear,
Currency
Output
Create Service Definition
Please create Service Definition by right clicking the CDS view and activate the service
definition.
Create Service Binding

By right-clicking the Service definition, please create service binding to expose into Fiori
App.
Check Added Service in Tcode /IWFND/MAINT_SERVICE

Execute SAP Gateway Client

OData Link
Note:I have hidden https link for security purpose.
http://000.000.000.000:0000/sap/opu/odata/sap/ZSB_AGG_SALES_PROD/

Login to BTP
I have hidden https link for security purpose.

Open Command Palette

Fiori:Open Application Generator


Select the Template:List Report Page

Click Next

Connect to an OData Service


Provide S4HANA Login Credentials

Entity Selection
Project Attributes

Click Finish.

Application Information
Preview Application

Preview Application with NPM Scripts

Run Fiori with S4HANA Login Credentials


Select Fiori Column

Final Fiori Output


Key Takeaways
1. Efficiency in Integration:
o CDS views offer seamless integration with S/4HANA, SAP Datasphere, and SAP Analytics
Cloud, enhancing the efficiency and effectiveness of data management and reporting in
modern SAP landscapes.
2. Comprehensive Reporting:
o Utilizing multiple left outer joins in CDS views can generate comprehensive and meaningful
reports, as demonstrated in the example.
3. Adherence to Best Practices:
o Always follow SAP’s best practices to address performance issues, ensuring optimal
functionality and efficiency.
4. Service Definition Creation:
o Create a Service Definition by right-clicking the CDS view and activating it, facilitating the
exposure of CDS views as services.
5. Service Binding and Fiori App Integration:
o Create a Service Binding by right-clicking the Service Definition, which allows you to expose
the CDS view into a Fiori App on the SAP Business Technology Platform (BTP).
6. Utilizing SAP Gateway:
o Check the added service in transaction code /IWFND/MAINT_SERVICE and execute it using
the SAP Gateway Client to ensure proper setup.
7. Login and Configuration:
o Log in to SAP BTP and configure the Fiori Application Generator to connect to the OData
service, providing S/4HANA login credentials.
8. Application Development:
o Select the appropriate template (e.g., List Report Page), connect to the OData service, and
provide necessary project attributes to finalize the application setup.
9. Preview and Testing:
o Preview the application using NPM scripts and run it with S/4HANA login credentials to ensure
it functions as expected.

Personal messages from my end

This effort is not for commercial purposes; it is to give back to the community, as many people
supported your professional growth during the initial stages. This is a way to assist students
and learners in gaining the right context.

If you have any comments or queries, please send me a personal message. Avoid negative
comments and refrain from posting advertisements or promotional content. I am also learning
alongside you and may make mistakes. Please bear with me as I work to correct them. Due to
my commitments to learning German, working for my organization, and upskilling with
industry practices, my time is limited. If you are working on your own scenarios, please seek
support on SAP Community .

Thank you for your understanding and support.

You might also like