Chemical Supplier Material with Active and Draft Data
I_ChmlSuplrMatlActiveDraft is a Composite CDS View that provides data about "Chemical Supplier Material with Active and Draft Data" in SAP S/4HANA. It reads from 1 data source (I_ChmlSuplrMatl) and exposes 4 fields.
--Label of view@EndUserText.label: 'Chemical Supplier Material with Active and Draft Data'
@AbapCatalog:
{
-- SQL view name (16 characters)
sqlViewName: 'ICSMADR',
--If it's true, the filter conditions are compared and, if they match, the associated join expression is evaluated only once
compiler.compareFilter: true,
preserveKey: true
}
--Access Control: Authorizations Checks
@AccessControl:
{
authorizationCheck: #CHECK,
// blocking of personal data required because of link to business partner / supplier
personalData.blocking: #REQUIRED
}
--Client Handling of the view@ClientHandling.algorithm: #SESSION_VARIABLE
--VDM view type
@VDM.viewType: #COMPOSITE@ObjectModel:
{
--Performance Annotations
usageType:
{
dataClass: #MIXED,
sizeCategory: #M,
serviceQuality: #C
}
}
defineview I_ChmlSuplrMatlActiveDraft
--Select data from basic view of supplier material
asselectfrom I_ChmlSuplrMatl as SupplierMaterial
--join data from draft table of supplier material
leftouter to one join I_ChmlSuplrMatlDraft as SupplierMaterialDraft on SupplierMaterial.ChmlSuplrMatlUUID = SupplierMaterialDraft.ActiveChmlSuplrMatlUUID
and SupplierMaterialDraft.LastChangedByUser = $session.user
{
--UUID of active supplier material
key SupplierMaterial.ChmlSuplrMatlUUID as ActiveChmlSuplrMatlUUID,
SupplierMaterial.ResponsibleUnit as ResponsibleUnit,
--UUID of active or draft supplier material
casewhen SupplierMaterialDraft.ChmlSuplrMatlUUID isnotnullthen SupplierMaterialDraft.ChmlSuplrMatlUUID
else SupplierMaterial.ChmlSuplrMatlUUID
endas ChmlSuplrMatlUUID,
--Indicator: Is Active Entitycast( casewhen SupplierMaterialDraft.ChmlSuplrMatlUUID isnotnullthen ' '
else 'X'
endas sdraft_is_active preserving type ) as ChmlSuplrMatlIsActiveEntity,
// needed for DCL
SupplierMaterial.BusinessPartnerSupplier,
SupplierMaterial._BusinessPartnerSupplier
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLSUPLRMATL",
"I_CHMLSUPLRMATLDRAFT"
],
"ASSOCIATED":
[
"I_BUSINESSPARTNERSUPPLIER"
],
"BASE":
[
"I_CHMLSUPLRMATL"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/