0% found this document useful (0 votes)
56 views6 pages

UI5 Basic

The document discusses how to create an OData ABAP service project which includes creating entity types, entity sets, and generating runtime artifacts. It notes that the model provider class contains metadata that the OData service framework uses at runtime. The data provider and data provider extension classes implement CRUDQ methods for database operations that correspond to front-end SAP UI5/Fiori methods. Whenever changes are made to the data model, runtime artifacts must be regenerated.

Uploaded by

Vishnu Vishnu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views6 pages

UI5 Basic

The document discusses how to create an OData ABAP service project which includes creating entity types, entity sets, and generating runtime artifacts. It notes that the model provider class contains metadata that the OData service framework uses at runtime. The data provider and data provider extension classes implement CRUDQ methods for database operations that correspond to front-end SAP UI5/Fiori methods. Whenever changes are made to the data model, runtime artifacts must be regenerated.

Uploaded by

Vishnu Vishnu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Create OData ABAP Service Project

Create Entity Type and Entity Set

Generate Runtime Artifacts

Importance of Model Provider Class ( MPC )

_________________________________________________________

Procedure :To Create OData ABAP Service Project

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

Logon to SAP Backend Server

Open SEGW Tcode ( SAP Gateway Service Builder )

Click on create icon

Provide Project Name = ZNew6AMCRUDProject

Provide description = OData Service

Save in package/Local

Continue

__________________________________________________________

Note : Every OData Service Project contains 4 Main Folders

Data Model

Service Implementation

Runtime Artifacts

Service Maintainence
________________________________________________________________

Note :

Entity Type : Entity Type is an option to maintain Collection of Fields with Data Type and Length

Entity Set : Entity Set is an option to Hold Collection of Records at Runtime.

Note :

OData Service Project can have More than one Entity Type

OData Service Project can have More than one Entity Set

______________________________________________________________________

Procedure : To Create Entity Type and Entity Set

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

Right Click DataModel -> Import -> DDIC Structure

Provide Entity Type Name = EMP

Provide ABAP STructure = ZEMPDBTABLE ( Database Table )

Select CheckBox To Create Entity Set = EMPSet

Next

Select Fields as per Requirement

Next

Select Atleast one Field Must be Key Field in Entity Type ( For ex : Userid )

Click Finish

_______________________________________________________________________

note : When the Fields are Imported


ABAP Data Types are Converted to Equivalent OData EDM Data Types

DEC Edm.Decimal

TIMS Edm.Time

DATS Edm.DateTime

CHAR Edm.String

NUMC Edm.String

RAWSTRING Edm.Binary

INT4 Edm.Int32

___________________________________________________________________________

Note : EDM = Entity Data Model

____________________________________________________________________________

Procedure : To Generate Runtime Artifacts:

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

Select Your Project Folder ->

Click Red Color icon ->

Click Continue

Save in Package/Local

Finish

__________________________________________________________________________
Note : on Generating Runtime Artifacts , The List of Classes are AutoGenerated

_MPC

_MPC_EXT

_DPC

_DPC_EXT

_MDL

_SRV

___________________________________________________________________________

VVV important note:

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

Whenever we add/remove/change Anything inside "DataModel"

You Need to "Regenerate Runtime Artifacts" By selecting Red Color Again

Impact of Regenerating Runtime Artifacts

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

The Latest Metadata will be Updated as per DataModel inside Model Provider Class ( MPC )

______________________________________________________________________________

Model Provider Class ( MPC )

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

Model Provider Class ( MPC) Contains "MetaData" of OData Service

MetaData means Name of Entity Type


Name of Entity Set

Name of Every Field

Data Type of Every Field

Length of Every Field

Database Table used for Importing Fields

Structure used for importing Fields

Field is Key Field or Not

Table Structure for Entity Type

Table Table for Entity Type

Note : As A developer, we should not Modify Model Provider Class

note : Model Provider Class is utilized by OData Service Framework to Execute the OData Functionalities
at Runtime

________________________________________________________________________________

Data Provider Class :

_______________________

Data Provider Class Generates 5 CRUDQ Methods for Each and Every Entity Set

_____________________________________________________________________________

Data Provider Extension Class:

____________________________

Data Provider Extension Class is a Sub Class for Data Provider Class

so
Data Provider Extension Class will inherit all The 5 CRUDQ Methods of Data Provider Class

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 Methods

___________________________________________________________________________________

<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 DPC_EXT Class methods

_____________________________________________________________________________________
_________

You might also like