Value Help for Components of Material Based Composition
C_MatlBasedCmpstnCompVH is a Consumption CDS View that provides data about "Value Help for Components of Material Based Composition" in SAP S/4HANA. It reads from 2 data sources (I_ChmlCmplncInfoVH, I_MatlBasedCompositionDraft) and exposes 14 fields with key fields ChmlCompositionUUID, ChmlCmplncInfoUUID.
@EndUserText.label: 'Value Help for Components of Material Based Composition'
@AbapCatalog:
{
sqlViewName: 'CMCCOMPVH',
compiler.compareFilter: true
}@AccessControl:
{
authorizationCheck: #MANDATORY,
// blocking of personal data not required (no personal data fields exposed for material)
personalData.blocking: #NOT_REQUIRED
}@VDM.viewType: #CONSUMPTION@ObjectModel:
{
dataCategory: #VALUE_HELP,
usageType:
{
dataClass: #MIXED,
sizeCategory: #L,
serviceQuality: #C
},
representativeKey: 'ChmlCmplncInfoUUID',
semanticKey: ['ChmlCmplncInfoCombinedName']
}
@Metadata.ignorePropagatedAnnotations: true@ClientHandling.algorithm: #SESSION_VARIABLE@UI:{
presentationVariant: [{
sortOrder: [{ by: 'ChmlCmplncInfoCombinedName', direction: #ASC }],
requestAtLeast: ['Material',
'ProductName',
'MaterialIsProduced',
'MaterialIsSourced'
]
}]
}
@Search.searchable: true/*
* This viewis used in the object page of the material based composition
* to diplay all CCIs with type = 'Bulk' and role 'Produced' or 'Sourced'
* in a value help
*/defineview C_MatlBasedCmpstnCompVH
withparameters
P_ChmlCompositionUUID : sysuuid_x
-- select Raw Material
asselectfrom I_ChmlCmplncInfoVH as _ChemicalComplianceInfo
--Join data with draft compositions
innerjoin I_MatlBasedCompositionDraft as _MatlBasedCompositionDraft on _MatlBasedCompositionDraft.ChmlCompositionUUID = $parameters.P_ChmlCompositionUUID
--Join data of draft components of material based composition that are already assigned
leftouter to one join I_MatlBsdBeforeProdnCompDraft as _MatlBsdBeforeProdnCompDraft on _ChemicalComplianceInfo.ChmlCmplncInfoUUID = _MatlBsdBeforeProdnCompDraft.CompChmlCmplncInfoUUID
and _MatlBsdBeforeProdnCompDraft.ChmlCompositionUUID = $parameters.P_ChmlCompositionUUID
{
@UI.hidden: truekey $parameters.P_ChmlCompositionUUID as ChmlCompositionUUID,
@UI.hidden: truekey _ChemicalComplianceInfo.ChmlCmplncInfoUUID,
@UI.lineItem: [{ position: 10, importance: #HIGH }]@Consumption.filter.hidden: true
ChmlCmplncInfoCombinedName,
@UI.lineItem: [{ position: 20, importance: #HIGH }]
Material,
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.7,
ranking: #HIGH
}@UI.hidden: true
ProductName,
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.7,
ranking: #MEDIUM
}@UI.lineItem: [{ position: 30, importance: #HIGH }]
ChmlCmplncInternalName,
// needed for DCL
@UI.hidden: true
ProdStewardshipRespUnit,
@UI.hidden: true
ChmlCmplncInfoType,
@UI.hidden: true
MaterialIsSold,
@UI.hidden: true
MaterialIsTransported,
@UI.hidden: true
MaterialIsDisposed,
@UI.hidden: true
MaterialIsEmissionRelevant,
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.7,
ranking: #LOW
}@UI.lineItem: [{ position: 40, importance: #HIGH }]
MaterialIsSourced,
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.7,
ranking: #LOW
}@UI.lineItem: [{ position: 50, importance: #HIGH }]
MaterialIsProduced
}
-- Only for CCI type 'Bulk' and CCI role 'Sourced' or 'Produced'
where
(
ChmlCmplncInfoType = 'BU'
and(
MaterialIsSourced = 'X'
or MaterialIsProduced = 'X'
)
)
and --Select components which are not assigned in before production in the current draft table
_MatlBsdBeforeProdnCompDraft.ChmlCompositionUUID isnull/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCINFOVH",
"I_MATLBASEDCOMPOSITIONDRAFT",
"I_MATLBSDBEFOREPRODNCOMPDRAFT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/