100% found this document useful (1 vote)
442 views14 pages

Creation of CDS View and Its Consumption With SAP Gateway Service

This document summarizes the steps to create and consume a CDS view using SAP Gateway service. It describes creating a CDS view with ADT in Eclipse that joins data from tables MCHB, MARA and MAKT. It then outlines the steps to consume the CDS view through SAP Gateway by creating a project, data model, data provision, registering the service and executing queries against it. The CDS view provides a consolidated view of stock data including plant, storage location, material number and description.

Uploaded by

Bireshwar Das
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
100% found this document useful (1 vote)
442 views14 pages

Creation of CDS View and Its Consumption With SAP Gateway Service

This document summarizes the steps to create and consume a CDS view using SAP Gateway service. It describes creating a CDS view with ADT in Eclipse that joins data from tables MCHB, MARA and MAKT. It then outlines the steps to consume the CDS view through SAP Gateway by creating a project, data model, data provision, registering the service and executing queries against it. The CDS view provides a consolidated view of stock data including plant, storage location, material number and description.

Uploaded by

Bireshwar Das
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/ 14

Creation of CDS view and its consumption with SAP Gateway service

Creation of CDS View with ADT in Eclipse


@AbapCatalog.sqlViewName: 'ZVOIA_ALV'
@AbapCatalog.compiler.CompareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS View zcdsv_oia_basic_alv'
@ClientDependent: false
define view zcdsv_oia_basic_alv as select from mchb as mc
inner join mara as ma on ma.matnr = mc.matnr
inner join makt as mt on mt.matnr = mc.matnr
{
key mc.werks,
key mc.lgort,
key mc.matnr,
mt.maktx,
case ma.meins
when 'ST' then 'PC'
else ma.meins
end as meins,
substring( ma.matkl, 1, 5 ) as matkl,
sum(mc.clabs) as tot_stock
} where ma.mtart = 'FERT'
and mt.spras = 'E'
group by
mc.werks,
mc.lgort,
mc.matnr,
mt.maktx,
ma.meins,
ma.matkl

Consumption of CDS View with SAP gateway service


Go to SEGW & Create Project

Create Data Model

Click Next

Click Next

Click Finish

Click Save

Create Data Provision

Click Generate Mapping & Save

Click Generate runtime Object

Open Service maintenance > Double click on GW_HUB

Click Register & Select System Alias

Now Execute SAP Gateway Client

Query with Keys

You might also like