@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Data for Project Material Component – TP'
@VDM.viewType: #TRANSACTIONAL
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory : #XL
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
define view entity R_ProjNtwkActyMatlCompTP
as select from I_ProjectMaterialCompBasicData
association to parent R_ProjectNetworkActivityTP as _ProjectNetworkActivity on $projection.ProjectNetworkInternalID = _ProjectNetworkActivity.ProjectNetworkInternalID
and $projection.NetworkActivityInternalID = _ProjectNetworkActivity.ProjNetworkActivityInternalID
association [1..1] to R_ProjectNetworkTP as _ProjectNetwork on $projection.ProjectNetwork = _ProjectNetwork.ProjectNetwork
association [1..1] to E_ReservationDocumentItem as _ReservationExtension on $projection.Reservation = _ReservationExtension.Reservation
and $projection.ReservationItem = _ReservationExtension.ReservationItem
and $projection.RecordType = _ReservationExtension.RecordType
association [1..1] to E_ProjectMaterialComponent as _MaterialExtension on $projection.Reservation = _MaterialExtension.Reservation
and $projection.ReservationItem = _MaterialExtension.ReservationItem
and $projection.RecordType = _MaterialExtension.RecordType
{
key Reservation,
key ReservationItem,
key RecordType,
ProjectNetworkInternalID,
NetworkActivityInternalID,
ProjectNetwork,
NetworkActivity,
Material,
@Semantics.text: true
_MaterialText.MaterialName,
Plant,
BOMItemCategory,
BillOfMaterialItemNumber,
@Semantics.text: true
BOMItemDescription,
RqmtDateIsEnteredManually,
MatlCompRequirementDate,
@Semantics.quantity.unitOfMeasure: 'OperationLeadTimeOffsetUnit'
OperationLeadTimeOffset,
OperationLeadTimeOffsetUnit,
GoodsRecipientName,
UnloadingPointName,
MatlCompIsMarkedForDeletion as IsMarkedForDeletion,
StorageLocation,
ProductionSeries,
GoodsMovementIsAllowed,
ReservationIsFinallyIssued,
IsBulkMaterialComponent,
MatlCompIsMarkedForBackflush,
MaterialComponentIsMissing,
BillOfMaterialInternalID,
BillOfMaterialVariant,
GoodsMovementType,
cast(
case
when MaterialCompIsProcuredDirectly <> 'F' and MatlCompIsProcuredExternally = ' ' and IsPreliminaryOrder = ' ' and AccountAssignmentCategory = ' '
then 'K05'
when MaterialCompIsProcuredDirectly <> 'F' and MatlCompIsProcuredExternally = ' ' and IsPreliminaryOrder = 'X' and AccountAssignmentCategory = ' '
then 'K12'
when MaterialCompIsSpecialStock = ' ' and AccountAssignmentCategory <> ' ' and _ProjMatCompAdditionalData.IsThirdPartyRequisition = ' '
then 'K01'
when MaterialCompIsSpecialStock = ' ' and AccountAssignmentCategory <> ' ' and _ProjMatCompAdditionalData.IsThirdPartyRequisition = 'X'
then 'K02'
when MaterialCompIsProcuredDirectly <> 'F' and MatlCompIsProcuredExternally = ' ' and IsPreliminaryOrder = ' ' and MaterialCompIsSpecialStock = 'Q' and AccountAssignmentCategory <> ' ' and RequirementPlan = ' '
then 'K06'
when (IsPreliminaryOrder = 'X' or RequirementPlan <> ' ') and (MaterialCompIsProcuredDirectly <> 'F' and MatlCompIsProcuredExternally = ' ' and MaterialCompIsSpecialStock = 'Q' and AccountAssignmentCategory <> ' ')
then 'K10'
when (MatlCompIsProcuredExternally = 'X' or MaterialCompIsProcuredDirectly = 'F') and (IsPreliminaryOrder = ' ' and MaterialCompIsSpecialStock = 'Q' and AccountAssignmentCategory <> ' ' and _ProjMatCompAdditionalData.IsThirdPartyRequisition = ' ')
then 'K08'
when (MatlCompIsProcuredExternally = 'X' or MaterialCompIsProcuredDirectly = 'F') and (MaterialCompIsSpecialStock = 'Q' and AccountAssignmentCategory <> ' ' and _ProjMatCompAdditionalData.IsThirdPartyRequisition = 'X')
then 'K15'
when (MatlCompIsProcuredExternally = 'X' or MaterialCompIsProcuredDirectly = 'F') and (IsPreliminaryOrder = 'X' and MaterialCompIsSpecialStock = 'Q' and AccountAssignmentCategory <> ' ' and _ProjMatCompAdditionalData.IsThirdPartyRequisition = ' ')
then 'K03'
when MaterialCompIsProcuredDirectly <> 'F' and MatlCompIsProcuredExternally = ' ' and IsPreliminaryOrder = ' ' and MaterialCompIsSpecialStock = 'E' and AccountAssignmentCategory <> ' ' and RequirementPlan = ' '
then 'K07'
when (IsPreliminaryOrder = 'X' or RequirementPlan <> ' ') and (MaterialCompIsProcuredDirectly <> 'F' and MatlCompIsProcuredExternally = ' ' and MaterialCompIsSpecialStock = 'E' and AccountAssignmentCategory <> ' ')
then 'K11'
when (MatlCompIsProcuredExternally = 'X' or MaterialCompIsProcuredDirectly = 'F') and (IsPreliminaryOrder = ' ' and MaterialCompIsSpecialStock = 'E' and AccountAssignmentCategory <> ' ' and _ProjMatCompAdditionalData.IsThirdPartyRequisition = ' ')
then 'K09'
when (MatlCompIsProcuredExternally = 'X' or MaterialCompIsProcuredDirectly = 'F') and (MaterialCompIsSpecialStock = 'E' and AccountAssignmentCategory <> ' ' and _ProjMatCompAdditionalData.IsThirdPartyRequisition = 'X')
then 'K16'
when (MatlCompIsProcuredExternally = 'X' or MaterialCompIsProcuredDirectly = 'F') and (IsPreliminaryOrder = 'X' and MaterialCompIsSpecialStock = 'E' and AccountAssignmentCategory <> ' ' and _ProjMatCompAdditionalData.IsThirdPartyRequisition = ' ')
then 'K04'
end as ps_s4_procmttyp ) as MatlCompProcurementType,
BaseUnit,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
RequirementQuantityInBaseUnit,
@EndUserText.label: 'Committed Quantity'
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
case
when EntryUnit <> ' ' and EntryUnit <> BaseUnit
then
case
when ConfirmedAvailableQuantity = RequirementQuantityInBaseUnit
then
case
when RequirementQuantityInBaseUnit is null
then cast (RequirementQuantityInBaseUnit as abap.fltp)
else
cast (QuantityInEntryUnit as abap.fltp)
end
else
cast(ConfirmedAvailableQuantity as abap.fltp) * ( cast(MaterialQtyToBaseQtyDnmntr as abap.fltp) / cast(QuantityNumerator as abap.fltp))
end
else
cast(ConfirmedAvailableQuantity as abap.fltp)
end as CommittedQuantity,
cast(
case
when RqmtDateIsEnteredManually <> 'X' and
DistributionFunction = 'S10'
then 'X'
end as sched_start ) as AlignmentIsOperationStartDate,
cast(
case
when RqmtDateIsEnteredManually <> 'X' and
DistributionFunction = 'S50'
then 'X'
end as sched_end ) as AlignmentIsOperationEndDate,
QuantityDistributionKey,
SortField,
case
when MatlCompIsRelevantForMRP = ' ' or
RequirementPlan <> '' and
RequirementPlan is not initial and
RequirementPlan is not null
then '3'
when MatlCompIsRelevantForMRP = '1'
then '1'
when MatlCompIsRelevantForMRP = 'X'
then '2'
when MatlCompIsRelevantForMRP = 'B'
then '4'
else ' '
end as PurReqnOrResvnGeneration,
_ProjMatCompAdditionalData.CreatedByUser,
_ProjMatCompAdditionalData.CreationDate,
_ProjMatCompAdditionalData.LastChangedByUser,
_ProjMatCompAdditionalData.LastChangeDate,
BillOfMaterialCategory,
_ProjMatCompAdditionalData.BOMExplosionFixedKeyDate,
Batch,
MaterialCompIsCostRelevant,
PurchasingGroup,
MaterialComponentPrice,
Currency,
PurchasingInfoRecord,
MaterialPriceUnitQty,
GLAccount,
Creditor,
GoodsReceiptDurationInDays,
DeliveryDurationInDays,
MaterialGroup,
@Semantics.quantity.unitOfMeasure: 'EntryUnit'
QuantityInEntryUnit,
EntryUnit,
_PurchaseRequisitionItemBasic.PurchaseRequisition,
_PurchaseRequisitionItemBasic.PurchaseRequisitionItem,
case
when _PurchaseRequisitionItemBasic.PurchaseRequisition is not initial
then _PurchaseRequisitionItemBasic.PurchasingOrganization
else _ProjMatCompAdditionalData.PurchasingOrganization
end as PurchasingOrganization,
case
when ( _PurchaseRequisitionItemBasic.OverallLimitAmount is not initial and _PurchaseRequisitionItemBasic.ExpectedOverallLimitAmount is not initial )
then _PurchaseRequisitionItemBasic.PurContractForOverallLimit
else _PurchaseRequisitionItemBasic.PurchaseContract
end as PurchaseContract,
_PurchaseRequisitionItemBasic.PurchaseContractItem,
case
when _PurchaseRequisitionItemBasic.PurchaseRequisition is not initial
then _PurchaseRequisitionItemBasic.RequisitionerName
else _ProjMatCompAdditionalData.RequisitionerUser
end as RequisitionerUser,
case
when _PurchaseRequisitionItemBasic.PurchaseRequisition is not initial
then _PurchaseRequisitionItemBasic.RequirementTracking
else _ProjMatCompAdditionalData.RequirementTracking
end as RequirementTracking,
cast( _ProjMatCompAdditionalData.PurgInfoRecdDataIsFixed as char1 ) as PurgInfoRecdDataIsFixed,
_ProjMatCompAdditionalData.MatlCompProcmtIndicatorCode,
_ProjMatCompAdditionalData.AddressNumber,
_ProjMatCompAdditionalData.Customer,
_ProjMatCompAdditionalData.Supplier,
VariableSizeDimension1,
VariableSizeDimension2,
VariableSizeDimension3,
VariableSizeDimensionUnit,
VariableSizeCompFormulaKey,
NumberOfVariableSizeItem,
QuantityInUnitOfEntry,
VariableSizeItemQuantity,
VariableSizeComponentUnit,
ProductTypeGroupCode,
ServicePerformer,
PerformancePeriodStartDate,
PerformancePeriodEndDate,
@Semantics.quantity.unitOfMeasure: 'LeanServiceDurationUnit'
LeanServiceDuration,
LeanServiceDurationUnit,
@Semantics.amount.currencyCode: 'Currency'
_ProjMatCompAdditionalData.OverallLimitAmount,
@Semantics.amount.currencyCode: 'Currency'
_ProjMatCompAdditionalData.ExpectedOverallLimitAmount,
_ProjectNetworkActivity,
_ProjectNetwork,
_ProjMatCompAdditionalData,
_StorageLocation,
_MaterialText,
_BillOfMatItemCategoryText,
_MRPQuantityDistrKeyText
}
where
_ProjectNetworkBasicData.OrderCategory = '20'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"E_RESERVATIONDOCUMENTITEM",
"I_MATERIALTEXT",
"I_PROJECTMATERIALCOMPBASICDATA",
"I_PROJECTNETWORKBASICDATA",
"I_PROJMATCOMPADDITIONALDATA",
"I_PURCHASEREQUISITIONITEMBASIC"
],
"ASSOCIATED":
[
"I_BOMITEMCATEGORYTEXT",
"I_MATERIALTEXT",
"I_MRPQUANTITYDISTRKEYTEXT",
"I_PROJMATCOMPADDITIONALDATA",
"I_STORAGELOCATION",
"R_PROJECTNETWORKACTIVITYTP",
"R_PROJECTNETWORKTP"
],
"BASE":
[
"I_PROJECTMATERIALCOMPBASICDATA"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/