0% found this document useful (0 votes)
9 views

CDS View for Count

The document outlines the definition of several composite views in an SAP system related to quality analysis and purchasing. It includes detailed SQL view definitions for counting quality analysis records and aggregating data by plant and creation date. The views are designed for analytical purposes and include various joins and filters to refine the data presented.

Uploaded by

sakshi nikam
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)
9 views

CDS View for Count

The document outlines the definition of several composite views in an SAP system related to quality analysis and purchasing. It includes detailed SQL view definitions for counting quality analysis records and aggregating data by plant and creation date. The views are designed for analytical purposes and include various joins and filters to refine the data presented.

Uploaded by

sakshi nikam
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/ 4

CDS View for Count

1. Composite View – ZMM_QUALITY_ANALYSIS_PEN


@AbapCatalog.sqlViewName: 'ZMM_QLTY_ANA_PEN'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Pending Quality Analysis'
@VDM.viewType: #COMPOSITE
@Analytics.dataCategory: #CUBE
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions: true
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking:#BLOCKED_DATA_EXCLUDED
define view zmm_quality_analysis_pen
as select from qals
left outer join prps on prps.pspnr = qals.ps_psp_pnr
left outer join nsdm_v_mseg on qals.zeile = nsdm_v_mseg.zeile
and qals.mblnr = nsdm_v_mseg.mblnr
left outer join mara on qals.matnr = mara.matnr
left outer join t023t on mara.matkl = t023t.matkl
left outer join t001w on qals.werk = t001w.werks
left outer join t001k on qals.werk = t001k.bwkey
left outer join ekko on qals.ebeln = ekko.ebeln
left outer join t161t on ekko.bsart = t161t.bsart
and t161t.spras = 'E'
and t161t.bstyp = 'F'
left outer join t001 on t001k.bukrs = t001.bukrs
{

key qals.prueflos, // as InspectionLot,


key qals.objnr, // as Objectnumber,
qals.werk, // as Plant,
qals.lagortvorg, // as StoreLocation,
qals.art, // as InspectionType,
qals.lifnr, // as Vendor,
qals.matnr, // as Material,
qals.ekorg, // as PurchasingOrg,
qals.ebeln, // as PurchasingDocument,
qals.ebelp, // as PurchasingItem,
@DefaultAggregation: #SUM
qals.losmenge, // as InspectionLotQuantity,
qals.mengeneinh, // as BUN,
qals.enstehdat, // as Createddate,
qals.ersteller, // as Createdby,
qals.mblnr, // as materialdocument,
qals.zeile, // as Item,
qals.ps_psp_pnr,
prps.psphi, // as currentproject,
@DefaultAggregation: #SUM
nsdm_v_mseg.dmbtr, // as Amountinlocalcurrency
t023t.wgbez,
t001w.name1,
t001k.bukrs,
ekko.bsart,
t161t.batxt,
t001.butxt

}
where
qals.stat35 <> 'X'
and qals.art = '01'
and qals.lmengezub <> 0

2. Composite View - ZMM_PURC_QAS_TILE


@AbapCatalog.sqlViewName: 'ZMM_QAS_CNT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Purchase Analysis for Quality(Count)'
@VDM.viewType: #COMPOSITE
@Analytics.dataCategory: #CUBE
//@Analytics.query: true
//@OData.publish: true
//@Metadata.ignorePropagatedAnnotations: true
//@Analytics.dataExtraction.enabled: true
define view zmm_purc_QAS_tile
as select from zmm_quality_analysis_pen

key werk as Plant_D,


name1 as Plant_Desc,
enstehdat as Created_date,
count(distinct ebeln) as QualityPending,
sum(dmbtr) as Value

}
group by
werk,
name1,
enstehdat

3. Composite View - ZMM_PURC_QAS_TILE1


@AbapCatalog.sqlViewName: 'ZMM_QAS_CNT1'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Purchase Analysis for Quality(Count)'
@VDM.viewType: #COMPOSITE
@Analytics.dataCategory: #CUBE
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions: true
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking:#BLOCKED_DATA_EXCLUDED
define view zmm_purc_QAS_tile1
as select from zmm_purc_QAS_tile

key Plant_D,
Plant_Desc,
Created_date,
@DefaultAggregation: #SUM
cast(QualityPending as abap.dec( 15, 2 )) as Count1,
@DefaultAggregation: #SUM
cast(Value as abap.dec( 15, 2 )) as value

4. Consumption View – ZMM_PURC_QAS_TILE_CON


@AbapCatalog.sqlViewName: 'ZMM_QAS_CNT_CON'
//@AbapCatalog.compiler.compareFilter: true
//@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Purchase Analysis for Quality(Count)'
@VDM.viewType: #CONSUMPTION
@Analytics.query: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@OData.publish: true
//@Metadata.ignorePropagatedAnnotations: true
//@Analytics.dataExtraction.enabled: true
define view zmm_purc_QAS_tile_con
as select from zmm_purc_QAS_tile1

@EndUserText.label: 'Plant'
key Plant_D,
@EndUserText.label: 'Plant Desc'
Plant_Desc,
@EndUserText.label: 'Created Date'
Created_date,
@EndUserText.label: 'Count'
Count1,
@EndUserText.label: 'Value'
value

You might also like