From CDS View to OData Service: Simplifying the Process Part 23


CRUD:- Create Read Update Delete
Read -
    /sap/opu/odata/sap/ZEMPLOYEE_002_SRV/EmployeeSet + GET =>  employeeset_get_entityset.
    /sap/opu/odata/sap/ZEMPLOYEE_002_SRV/EmployeeSet(2) + GET => EMPLOYEESET_GET_ENTITY
Create :-
    /sap/opu/odata/sap/ZEMPLOYEE_002_SRV/EmployeeSet + POST + Payload => employeeset_create_entity
Update
    /sap/opu/odata/sap/ZEMPLOYEE_002_SRV/EmployeeSet(6) + PUT + Payload  => 'EMPLOYEESET_UPDATE_ENTITY' 
Delete
   /sap/opu/odata/sap/ZEMPLOYEE_002_SRV/EmployeeSet(6) + DELETE => 'EMPLOYEESET_DELETE_ENTITY' 
************************************************************************************************************

Access data through navigation
   /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders('4969')/Items
   /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderItems => salesorderitems_get_entityset

Read with navigation path
/sap/opu/odata/sap/ZSALESORDER_001_SRV/SalesOrderHeaderS + Get
     =>salesorderheader_get_entityset

/sap/opu/odata/sap/ZSALESORDER_001_SRV/SalesOrderHeaderS('4970')/OrderToItem_nav + Get
      => salesorderitems_get_entityset

/sap/opu/odata/sap/ZSALESORDER_001_SRV/SalesOrderItemS      => salesorderitems_get_entityset     

***************************************************************************************************************
Expand Query option :-
  /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$expand=Items
     salesorderheader_get_entityset  => 100
     salesorderitems_get_entityset   => 7970 ....100 times

/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders('4970')?$expand=Items
   salesorderheader_get_entity => 4970
   salesorderitems_get_entityset    => one time

If we have implemented this then we have to implement 

/IWFND/TRACES
/IWFND/CACHE_CLEANUP

http://host:POrt/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$expand=Items&$format=json
****************************************************************************************************************

They are automatically available in the framework, no further actions needed by development.
$format
  /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$format=json
$expand
  /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$expand=Items
$select
  /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$select=SalesOrder,SalesOrg,Vtweg&$format=json
$count
  /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders/$count
$links
  /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders('4970')/$links/Items
ZC_SALESORDER_CDS/ZC_SalesOrder('180')/$links/to_items
$value
  /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders('4970')/Bstnk/
  /sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders('4970')/Bstnk/$value
**************************************************************************************************

They are available, but they require implementation efforts from development.

Without implementation query option :- 
$select :-
/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$select=SalesOrder,Auart&$format=json 

$count :-
/sap/opu/odata/sap/ZSALESORDER_001_SRV/SalesOrderHeaders/$count

$link :-
/sap/opu/odata/sap/ZSALESORDER_001_SRV/SalesOrderHeaders('764')/$links/Items

value :-
/sap/opu/odata/sap/ZSALESORDER_001_SRV/SalesOrderHeaders('764')/Auart?$format=json
$value
/sap/opu/odata/sap/ZSALESORDER_001_SRV/SalesOrderHeaders('764')/Auart/$value

$skiptoken
*************************************************************************************************

$batch :-

GET EmployeeSet?
$skip=0&
$top=20&
$select=EmployeeId%2cName%2cCity%2cCompanyName%2cDepartment%2cStratDate%2cEndDate%2cSalary%2cCurrency&
$inlinecount=allpages

http://183.82.1.220:8073/sap/opu/odata/sap/ZEMPLOYEE_002_SRV

*************************************************************************************************************
$orderby
/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$orderby=SalesOrder desc&$format=json
/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$orderby=Kunnr asc,SalesOrder desc&$format=json

$filter
/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$filter=Kunnr eq '1390'
/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$filter=( Kunnr eq '1390' or Kunnr eq '1175')
/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$filter=( Kunnr eq '1390' or Kunnr eq '1175') and Vtweg eq '10'

List report page
/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$top
/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$skip

/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$inlinecount

/sap/opu/odata/sap/ZSALESORDER_002_SRV/SalesOrderHeaders?$skiptoken

***********************************************************************************

/sap/opu/odata/sap/ZSALESORDER_001_SRV/
Function Import:-
so_count_by_status

Importing :-
 Customer
Exporting :-
 Customer
 NotProcesed
 CompleteProcess
 NotRelvent
*******************************************************************
Media Handling (Image, Audio, Video, PDF, ZIP, Excel Sheet, Text Files):- 
1. Set Entity type as media in SEGW   :- METADATA (hasStream)
2. Mime type property set as contetnt type in MPC_EXT
3. create_stream  :- /sap/opu/odata/SAP/ZMEDIA_SRV/MediaSet                + POST + Payload + SLUG variable
4. get_stream     :- /sap/opu/odata/SAP/ZMEDIA_SRV/MediaSet('ram3')/$value + GET  
5. update_stream  :- /sap/opu/odata/SAP/ZMEDIA_SRV/MediaSet('ram3')/$value + PUT + Payload 
6. delete_stream  :- /sap/opu/odata/SAP/ZMEDIA_SRV/MediaSet('ram3')/$value + DELETE

Smartform pdf send to front end system 

/sap/opu/odata/SAP/ZMEDIA_SRV/MediaSet('LH')/$value
*****************************


Comments

Popular posts from this blog

AMDP ( ABAP Managed Database Procedure ) Part - 1

SAP CDS Introduction Part 2 - ABAP on HANA Course

Backup all ADT Objects & Other queries RAP Part 10.1