I_ExistenceCheckOnMaterialDoc is a Composite CDS View that provides data about "Existence Check on Material Document" in SAP S/4HANA. It reads from 1 data source (I_MaterialDocumentRecord) and exposes 2 fields with key fields MaterialDocument, MaterialDocumentYear. It has 1 association to related views.
$projection.MaterialDocument = _SerialNo.MaterialDocument and $projection.MaterialDocumentYear = _SerialNo.MaterialDocumentYear
Annotations (8)
Name
Value
Level
Field
EndUserText.label
Existence Check on Material Document
view
AccessControl.authorizationCheck
#NOT_REQUIRED
view
AccessControl.personalData.blocking
#NOT_REQUIRED
view
Metadata.ignorePropagatedAnnotations
true
view
VDM.viewType
#COMPOSITE
view
ObjectModel.usageType.dataClass
#TRANSACTIONAL
view
ObjectModel.usageType.serviceQuality
#C
view
ObjectModel.usageType.sizeCategory
#XL
view
Fields (2)
Key
Field
Source Table
Source Field
Description
KEY
MaterialDocument
MaterialDocument
KEY
MaterialDocumentYear
MaterialDocumentYear
//-- This CDS Viewis intended to check if Material Document consists specific fields --
//-- At the moment based on Material Document Number and Material Document Year --
//-- existence of Serial Number is being check, this is open for any further --
//-- improvements/additions
@AbapCatalog.viewEnhancementCategory: [#NONE]@EndUserText.label: 'Existence Check on Material Document'
@AccessControl: { authorizationCheck: #NOT_REQUIRED,
personalData.blocking: #NOT_REQUIRED }@Metadata.ignorePropagatedAnnotations: true@VDM.viewType: #COMPOSITE@ObjectModel: {
usageType: {
dataClass: #TRANSACTIONAL,
serviceQuality: #C,
sizeCategory: #XL
}
}
defineviewentity I_ExistenceCheckOnMaterialDoc
asselectfrom I_MaterialDocumentRecord
association [0..*] to I_MaterialDocumentOvwSerialNo as _SerialNo on $projection.MaterialDocument = _SerialNo.MaterialDocument
and $projection.MaterialDocumentYear = _SerialNo.MaterialDocumentYear
{
key MaterialDocument,
key MaterialDocumentYear,
// cast(
// min(casewhen _SerialNo.SerialNumber isnull// then 'X'
// else '' end// ) as boolean preserving type) as MatlDocHasNoSerializedMaterial,
// @Semantics.booleanIndicator: true// case min(_SerialNo.PhysicalInventoryDocumentItem)
// when '000'
// then 'X'
// else ''
// endas MatDocHasNoSrlNmbrForPInv
//
cast(
// This field is 'X' when either the material in the material document isNOT serialized or// the Material is Serialized but it is related to a Physical inventory document, in which case// the field below (MatDocHasNoSrlNmbrForPInv) is blank. These fields toggle de visibility
// of the two different facets for SNs in the Material Documents Overview App. Therefore, ONLY ONE OF THESE
// CAN BE BLANK AT A GIVEN TIME
min(casewhen ( ( _SerialNo.SerialNumber isnotnulland _SerialNo.PhysicalInventoryDocumentItem <> '000' )
or ( _SerialNo.SerialNumber isnull )
)
then 'X'
else '' end
) as boolean preserving type) as MatlDocHasNoSerializedMaterial,
@Semantics.booleanIndicator: true
min( casewhen ( _SerialNo.PhysicalInventoryDocumentItem isnullor _SerialNo.PhysicalInventoryDocumentItem = '000' )
then 'X'
else ''
end
) as MatDocHasNoSrlNmbrForPInv
}
groupby
MaterialDocument,
MaterialDocumentYear,
_SerialNo.PhysicalInventoryDocumentItem
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIALDOCUMENTOVWSERIALNO",
"I_MATERIALDOCUMENTRECORD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/