@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Basic View for Supply Assignment'
@VDM: {
viewType: #COMPOSITE,
lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking: #('TRANSACTIONAL_DATA')
}
@AbapCatalog: {
sqlViewName: 'ISDOSUPASSGMT1',
compiler.compareFilter: true
}
@ObjectModel: {
usageType: {
dataClass: #TRANSACTIONAL,
serviceQuality: #X,
sizeCategory: #XXL
}
}
define view I_SupDmndOvwSupAssgmtAll
as select from I_SupDmndOvwSupplyAssignment as Assgmt
left outer join I_SupDmndOvwDemand as Demand on Assgmt.RequirementDocumentNumber = Demand.RequirementDocumentNumber
and Assgmt.RequirementDocumentItem = Demand.RequirementDocumentItem
and Assgmt.RequestedDate = Demand.RequestedDate
and Assgmt.ProductAvailabilityDate = Demand.ProductAvailabilityDate
and Assgmt.RequirementType = Demand.RequirementType
// and Assgmt.PRODALLOCATIONUUID = Demand.prodallocationuuid
left outer join I_CalendarDate as CalDate on Assgmt.ProductAvailabilityDate = CalDate.CalendarDate
left outer join I_CalendarMonthName as CalMonth on CalDate.CalendarMonth = CalMonth.CalendarMonth
// left outer join I_SupDmndOvwSupply as Supply on Assgmt.SupplyNumber = Supply.SupplyNumber
// and Assgmt.SupplyItem = Supply.SupplyItem
// and Assgmt.SupplyScheduleLine = Supply.SupplyScheduleLine
// and Assgmt.Material = Supply.Material
// and Assgmt.Plant = Supply.Plant
// and Assgmt.StorageLocation = Supply.StorageLocation
// and Assgmt.AssignedSupplyType = Supply.AssignedSupplyType
{
Assgmt.Plant,
Assgmt.Material,
Assgmt.StorageLocation,
Assgmt.Batch,
Assgmt.RequirementType,
Assgmt.RequirementDocumentNumber,
Assgmt.RequirementDocumentItem,
Assgmt.AssignedSupplyType,
Assgmt.SupplyNumber,
Assgmt.SupplyItem,
Assgmt.SupplyScheduleLine,
Assgmt.AssignedDemandTypeName,
Assgmt.AssignedSupplyTypeName,
Assgmt.NumberOfDays,
// Assgmt.NumberOfDays as TimeHorizonInDays,
CalDate.CalendarMonth,
concat_with_space('Week',CalDate.CalendarWeek, 1) as CalendarWeek,
CalDate.CalendarYear,
CalMonth.CalendarMonthName,
sum(Assgmt.AssignedQuantityInBaseUnit) as AssignedQuantityInBaseUnit,
sum(Assgmt.NormalAssignedQuantityInBsUnt) as NormalAssignedQuantityInBsUnt,
sum(Assgmt.FixedQuantityInBaseUnit) as FixedQuantityInBaseUnit,
sum(Assgmt.SupAssgmtReservedQtyInBaseUnit) as SupAssgmtReservedQtyInBaseUnit,
sum(Assgmt.OnHoldQuantityInBaseUnit) as OnHoldQuantityInBaseUnit,
sum(Assgmt.ReadyForReleaseQtyInBaseUnit) as ReadyForReleaseQtyInBaseUnit,
sum(Assgmt.InboundAssignedQuantityInBsUnt) as InboundAssignedQuantityInBsUnt,
sum(Assgmt.PreviewFixedAssignedQtyInBsUnt) as PreviewFixedAssignedQtyInBsUnt,
sum(Assgmt.PreviewReservedAssgdQtyInBsUnt) as PreviewReservedAssgdQtyInBsUnt,
sum(Assgmt.PreviewOnHoldAssgdQtyInBsUnt) as PreviewOnHoldAssgdQtyInBsUnt,
sum(Assgmt.PreviewRdyForReleaseQtyInBsUnt) as PreviewRdyForReleaseQtyInBsUnt,
sum(Assgmt.PreviewAssignedQuantityInBsUnt) as PreviewAssignedQuantityInBsUnt,
Assgmt.BaseUnit,
Assgmt.RequestedDate,
Assgmt.ProductAvailabilityDate,
Demand.RequestedDeliveryDate,
Assgmt.SupplyDeliveryDate,
Assgmt.RequirementSegment,
Assgmt.StockSegment,
Demand.OrderType,
Demand.SalesOrganization,
Demand.DistributionChannel,
Demand.MaterialGroup,
Demand.ProductSeasonYear,
Demand.ProductSeason,
Demand.ProductCollection,
Demand.ProductTheme,
Demand.ShippingGroupRule,
Demand.ShippingGroupNumber,
Demand.CustomerGroup,
Demand.SalesDistrict,
Demand.CrossPlantConfigurableProduct,
Demand.CompanyCode,
Demand.Division,
Demand.FashionCancelDate,
Demand.ARunPriorityValue,
Demand.ARunDemandGroupPriority
// Assgmt.PRODALLOCATIONUUID,
// Demand.productallocationobject
// Demand.
}
where Demand.IsBusinessPurposeCompleted = ''
group by
Assgmt.Plant,
Assgmt.Material,
Assgmt.StorageLocation,
Assgmt.Batch,
Assgmt.RequirementType,
Assgmt.RequirementDocumentNumber,
Assgmt.RequirementDocumentItem,
Assgmt.AssignedSupplyType,
Assgmt.SupplyNumber,
Assgmt.SupplyItem,
Assgmt.SupplyScheduleLine,
Assgmt.AssignedDemandTypeName,
Assgmt.AssignedSupplyTypeName,
Assgmt.NumberOfDays,
Assgmt.BaseUnit,
Assgmt.RequestedDate,
Assgmt.ProductAvailabilityDate,
Assgmt.SupplyDeliveryDate,
Assgmt.RequirementSegment,
Assgmt.StockSegment,
Demand.RequestedDeliveryDate,
Demand.OrderType,
Demand.SalesOrganization,
Demand.DistributionChannel,
Demand.MaterialGroup,
Demand.ProductSeasonYear,
Demand.ProductSeason,
Demand.ProductCollection,
Demand.ProductTheme,
Demand.ShippingGroupRule,
Demand.ShippingGroupNumber,
Demand.CustomerGroup,
Demand.SalesDistrict,
Demand.CrossPlantConfigurableProduct,
Demand.CompanyCode,
Demand.Division,
Demand.FashionCancelDate,
CalDate.CalendarMonth,
CalendarWeek,
CalendarYear,
CalendarMonthName,
Demand.ARunPriorityValue,
Demand.ARunDemandGroupPriority
// Assgmt.PRODALLOCATIONUUID,
// productallocationobject
//@ClientHandling.algorithm: #SESSION_VARIABLE
//@EndUserText.label: 'Basic View for Supply Assignment'
//@VDM: {
// viewType: #COMPOSITE,
// lifecycle.contract.type: #PUBLIC_LOCAL_API
//}
//@AccessControl: {
// authorizationCheck: #CHECK,
// personalData.blocking: #('TRANSACTIONAL_DATA')
//}
//@AbapCatalog: {
// sqlViewName: 'ISDOSUPASSGMT1',
// compiler.compareFilter: true
// }
//@ObjectModel: {
// usageType: {
// dataClass: #TRANSACTIONAL,
// serviceQuality: #X,
// sizeCategory: #XXL
// }
//}
//define view I_SupDmndOvwSupAssgmtAll
// as select from I_SupDmndOvwSupplyAssignment as Assgmt
// left outer join I_SupDmndOvwDemand as Demand on Assgmt.RequirementDocumentNumber = Demand.RequirementDocumentNumber
// and Assgmt.RequirementDocumentItem = Demand.RequirementDocumentItem
// and Assgmt.RequirementType = Demand.RequirementType
//// left outer join I_SupDmndOvwSupply as Supply on Assgmt.SupplyNumber = Supply.SupplyNumber
//// and Assgmt.SupplyItem = Supply.SupplyItem
//// and Assgmt.SupplyScheduleLine = Supply.SupplyScheduleLine
//// and Assgmt.Material = Supply.Material
//// and Assgmt.Plant = Supply.Plant
//// and Assgmt.StorageLocation = Supply.StorageLocation
//// and Assgmt.AssignedSupplyType = Supply.AssignedSupplyType
//{
// Assgmt.Plant,
// Assgmt.Material,
// Assgmt.StorageLocation,
// Assgmt.Batch,
// Assgmt.RequirementType,
// Assgmt.RequirementDocumentNumber,
// Assgmt.RequirementDocumentItem,
// Assgmt.AssignedSupplyType,
// Assgmt.SupplyNumber,
// Assgmt.SupplyItem,
// Assgmt.SupplyScheduleLine,
// Assgmt.AssignedDemandTypeName,
// Assgmt.AssignedSupplyTypeName,
//// Assgmt.NumberOfDays,
// case
// when Assgmt.NumberOfDays <= 0 then 'Early/On Time'
// when Assgmt.NumberOfDays < 7 then '< 1 week'
// when Assgmt.NumberOfDays < 14 then '1 to 2 weeks'
// when Assgmt.NumberOfDays < 21 then '2 to 3 weeks'
// when Assgmt.NumberOfDays <= 28 then '3 to 4 weeks'
// when Assgmt.NumberOfDays > 28 then '> 4 weeks'
// end as TimeHorizonInDays,
// sum(Assgmt.AssignedQuantityInBaseUnit) as AssignedQuantityInBaseUnit,
// sum(Assgmt.NormalAssignedQuantityInBsUnt) as NormalAssignedQuantityInBsUnt,
// sum(Assgmt.FixedQuantityInBaseUnit) as FixedQuantityInBaseUnit,
//// sum(Assgmt.ReservedQuantityinBaseUnit) as ReservedQuantityinBaseUnit,
// sum(Assgmt.OnHoldQuantityInBaseUnit) as OnHoldQuantityInBaseUnit,
// sum(Assgmt.ReadyForReleaseQtyInBaseUnit) as ReadyForReleaseQtyInBaseUnit,
// sum(Assgmt.InboundAssignedQuantityInBsUnt) as InboundAssignedQuantityInBsUnt,
// sum(Assgmt.PreviewFixedAssignedQtyInBsUnt) as PreviewFixedAssignedQtyInBsUnt,
// sum(Assgmt.PreviewReservedAssgdQtyInBsUnt) as PreviewReservedAssgdQtyInBsUnt,
// sum(Assgmt.PreviewOnHoldAssgdQtyInBsUnt) as PreviewOnHoldAssgdQtyInBsUnt,
// sum(Assgmt.PreviewRdyForReleaseQtyInBsUnt) as PreviewRdyForReleaseQtyInBsUnt,
// sum(Assgmt.PreviewAssignedQuantityInBsUnt) as PreviewAssignedQuantityInBsUnt,
// Assgmt.BaseUnit,
// Assgmt.RequestedDate,
// Assgmt.ProductAvailabilityDate,
// Assgmt.SupplyDeliveryDate,
// Assgmt.RequirementSegment,
// Assgmt.StockSegment,
// Demand.OrderType,
// Demand.SalesOrganization,
// Demand.DistributionChannel,
// Demand.SalesGroup,
// Demand.SalesOffice,
// Demand.MaterialGroup,
// Demand.ProductSeasonYear,
// Demand.ProductSeason,
// Demand.ProductCollection,
// Demand.ProductTheme,
// Demand.ShippingGroupRule,
// Demand.ShippingGroupNumber,
// Demand.ProductCharacteristic1,
// Demand.ProductCharacteristic2,
// Demand.ProductCharacteristic3,
// Demand.CustomerGroup,
// Demand.SalesDistrict,
// Demand.CrossPlantConfigurableProduct,
// Demand.FreeDefinedProductAttribute01,
// Demand.FreeDefinedProductAttribute02,
// Demand.FreeDefinedProductAttribute03,
// Demand.RetailArticleColor,
// Demand.RetailArticleMainSize,
// Demand.RetailArticleSecondSize,
// Demand.CompanyCode
// // Demand.
//}
//group by
// Assgmt.Plant,
// Assgmt.Material,
// Assgmt.StorageLocation,
// Assgmt.Batch,
// Assgmt.RequirementType,
// Assgmt.RequirementDocumentNumber,
// Assgmt.RequirementDocumentItem,
// Assgmt.AssignedSupplyType,
// Assgmt.SupplyNumber,
// Assgmt.SupplyItem,
// Assgmt.SupplyScheduleLine,
// Assgmt.AssignedDemandTypeName,
// Assgmt.AssignedSupplyTypeName,
// Assgmt.NumberOfDays,
// Assgmt.BaseUnit,
// Assgmt.RequestedDate,
// Assgmt.ProductAvailabilityDate,
// Assgmt.SupplyDeliveryDate,
// Assgmt.RequirementSegment,
// Assgmt.StockSegment,
// Demand.OrderType,
// Demand.SalesOrganization,
// Demand.DistributionChannel,
// Demand.SalesGroup,
// Demand.SalesOffice,
// Demand.MaterialGroup,
// Demand.ProductSeasonYear,
// Demand.ProductSeason,
// Demand.ProductCollection,
// Demand.ProductTheme,
// Demand.ShippingGroupRule,
// Demand.ShippingGroupNumber,
// Demand.ProductCharacteristic1,
// Demand.ProductCharacteristic2,
// Demand.ProductCharacteristic3,
// Demand.CustomerGroup,
// Demand.SalesDistrict,
// Demand.CrossPlantConfigurableProduct,
// Demand.FreeDefinedProductAttribute01,
// Demand.FreeDefinedProductAttribute02,
// Demand.FreeDefinedProductAttribute03,
// Demand.RetailArticleColor,
// Demand.RetailArticleMainSize,
// Demand.RetailArticleSecondSize,
// Demand.CompanyCode
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CALENDARDATE",
"I_CALENDARMONTHNAME",
"I_SUPDMNDOVWDEMAND",
"I_SUPDMNDOVWSUPPLYASSIGNMENT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/