P_MPEMaterial

DDL: P_MPEMATERIAL Type: view_entity CONSUMPTION Package: ODATA_MPE_MATERIAL

Private view for Material pop over

P_MPEMaterial is a Consumption CDS View that provides data about "Private view for Material pop over" in SAP S/4HANA. It reads from 2 data sources (I_ProductPlant, P_MPE_MaterialStorageLocation) and exposes 31 fields with key fields Material, Plant, StorageLocation. It has 9 associations to related views. Part of development package ODATA_MPE_MATERIAL.

Data Sources (2)

SourceAliasJoin Type
I_ProductPlant _ProductPlant from
P_MPE_MaterialStorageLocation _StgLoc left_outer

Parameters (1)

NameTypeDefault
P_Language sylangu

Associations (9)

CardinalityTargetAliasCondition
[1..1] I_Product _Product $projection.Material = _Product.Product
[1..1] I_ProductDescription _ProductDS _ProductDS.Product = $projection.Material and _ProductDS.Language = $parameters.P_Language
[1..1] I_MRPController _MRPController _MRPController.Plant = $projection.Plant and _MRPController.MRPController = _ProductPlant.MRPResponsible
[1..1] I_MatlProcurementCategoryText _ProcurementText _ProcurementText.MaterialProcurementCategory = _ProductPlant.ProcurementType and _ProcurementText.Language = $parameters.P_Language
[1..1] P_MPE_MaterialStockQuantity _ProductStock _ProductStock.Material = $projection.Material and _ProductStock.Plant = $projection.Plant and _ProductStock.StorageLocation = $projection.StorageLocation
[1..1] I_Plant _Plant _Plant.Plant = $projection.Plant
[1..1] I_MPESrlNmbPrfText _SerialNumberText _SerialNumberText.SerialNumberProfile = _ProductPlant.SerialNumberProfile and _SerialNumberText.Language = $parameters.P_Language
[1..1] I_MRPTypeText _MRPText _MRPText.MRPType = _ProductPlant.MRPType and _MRPText.Language = $parameters.P_Language
[1..1] I_ProductionSupervisor _ProductionSup _ProductionSup.Plant = $projection.Plant and _ProductionSup.ProductionSupervisor = _ProductPlant.ProductionSupervisor association[1..1] to P_MPE_MaterialPlantStkQty as _PlantStock on $projection.Material = _PlantStock.Material and $projection.Plant = _PlantStock.Plant and $projection.StorageLocation = '' association[1..1] to P_MPE_MaterialPlantSalesStkQty as _PlantSalesStock on $projection.Material = _PlantSalesStock.Material and $projection.Plant = _PlantSalesStock.Plant and $projection.StorageLocation = '' association[1..1] to P_MPE_MaterialPlantWBSStkQty as _PlantWBSSTock on $projection.Material = _PlantWBSSTock.Material and $projection.Plant = _PlantWBSSTock.Plant and $projection.StorageLocation = ''

Annotations (4)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #CONSUMPTION view
VDM.private true view
EndUserText.label Private view for Material pop over view

Fields (31)

KeyFieldSource TableSource FieldDescription
KEY Material I_ProductPlant Product
KEY Plant I_ProductPlant Plant
KEY StorageLocation P_MPE_MaterialStorageLocation StorageLocation
StorageLocationName P_MPE_MaterialStorageLocation StorageLocationName
ProductionPlant _Plant PlantName
MRPPlant I_ProductPlant Plant
ProductDescription _ProductDS ProductDescription
MRPController _MRPController MRPController
MRPControllerName _MRPController MRPControllerName
MRPControllerPhoneNumber _MRPController MRPControllerPhoneNumber
ProductionSupervisor I_ProductPlant ProductionSupervisor
ProductionSupervisorName _ProductionSup ProductionSupervisorName
MRPType I_ProductPlant MRPType
MRPTypeName _MRPText MRPTypeName
BlockedStockendasBlockedStockQuantity
ProductionSchedulingProfile I_ProductPlant ProductionSchedulingProfile
SerialNumberProfile I_ProductPlant SerialNumberProfile
SerialNumberProfileName _SerialNumberText SerialNumberProfileName
IsApprovedBatchRecordReqd _Product IsApprovedBatchRecordReqd
UnderDelivToleranceLimit I_ProductPlant UnderDelivToleranceLimit
OverDelivToleranceLimit I_ProductPlant OverDelivToleranceLimit
MaterialProcurementCatName _ProcurementText MaterialProcurementCatName
SpecialProcurementType I_ProductPlant SpecialProcurementType
SafetyStockQuantity I_ProductPlant SafetyStockQuantity
DeliveryToleranceUnit
BaseUnit _Product BaseUnit
MRPResponsible I_ProductPlant MRPResponsible
ProcurementType I_ProductPlant ProcurementType
_Product _Product
_MRPController _MRPController
_ProductionSup _ProductionSup
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AccessControl.privilegedAssociations: ['_MRPController', '_ProductionSup']
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@EndUserText.label: 'Private view for Material pop over'
define view entity P_MPEMaterial
 with parameters
    @Consumption.hidden: true
    @Environment.systemField: #SYSTEM_LANGUAGE
    P_Language : sylangu
  as select from I_ProductPlant as _ProductPlant
  left outer join P_MPE_MaterialStorageLocation as _StgLoc on  _ProductPlant.Product = _StgLoc.Product
                                                           and _ProductPlant.Plant   = _StgLoc.Plant
  association [1..1] to I_Product                     as _Product               on  $projection.Material = _Product.Product
  association [1..1] to I_ProductDescription          as _ProductDS             on  _ProductDS.Product  = $projection.Material
                                                                                and _ProductDS.Language = $parameters.P_Language
  association [1..1] to I_MRPController               as _MRPController         on  _MRPController.Plant         = $projection.Plant //1

                                                                                and _MRPController.MRPController = _ProductPlant.MRPResponsible
  association [1..1] to I_MatlProcurementCategoryText as _ProcurementText       on  _ProcurementText.MaterialProcurementCategory = _ProductPlant.ProcurementType
                                                                                and _ProcurementText.Language                    = $parameters.P_Language
  association [1..1] to P_MPE_MaterialStockQuantity as _ProductStock on  _ProductStock.Material = $projection.Material
                                                                            and _ProductStock.Plant = $projection.Plant
                                                                            and _ProductStock.StorageLocation = $projection.StorageLocation
  association [1..1] to I_Plant                       as _Plant                 on  _Plant.Plant = $projection.Plant
  association [1..1] to I_MPESrlNmbPrfText            as _SerialNumberText      on  _SerialNumberText.SerialNumberProfile = _ProductPlant.SerialNumberProfile
                                                                                and _SerialNumberText.Language            = $parameters.P_Language
  association [1..1] to I_MRPTypeText                 as _MRPText               on  _MRPText.MRPType  = _ProductPlant.MRPType
                                                                                and _MRPText.Language = $parameters.P_Language
  association [1..1] to I_ProductionSupervisor        as _ProductionSup         on  _ProductionSup.Plant                = $projection.Plant
                                                                                and _ProductionSup.ProductionSupervisor = _ProductPlant.ProductionSupervisor //2

    association[1..1] to P_MPE_MaterialPlantStkQty as _PlantStock on $projection.Material = _PlantStock.Material
                                                                and $projection.Plant = _PlantStock.Plant
                                                                and $projection.StorageLocation = ''
    association[1..1] to P_MPE_MaterialPlantSalesStkQty as _PlantSalesStock on $projection.Material = _PlantSalesStock.Material
                                                                        and $projection.Plant = _PlantSalesStock.Plant
                                                                        and $projection.StorageLocation = ''
    association[1..1] to P_MPE_MaterialPlantWBSStkQty as _PlantWBSSTock on $projection.Material = _PlantWBSSTock.Material
                                                                        and $projection.Plant = _PlantWBSSTock.Plant
                                                                        and $projection.StorageLocation = ''
{
       //        "Material"

       //        Material Number

  key  _ProductPlant.Product                                                                                   as Material,
       
  key  _ProductPlant.Plant                                                                                     as Plant,
  
  key _StgLoc.StorageLocation,
        
        _StgLoc.StorageLocationName,
        //      Plant Description

       _Plant.PlantName                                                                                        as ProductionPlant,

       _ProductPlant.Plant                                                                                     as MRPPlant,
       //       MRPArea

//       case  when _MRPArea.Material = _ProductPlant.Product then _MRPArea.MRPArea else _ProductPlant.Plant end as MRPArea,

       //        Material Description

       _ProductDS.ProductDescription,

       _MRPController.MRPController,
       _MRPController.MRPControllerName,
       _MRPController.MRPControllerPhoneNumber,

       _ProductPlant.ProductionSupervisor,
       _ProductionSup.ProductionSupervisorName,
       //       MRP Type

       _ProductPlant.MRPType,
       _MRPText.MRPTypeName,
       //       Current Stock in PLant

       
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
                then _PlantStock.UnrestrinctedStock
                else _ProductStock.UnrestrinctedStock
            end as nsdm_stock_qty) as VltdUnrestrictedUseStkQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantStock.QualityInspectionStock
             else _ProductStock.QualityInspectionStock
        end as insme) as QualityInspectionStockQuantity,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantStock.StockInTrsferrStgeLoc
             else _ProductStock.StockInTrsferrStgeLoc
        end as stockintransferquantity) as TransferStockStorageLocQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantStock.StockInTrsferrPlant
             else _ProductStock.StockInTrsferrPlant
        end as stockintransferquantity) as StockInTransferQuantity,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantStock.RestricktedUserStock
             else _ProductStock.RestricktedUserStock
        end as einme) as RestrictedStockQuantity,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       case when _StgLoc.StorageLocation = ''
             then _PlantStock.BlockedStock
             else _ProductStock.BlockedStock
        end as BlockedStockQuantity,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantSalesStock.UnrestrinctedStock
             else _ProductStock.SalesUnrestrictedStock
        end as nsdm_stock_qty) as SalesUnrestrictedStockQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantSalesStock.QualityInspectionStock
             else _ProductStock.SalesQualityInspectionStock
        end as insme) as SalesQualityInspectionStockQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantSalesStock.StockInTrsferrStgeLoc
             else _ProductStock.SalesStockInTrsferrStgeLoc
        end as stockintransferquantity) as SlsStkInTransfStorLocStockQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantSalesStock.StockInTrsferrPlant
             else _ProductStock.SalesStockInTrsferrPlant
        end as stockintransferquantity) as SalesStockInTransfPlntStockQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantSalesStock.RestricktedUserStock
             else _ProductStock.SalesRestricktedUserStock
        end as einme) as SalesRestrictedUserStockQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       case when _StgLoc.StorageLocation = ''
             then _PlantSalesStock.BlockedStock
             else _ProductStock.SalesBlockedStock
        end as SalesBlockedStockQuantity,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantWBSSTock.UnrestrinctedStock
             else _ProductStock.WBSUnrestrictedStock
        end as nsdm_stock_qty) as ProjStkUnrestrictedUseStkQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantWBSSTock.QualityInspectionStock
             else _ProductStock.WBSQualityInspectionStock
        end as insme) as ProjectQualityInspectionStkQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantWBSSTock.StockInTrsferrStgeLoc
             else _ProductStock.WBSStockInTrsferrStgeLoc
        end as stockintransferquantity) as ProjStkInTransfStorLocStkQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantWBSSTock.StockInTrsferrPlant
             else _ProductStock.WBSStockInTrsferrPlant
        end as stockintransferquantity) as ProjectStockInTransfPlntStkQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       cast(case when _StgLoc.StorageLocation = ''
             then _PlantWBSSTock.RestricktedUserStock
             else _ProductStock.WBSRestricktedUserStock
        end as einme) as ProjectRestrictedUserStockQty,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       @DefaultAggregation : #SUM
       case when _StgLoc.StorageLocation = ''
             then _PlantWBSSTock.BlockedStock
             else _ProductStock.WBSBlockedStock
        end as ProjectBlockedStockQuantity,
       //       "Material Master Data"

       //       Production Scheduling Profile

       _ProductPlant.ProductionSchedulingProfile,
       //       Serial Number Profile

       _ProductPlant.SerialNumberProfile,
       _SerialNumberText.SerialNumberProfileName,
       //       Batch Management Required (Indicator)

       _Product.IsApprovedBatchRecordReqd,
       //       Tolerance Data (under-/Over delivery)

       @Semantics.quantity.unitOfMeasure: 'DeliveryToleranceUnit'
       _ProductPlant.UnderDelivToleranceLimit,
       @Semantics.quantity.unitOfMeasure: 'DeliveryToleranceUnit'
       _ProductPlant.OverDelivToleranceLimit,

       //       Procurement Type

       _ProcurementText.MaterialProcurementCatName,
       //       Special Procurement Key

       _ProductPlant.SpecialProcurementType,
       //       Safety Stock

       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       _ProductPlant.SafetyStockQuantity,
       cast('%' as unit)                                                                                       as DeliveryToleranceUnit,
       _Product.BaseUnit,

       _ProductPlant.MRPResponsible,
       _ProductPlant.ProcurementType,

       _Product,
       _MRPController,
       _ProductionSup
}  

where _ProductPlant.Product != ''