Class5 Merged
Class5 Merged
Class5 Merged
__________________________
________________________________________________________________________________
Note : As a Developer, we Implement our Database Operations via DPC_EXT Class Methods by "RE-DEFINING The methods"
__________________________________________________________________________________________________________
Note : We can use Table Structure of MPC Class for Declaring "WorkArea" ( Holding Single Record )
Note : We can use Table Type of MPC Class for Declaring "Internal Table" ( Holding Collection of Records)
________________________________________________________________________________________________
Syntax for Declaring WorkArea in OData Service ( Refer with Table Structure of MPC Class )
----------------------------------------------------------------------------
_____________________________________________________________________
Syntax For Declaring Internal Table in OData Service( Refer with Table Type of MPC Class )
--------------------------------------------------------------------------------
______________________________________________________________
Syntax for Declaring SimpleVariable in OData Service( Refer with TableStructure-FieldName of MPC )
----------------------------------------------------------------------------------
_____________________________________________________________
Move
Move-Corresponding
sort
clear
Refresh
WorkArea Operations
InternalTable Operations
Commit Work
Rollback
if------------endif.
case-------endcase.
loop--------endloop.
String Operations
Concatenate
Condense
Replace
Translate
Shift
Split
System Fields
sy-dbcnt
sy-uname
sy-langu
sy-datum
sy-uzeit
sy-index
etc,,,etc,,
Conclusion :
--------------------
_______________________________________________________________________________________
Note :
/sap/opu/odata/SAP/Z8AM_CRUD_ODATAPROJECT_SRV/
To Test OData Services from Outside SAP Server ( browser / Third Party Software like Rest Client)
--------------------------------------------------------------------------
http://EHP7.TRAINING.COM:8007/sap/opu/odata/SAP/Z8AM_CRUD_ODATAPROJECT_SRV/
____________________________________________________________________________________
http://EHP7.TRAINING.COM:8007/sap/opu/odata/SAP/Z8AM_CRUD_ODATAPROJECT_SRV/
Note : All the Above options of URL is considered as "FQDN" i,e Fully Qualified Domain Name
____________________________________________________________________________________
Important Methods and its Method Parameters of OData ABAP Services:
_________________________________________________________________
<EntitySet>_Get_Entity( )
<EntitySet>_Get_EntitySet( )
<EntitySet>_Create_Entity( )
<EntitySet>_Update_Entity( )
<EntitySet>_Delete_Entity( )
+
Create_Stream( )
Get_Stream( )
Create_Deep_Entity( )
Get_Expanded_Entity( )
Execute_Action( )
________________________________________________________
Note : Method Parameters are Responsible for "Data Transfer" between SAP Ui5/Fiori Apps and OData Service
____________________________________________________________________________________________
<EntitySet>_Get_Entity( ) Method:
-------------------------------------------------------------
it_key_tab : Will Accept Input Key Field Value(s) From Front-end App(SAP Ui5/Fiori )
<EntitySet>_Get_EntitySet( ) Method :
---------------------------------------------------------------
iv_Filter_String
iv_Search_String
it_filter_select_options
io_tech_request_Context : Will Accept Input Value(s) from Front-end App(SAP Ui5/Fiori )
<EntitySet>_Create_Entity( ) Method :
--------------------------------------------------------------
<EntitySet>_Update_Entity( ) Method :
---------------------------------------------------------------
<EntitySet>_Delete_Entity( ) Method:
-----------------------------------------------------------------
it_key_tab : Will Accept Input Key Field Value(s) From Front-end App(SAP Ui5/Fiori)
Create_Stream( ) Method:
-----------------------------------------------------
it_key_Tab : Will Accept Input Key Field Value(s) From Front-end App(SAP Ui5/Fiori )
iv_Slug : Will Accept Input File Name from Front-end App(SAP Ui5/Fiori )
is_Media_Resource : Will Accept Input File Type & Input File Content from Front-end App(SAP Ui5/Fiori)
_________________________________________________________________________________________
Get_Stream( ) Method :
---------------------------------------------
it_key_tab : Will Accept Input Key Field Value(s) From Front-end App(SAP Ui5/Fiori )
er_stream : Will Send Output File name , Output File Type, Output File Content to Front-end App(SAP Ui5/Fiori )
_____________________________________________________________________________________________________
Create_Deep_Entity( ) Method :
--------------------------------------------------------
io_Data_Provider : Will Accept Input Header Record + Input Items Record(s) simultaneously from Front-end App(SAP Ui5/Fiori)
er_Deep_Entity
: Will Send Output to Front-end App(SAP Ui5/Fiori )
( optional )
______________________________________________________________________________
Get_Expanded_Entity( ) Method :
-------------------------------------------------------
This method is used to Fetch Header + items Records Simultaneously
it_key_tab
io_tech_request_context
io_expand : will Accept Input Value(s) From Front-end App(SAP Ui5/Fiori )
er_Entity : Will Send Output Header Record + Output Item Records to Front-end App(SAP Ui5/Fiori)
______________________________________________________________________________________________________
Execute_Action( ) Method:
---------------------------------------------------
iv_Action_name : will Capture the name of the Function Triggered from Front-end App(SAP Ui5/Fiori )
Conclusion :
Method parameter are responsible for "Data Transfer" between Front-end app(SAP Ui5/Fiori ) and Backend ( OData Service )
______________________________________________________________________________________________________
Create OData ABAP Service Project
Create Entity Type and Entity Set
Generate Runtime Artifacts
Importance of MPC Class
Importance of DPC Class
Importance of DPC_EXT Class
__________________________________________________
Continue
_______________________________________________________
DataModel
Service Implementation
Runtime Artifacts
Service Maintainence
Note : Entity Type is to Maintain Collection of Fields with Data TYpe and length
Note : Entity Set is to Hold Collection of Records at Runtime.
________________________________________________________________
Next
Select The Required Fields
Next
Select Atleast One Field as KeyField ( For Ex : Userid )
Finish
save
_______________________________________________________
Note : In Single Odata Project, We can create Multiple Entity Types and Multiple Entity Sets
Continue
Save in package/Local
Finish
____________________________________________________________________
_MPC
_MPC_EXT
_DPC
_DPC_EXT
_MDL
_SRV
_______________________________________________________________________
Note : MPC Class is utlized by OData Framework at Runtime to Execute Odata Service Functionalities
________________________________________________________________________________________
Data Provider Class Automatically Generates "5 CRUDQ Methods" for Each and Every EntitySet
This Autogeneration of methods is done by OData Framework
_________________________________________________________________________________________
DataProvider Extension Clas ( DPC_EXT ) is a Sub Class for Data Provider Class ( DPC )
i,e
Data Provider Extension Class will inherit all The 5 CRUDQ methods of All EntitySets from Data Provider Class
Data Provider Extension Class will Also Utilize Methods from Various Interfaces
i,e
Finally Data Provider Extension Class contains Mainly 10 Important Methods for Implementing "Database Operations"
_________________________________________________________________________
Backend OData DPC_EXT Class Methods Front-end SAP Ui5/Fiori
( Database operations ) ( Screens )
_________________________________________________________________________
<EntitySet>_Create_Entity( ) create( )
<EntitySet>_Get_Entity( ) bindElement( )
<EntitySet>_Update_Entity( ) update( )
<EntitySet>_Delete_Entity( ) remove( )
<EntitySet>_Get_EntitySet( ) bindRows( ) or items="/EntitySet"
+
Create_Stream( ) upload( ) + /$value
Get_Stream( ) read( ) + /$value
Create_Deep_Entity( ) create( ) + NavigationProperty
Get_Expanded_Entity( ) bindRows( ) + NavigationProperty
Execute_Action( ) callFunction( ) + FunctionName
___________________________________________________________________________________________
Note : The Front-end SAP Ui5/Fiori Methods will trigger Backend Odata Service methods of DPC_EXT Class
____________________________________________________________________________________________________
OData Service Fundamentals:
______________________________________
OData Services are "Re-Usable Services" and Independent of Front-end App( SAP Ui5 , SAP Fiori , .Net . PHP )
OData Service Projects are created Using "SEGW" Tcode ( SAP Netweaver Gateway Service Builder )
1. DataModel
2. Service Implementation
3. Runtime Artifacts
4. Service Maintainence
____________________________________________________________
DataModel :
__________________________
Entity Type : Entity Type is an option to Maintain Collection of Fields with Data Type and Length
Entity Type is similar to "Structure " in Normal ABAP
Association Set : Association is the Name of Relationship between Two Entity Sets
Association is the Name of Relationship between Principle Entity Set & Dependent Entity Set
Referential Constraint : Referential Constraint is a Common Field(s) Between Two Entity Types
Referential Constraint is a Common Field(s) Between Principle Entity Type & Dependent Entity Type
Navigation Property : Navigation Property acts like a "Mediator" between Two Entity Types ( Header + Items )
_______________________________________________________________________
note : in Single Odata Service project, we can have Multiple Entity Types
in Single Odata Service project, we can have Multiple Entity Sets
_____________________________________________________________________
Service Implementation :
___________________________
Service Implementation Mainly Contains "5 CRUDQ Methods" for Each & "Every EntitySet" for Implementation of Database Operations
_____________________________________________________________________________
Create_Entity( ) Method Create For Insert Functionality
Note : "CRUDQ Methods" of OData Service are Common for both SAP Ui5 & SAP Fiori Apps
note : "CRUDQ Methods" of OData Services are Triggered by Frontend Apps(SAP Ui5/Fiori ) using ODataModel Concept
________________________________________________________________________________________________
Runtime Artifacts:
___________________________
Runtime Artifacts are Collection of Runtime Classes For Implementation of "Database Operations"
_MPC -> Model Provider Class -> Super Class -> Meta Data generated by OData Framework
_MPC_EXT -> Model Provider Extension Class -> Sub Class -> Extension for Meta Data
_DPC -> Data Provider Class -> Super Class -> Methods Generated by OData Framework
_DPC_EXT -> Data Provider Extension Class -> Sub Class -> Redefine Methods & Implement Database Operations
_MDL -> Registered Model -> ModelName -> Internally Used by ODataFramework to Execute Service
_SRV -> Registered Service -> Service Name-> Accessed by Front-end App ( SAP Ui5/Fiori / .Net / PHP )
_________________________________________________________________________________________
Service Maintainence :
_____________________
2. Error Log : To Trace out Errors Occured During OData Service Execution
3. SAP Gateway Client : To Test the OData Service Functionalities within SAP System
( Pass Input using HTTP Request )
( Get Output using HTTP Response)
Note : Rest Client : To Test the Odata Service Functionalities from External Browser ( Firefox, Google Chrome etc)
( Pass Input using HTTP Request )
( Get Output using HTTP Response)
Note : SAP Ui5/FIORI : Actual Screens with List / Form / Table / MicroCharts / Charts etc...
______________________________________________________________________________________________________
XML Format : Pass Input in XML Format, Get Output in XML Format
JSON Format : Pass Input in JSON Format, Get Output in JSON Format
_________________________________________________________________________________
"Userid" : "1001",
"Firstname" : "Vijayendar",
"Lastname" : "Reddy",
"Emailid" : "vijay@ca.com",
"Country" : "INDIA",
"Salary" : 95000,
"Phone" : "9618973044"
"Userid" : "1002",
"Firstname" : "Ajay",
"Lastname" : "Kumar",
"Emailid" : "ajay@ca.com",
"Country" : "INDIA",
"Salary" : 75000,
"Phone" : "7618073044"
____________________________________________________________
Forms
Lists
Tables
Charts
MicroCharts
DropdownBox
RadioButtonGroup
MultiComboBox
MultiInput
RatingIndicator
File Uploader
File Download
File Preview
etc...
_____________________________________________________________________
SAP Ui5 Fiori Odata CDS introduction:
____________________________________
Suitable for Intranet ( Within Organization ) Suitable for Both Intranet + Internet
(within organization + outside organization )
Screens Supports Max 15 ScreenElements Screens Supports More Than 150 ScreenElements
( we can provide More User Interactivity Features )
All the Functionalities are Executed at Server Side( StateFull ) Almost 95% Functionalities are Executed at Client Side( (Stateless
)
bcoz SAP ABAP Programming is Server Side Programming bcoz SAP Ui5/Fiori Supports JavaScripting / XML ( Client Side
Programming )
Architecture:
_______________________
OData Services:
__________________
1. OData ABAP Service ->Deals with DB operations with SAP ECC/S4HANA / CRM/ SRM
2. OData CDS Service ->Deals with DB operations with SAP S4 HANA
3. OData External Service ->Deals with DB operations with Non-SAP (Third Party Systems)
______________________________________________________________________________________________
Standard Front-end Apps developed by SAP using SAP Ui5 Framework + SAP Fiori Templates / SAP Fiori Elements
& Consume Standard OData Servies for Database Operations with backend Systems
These apps are Considered as "SAP Fiori Apps"
Note : SAP has provided Standard Fiori Apps for Dealing with "Common Business Functionalities"
etc.,..etc... There are Thousands of Standard Fiori Apps provided by SAP as "Ready Made Apps"
Note : as A Developer, if Required, we can customize / enhance standard Fiori Apps as per Client requirement
____________________________________________________________________________________________
Summary :
_____________
SAP Ui5 Apps = Custom Front-end Apps ( SAP Ui5 Framework + OData )
SAP Fiori Like Apps = Custom Front-end Apps( SAP Ui5 Framework + OData + SAP Fiori Templates / SAP Fiori Elements)
SAP Fiori Apps = Standard Front-end Apps( SAP Ui5 Framework + OData + SAP Fiori Templates / SAP Fiori Elements)
________________________________________________________________________________________________________________
OData Model:
__________________
ODataModel is used to Consume/Access OData Services
ODataModel is used to Trigger "Database Operations using Front-end Methods
ODataModel is used to Send Data + Receive Data between Front-end SAP Ui5 Fiori App and Backend Servers
ODataModel is considered as "Server Side Model " bcoz ODataServices (DB operations are executed at Server Side)
_____________________________________________________________________________________________________
SAP Ui5 / Fiori Apps Front-End Apps OData Services Database Operations
_____________________________________________________________________________________________________
note : All the Above methods are executed by SAP Ui5/Fiori OData Model
____________________________________________________________________________
SAP Netweaver Gateway with ECC / S4HANA + Eclipse + SAP WEB IDE + SAP BAS Tool + SEGW Tcode
___________________________________________________________________________________________________