I_ExistenceCheckOnMatlDocItem is a Composite CDS View that provides data about "Existence Check on Material Doc Item" in SAP S/4HANA. It reads from 1 data source (I_MaterialDocumentRecord) and exposes 3 fields with key fields MaterialDocument, MaterialDocumentItem, MaterialDocumentYear. It has 1 association to related views.
$projection.MaterialDocument = _SerialNo.MaterialDocument and $projection.MaterialDocumentItem = _SerialNo.MaterialDocumentItem and $projection.MaterialDocumentYear = _SerialNo.MaterialDocumentYear
Annotations (8)
Name
Value
Level
Field
AccessControl.authorizationCheck
#NOT_REQUIRED
view
AccessControl.personalData.blocking
#NOT_REQUIRED
view
EndUserText.label
Existence Check on Material Doc Item
view
Metadata.ignorePropagatedAnnotations
true
view
VDM.viewType
#COMPOSITE
view
ObjectModel.usageType.serviceQuality
#C
view
ObjectModel.usageType.sizeCategory
#XL
view
ObjectModel.usageType.dataClass
#TRANSACTIONAL
view
Fields (3)
Key
Field
Source Table
Source Field
Description
KEY
MaterialDocument
MaterialDocument
KEY
MaterialDocumentItem
MaterialDocumentItem
KEY
MaterialDocumentYear
MaterialDocumentYear
//-- This CDS Viewis intended to check if Material Document Item consists specific fields --
//-- At the moment based on Material Document Number, Material Document Item and Material Document Year --
//-- existence of Serial Number is being check, this is open for any further improvements/additions --
@AbapCatalog.viewEnhancementCategory: [#NONE]@AccessControl: { authorizationCheck: #NOT_REQUIRED,
personalData.blocking: #NOT_REQUIRED }@EndUserText.label: 'Existence Check on Material Doc Item'
@Metadata.ignorePropagatedAnnotations: true@VDM.viewType: #COMPOSITE@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #XL,
dataClass: #TRANSACTIONAL
}defineviewentity I_ExistenceCheckOnMatlDocItem
asselectfrom I_MaterialDocumentRecord
association [0..*] to I_MatDocOvwItmSerialNumber as _SerialNo on $projection.MaterialDocument = _SerialNo.MaterialDocument
and $projection.MaterialDocumentItem = _SerialNo.MaterialDocumentItem
and $projection.MaterialDocumentYear = _SerialNo.MaterialDocumentYear
{
key MaterialDocument,
key MaterialDocumentItem,
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,
MaterialDocumentItem,
MaterialDocumentYear,
_SerialNo.PhysicalInventoryDocumentItem
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATDOCOVWITMSERIALNUMBER",
"I_MATERIALDOCUMENTRECORD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/