I_ExistenceCheckOnMaterialDoc

DDL: I_EXISTENCECHECKONMATERIALDOC Type: view_entity COMPOSITE

Existence Check on Material Document

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.

Data Sources (1)

SourceAliasJoin Type
I_MaterialDocumentRecord I_MaterialDocumentRecord from

Associations (1)

CardinalityTargetAliasCondition
[0..*] I_MaterialDocumentOvwSerialNo _SerialNo $projection.MaterialDocument = _SerialNo.MaterialDocument and $projection.MaterialDocumentYear = _SerialNo.MaterialDocumentYear

Annotations (8)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
KEY MaterialDocument MaterialDocument
KEY MaterialDocumentYear MaterialDocumentYear
//-- This CDS View is 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
                           }
               }

define view entity I_ExistenceCheckOnMaterialDoc
  as select from 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(case when _SerialNo.SerialNumber is null

//                        then 'X'

//                     else '' end

//           ) as boolean preserving type) as MatlDocHasNoSerializedMaterial,

//      @Semantics.booleanIndicator: true

//      case min(_SerialNo.PhysicalInventoryDocumentItem)

//          when '000'

//            then 'X'

//            else ''

//          end                            as MatDocHasNoSrlNmbrForPInv

//      


cast(

            // This field is 'X' when either the material in the material document is NOT 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(case when (     ( _SerialNo.SerialNumber is not null and _SerialNo.PhysicalInventoryDocumentItem <> '000' )
                            or  ( _SerialNo.SerialNumber is null )                              
                          )
                        then 'X'
                     else '' end
           ) as boolean preserving type) as MatlDocHasNoSerializedMaterial, 
      
      @Semantics.booleanIndicator: true
      min( case when ( _SerialNo.PhysicalInventoryDocumentItem is null or _SerialNo.PhysicalInventoryDocumentItem = '000' )   
                  then 'X'
                else ''
           end 
         ) as MatDocHasNoSrlNmbrForPInv

}
group by
  MaterialDocument,
  MaterialDocumentYear,
  _SerialNo.PhysicalInventoryDocumentItem
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIALDOCUMENTOVWSERIALNO",
"I_MATERIALDOCUMENTRECORD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/