@AbapCatalog.sqlViewName: 'CINBDELITMOBJPG'
@ClientHandling.algorithm:#SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking: #BLOCKED_DATA_EXCLUDED
}
@ObjectModel: {
compositionRoot: true,
semanticKey: ['InboundDelivery', 'InboundDeliveryItem'],
usageType.dataClass: #MIXED,
usageType.serviceQuality: #C,
usageType.sizeCategory: #XL
}
@Metadata.allowExtensions: true
// Needed on CDS View level for the extensibility registry:
@EndUserText.label: 'Inbound Delivery Item Object Page'
define view C_InboundDeliveryItemObjPg
as select from I_InboundDeliveryItem
association [0..*] to C_RelPurOrdStkTranspOrdDlvr as _PurchaseOrder on $projection.ReferenceSDDocument = _PurchaseOrder.PurchaseOrder
and $projection.ReferenceSDDocumentItem = _PurchaseOrder.PurchaseOrderItem
association [0..1] to C_DeliveryPickSum as _PickingSum on $projection.InboundDelivery = _PickingSum.PrecedingDocument
and $projection.DeliveryDocumentItem = _PickingSum.PrecedingDocumentItem
association [0..1] to C_DeliveryPickSub as _PickingSub on $projection.InboundDelivery = _PickingSub.PrecedingDocument
and $projection.DeliveryDocumentItem = _PickingSub.PrecedingDocumentItem
association [0..*] to C_SerialNmbrEquipNmbrDelivery as _SerialNmbrEquipNmbrDelivery on $projection.InboundDelivery = _SerialNmbrEquipNmbrDelivery.DeliveryDocument
and $projection.DeliveryDocumentItem = _SerialNmbrEquipNmbrDelivery.DeliveryDocumentItem
//Extensibility
association [1] to E_DeliveryDocumentItem as _Extension on $projection.InboundDelivery = _Extension.DeliveryDocument
and $projection.DeliveryDocumentItem = _Extension.DeliveryDocumentItem
{
@Consumption.semanticObject: 'InboundDelivery'
key InboundDelivery,
key cast (InboundDeliveryItem as le_doc_item) as InboundDeliveryItem,
/***************************************************************************/
// HEADER
/***************************************************************************/
InboundDeliveryItem as DeliveryDocumentItem,
HigherLevelItem,
HigherLvlItmOfBatSpltItm,
cast(case
when ( HigherLevelItem = '000000' and HigherLvlItmOfBatSpltItm = '000000' )
then concat( InboundDeliveryItem, '0000000000000' )
when ( HigherLevelItem <> '000000' and HigherLvlItmOfBatSpltItm = '000000' )
then concat(concat(HigherLevelItem, InboundDeliveryItem), HigherLvlItmOfBatSpltItm )
when ( HigherLevelItem <> '000000' and HigherLvlItmOfBatSpltItm <> '000000' )
then concat(concat(HigherLevelItem, HigherLvlItmOfBatSpltItm), InboundDeliveryItem )
else
concat(concat(HigherLvlItmOfBatSpltItm, InboundDeliveryItem), HigherLevelItem )
end as abap.char( 18 )) as SortField,
PutawayStatus,
cast(
case PutawayStatus
when '' then 0
when 'A' then 2
when 'B' then 2
when 'C' then 3
else 0
end
as abap.int1
) as PutawayStatusCriticality,
WarehouseActivityStatus,
PickingConfirmationStatus,
// UI hidden annotation for Trade Compliance fields could not be placed in the metadata extension
@UI.fieldGroup: [{qualifier: 'TCStatus', position: 10, importance: #HIGH, hidden: #(TradeComplianceIsInactive) }]
@UI.textArrangement: #TEXT_FIRST
@EndUserText.label: 'Legal Control Check Status'
@ObjectModel.foreignKey.association: '_TrdCmplncLegalControlSts'
TrdCmplncLegalControlSts,
@UI.fieldGroup: [{qualifier: 'TCStatus', position: 20, importance: #HIGH, hidden: #(TradeComplianceIsInactive) }]
@UI.textArrangement: #TEXT_FIRST
@EndUserText.label: 'Embargo Status'
@ObjectModel.foreignKey.association: '_TrdCmplncEmbargoSts'
TrdCmplncEmbargoSts,
@UI.fieldGroup: [{qualifier: 'TCStatus', position: 30, importance: #HIGH, hidden: #(TradeComplianceIsInactive) }]
@UI.textArrangement: #TEXT_FIRST
@EndUserText.label: 'Watch List Screening Status'
@ObjectModel.foreignKey.association: '_TrdCmplncSnctndListChkSts'
TrdCmplncSnctndListChkSts,
@UI.hidden: true
@Semantics.booleanIndicator: true
cast (case _InboundDelivery._DeliveryDocumentType.TradeComplianceIsActive
when 'X'
then ''
else 'X'
end as boole_d preserving type) as TradeComplianceIsInactive,
/***************************************************************************/
// GENERAL INFORMATION
/***************************************************************************/
@Consumption.semanticObject: 'Material'
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_MaterialStdVH', element: 'Material' } } ]
Material,
_Material._Text[1: Language=$session.system_language].MaterialName as MaterialName,
DeliveryDocumentItemText,
DeliveryDocumentItemCategory,
MaterialByCustomer,
@Consumption.semanticObject: 'Batch'
Batch,
InventoryValuationType,
InternationalArticleNumber,
ManufactureDate,
ShelfLifeExpirationDate,
InspectionLot,
/***************************************************************************/
// QUANTITY
/***************************************************************************/
@DefaultAggregation: #NONE
@Semantics.quantity: { unitOfMeasure: 'DeliveryQuantityUnit' }
cast( OriginalDeliveryQuantity as wmeng ) as OrderQuantity,
@Semantics.unitOfMeasure: true
DeliveryQuantityUnit,
@Semantics.quantity: { unitOfMeasure: 'DeliveryQuantityUnit' }
@DefaultAggregation: #NONE
ActualDeliveryQuantity,
cast( concat_with_space(
concat_with_space( concat_with_space( cast( DeliveryToBaseQuantityDnmntr as abap.char(9) ), DeliveryQuantityUnit, 1 ) , ':' , 1 ) ,
concat_with_space( cast( DeliveryToBaseQuantityNmrtr as abap.char(9) ) , BaseUnit , 1 ) , 1 ) as abap.char(20) ) as ConversionFactor,
@Semantics.quantity: { unitOfMeasure: 'BaseUnit' }
@DefaultAggregation: #NONE
cast(ActualDeliveredQtyInBaseUnit as le_lgmng) as ActualDeliveredQtyInBaseUnit,
@Semantics.unitOfMeasure: true
BaseUnit,
@DefaultAggregation: #NONE
UnlimitedOverdeliveryIsAllowed,
concat_with_space( cast( OverdelivTolrtdLmtRatioInPct as char10 ) , '%', 1) as OverdelivTolrtdLmtRatioInPct,
concat_with_space( cast( UnderdelivTolrtdLmtRatioInPct as char10 ) , '%', 1) as UnderdelivTolrtdLmtRatioInPct,
/***************************************************************************/
// Warehouse information
/***************************************************************************/
Plant,
_Plant.PlantName as PlantName,
StorageLocation,
_StorageLocation.StorageLocationName as StorageLocationName,
@Semantics.quantity: { unitOfMeasure: 'BaseUnit' }
@DefaultAggregation: #NONE
case
when _PickingSub.QuantityInBaseUnit >= 0 then
_PickingSum.QuantityInBaseUnit - _PickingSub.QuantityInBaseUnit
else _PickingSum.QuantityInBaseUnit
end as PickQuantityInBaseUoM,
@Semantics.quantity: { unitOfMeasure: 'DeliveryQuantityUnit' }
@DefaultAggregation: #NONE
case
when _PickingSub.PickQuantityInSalesUoMFlt >= 0 then _PickingSum.PickQuantityInSalesUoMFlt - _PickingSub.PickQuantityInSalesUoMFlt
else _PickingSum.PickQuantityInSalesUoMFlt
end as PickQuantityInSalesUoMFlt,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_WarehouseStdVH', element: 'Warehouse' } } ]
Warehouse,
StorageBin,
/***************************************************************************/
//Unloading / Shipping
/***************************************************************************/
LoadingGroup,
TransportationGroup,
@Semantics.quantity: { unitOfMeasure: 'ItemWeightUnit' }
@DefaultAggregation: #NONE
ItemGrossWeight,
@Semantics.quantity: { unitOfMeasure: 'ItemWeightUnit' }
@DefaultAggregation: #NONE
ItemNetWeight,
@Semantics.unitOfMeasure: true
ItemWeightUnit,
@Semantics.quantity: { unitOfMeasure: 'ItemVolumeUnit' }
@DefaultAggregation: #NONE
ItemVolume,
@Semantics.unitOfMeasure: true
ItemVolumeUnit,
PackingStatus,
ReceivingPoint,
DepartmentClassificationByCust,
LoadingPointForDelivery,
/***************************************************************************/
//Financial Information
/***************************************************************************/
/** @EndUserText.label: 'Billing Block Reason'
@UI.fieldGroup: {qualifier: 'FinancialProcessingBlockLeft', position: 10, importance: #HIGH, label:'Billing Block Reason'}
ItemBillingBlockReason,
@UI.fieldGroup: {qualifier: 'FinancialProcessingBlockCenter', position: 10, importance: #HIGH}
DeliveryRelatedBillingStatus,
@EndUserText.label: 'Intercompany Billing Status'
@UI.fieldGroup: {qualifier: 'FinancialProcessingBlockRight', position: 10, importance: #HIGH, label:'Intercompany Billing Status'}
IntercompanyBillingStatus,**/
/***************************************************************************/
//Good Movments
/***************************************************************************/
GoodsMovementStatus,
InventorySpecialStockType,
StockType,
GoodsMovementType,
/** @EndUserText.label: 'Follow-Up Movement'
@UI.fieldGroup: {qualifier: 'GoodsMovementBlockCenter', position: 30, importance: #HIGH, label: 'Follow-Up Movement'}
SubsequentMovementType,**/
WarehouseStockCategory,
@UI.fieldGroup: [{ qualifier: 'EMCSStatus', position: 20, importance: #HIGH }]
@ObjectModel.foreignKey.association: '_FieldLogisticsIndicator'
@UI.hidden: #(FldLogsIsHidden)
FldLogsStatus,
@UI.hidden: true
cast(
case when FldLogsStatus = '' then 'X'
else '' end
as boole_d ) as FldLogsIsHidden,
@ObjectModel.text.element : ['FldLogsRefDocTypeText']
_FldLogsDelivRefLinkInfo.FldLogsRefDocType,
_FldLogsDelivRefLinkInfo._DelivRefDocTypeTxt.FldLogsRefDocTypeText,
@Consumption.semanticObject:'PurchaseOrder'
_FldLogsDelivRefLinkInfo.FldLogsDelivRefDocNumberInfo,
_FldLogsDelivRefLinkInfo.FldLogsRefDocItem,
_FldLogsDelivRefLinkInfo.FldLogsCrossDockingInfo,
cast ( case _FldLogsDelivRefLinkInfo.FldLogsRefDocType
when 'STO' then 'PurchaseOrder' //Stock Transport Order
when 'MO' then 'MaintenanceOrder' //Maintenance Order
else ''
end as /ui2/semantic_object ) as FldLogsRefDocSemanticObjName,
@Consumption.semanticObject: 'SalesDocument'
I_InboundDeliveryItem.ReferenceSDDocument,
ltrim(I_InboundDeliveryItem.ReferenceSDDocumentItem, '0') as ReferenceSDDocumentItem,
I_InboundDeliveryItem.ReferenceSDDocumentCategory,
_Material,
_ItemCategory,
@Consumption.semanticObject: 'InboundDelivery'
_InboundDelivery,
_PutawayStatus,
@Consumption.filter.hidden: true
_PickingConfirmationStatus,
@Consumption.filter.hidden: true
_WarehouseActivityStatus,
_Warehouse,
_Plant,
_StorageLocation,
_InventorySpecialStockType,
_GoodsMovementType,
@Consumption.filter.hidden: true
_GoodsMovementStatus,
_LoadingGroup,
_TransportationGroup,
@Consumption.semanticObject: 'PurchaseOrder'
_PurchaseOrder,
_SerialNmbrEquipNmbrDelivery,
_StockType_2,
_StockCategory,
@Consumption.filter.hidden: true
_TrdCmplncEmbargoSts,
@Consumption.filter.hidden: true
_TrdCmplncSnctndListChkSts,
@Consumption.filter.hidden: true
_TrdCmplncLegalControlSts,
@Consumption.filter.hidden: true
_FieldLogisticsIndicator,
@Consumption.filter.hidden: true
_FldLogsDelivRefLinkInfo
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_DELIVERYPICKSUB",
"C_DELIVERYPICKSUM",
"I_DELIVERYDOCUMENTTYPE",
"I_FLDLOGSDELIVREFDOCTYPETXT",
"I_FLDLOGSDELIVREFLINKINFO",
"I_INBOUNDDELIVERY",
"I_INBOUNDDELIVERYITEM",
"I_MATERIAL",
"I_MATERIALTEXT",
"I_PLANT",
"I_STORAGELOCATION"
],
"ASSOCIATED":
[
"C_DELIVERYPICKSUB",
"C_DELIVERYPICKSUM",
"C_RELPURORDSTKTRANSPORDDLVR",
"C_SERIALNMBREQUIPNMBRDELIVERY",
"E_DELIVERYDOCUMENTITEM",
"I_FIELDLOGISTICSINDICATOR",
"I_FLDLOGSDELIVREFLINKINFO",
"I_GOODSMOVEMENTSTATUS",
"I_GOODSMOVEMENTTYPE",
"I_INBOUNDDELIVERY",
"I_INVENTORYSPECIALSTOCKTYPE",
"I_LOADINGGROUP",
"I_MATERIAL",
"I_PICKINGCONFIRMATIONSTATUS",
"I_PLANT",
"I_PUTAWAYSTATUS",
"I_SALESDOCUMENTITEMCATEGORY",
"I_STOCKCATEGORY",
"I_STOCKTYPE_2",
"I_STORAGELOCATION",
"I_TRANSPORTATIONGROUP",
"I_TRDCMPLNCCHECKSTATUS",
"I_WAREHOUSE",
"I_WAREHOUSEACTIVITYSTATUS"
],
"BASE":
[
"I_INBOUNDDELIVERYITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/