@AbapCatalog.preserveKey: true
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {
dataClass: #MIXED,
serviceQuality: #C,
sizeCategory: #L
}
@AbapCatalog.sqlViewName: 'PPUORDDELAD'
@AbapCatalog.compiler.compareFilter: true
@AccessControl: { authorizationCheck: #NOT_REQUIRED, personalData.blocking: #BLOCKED_DATA_EXCLUDED, privilegedAssociations: [ '_DeliveryAddress' ] }
define view P_PurOrdItemDeliveryAddress
as select from I_PurchaseOrderItem
association [1..1] to I_PurchaseOrder as _PurchaseOrder on $projection.PurchaseOrder = _PurchaseOrder.PurchaseOrder
association [0..1] to P_StorLocDefaultAddress as _StorLocDefAddr on $projection.Plant = _StorLocDefAddr.Plant
and $projection.StorageLocation = _StorLocDefAddr.StorageLocation
association [0..*] to I_Address_2 as _DeliveryAddress on $projection.ItemDeliveryAddressID = _DeliveryAddress.AddressID
{
key I_PurchaseOrderItem.PurchaseOrder,
key I_PurchaseOrderItem.PurchaseOrderItem,
StorageLocation,
case
when ManualDeliveryAddressID = '' or ManualDeliveryAddressID is null then
case
when ReferenceDeliveryAddressID = '' or ReferenceDeliveryAddressID is null then
case
when Subcontractor = '' or Subcontractor is null then
case
when Customer = '' or Customer is null then
case
when _StorLocDefAddr.AddressID = '' or _StorLocDefAddr.AddressID is null then _Plant.AddressID
else _StorLocDefAddr.AddressID
end
else _Customer.AddressID
end
else _Subcontractor.AddressID
end
else ReferenceDeliveryAddressID
end
else ManualDeliveryAddressID
end as ItemDeliveryAddressID,
_DeliveryAddress,
_PurchaseOrder,
I_PurchaseOrderItem.Plant as Plant
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CUSTOMER",
"I_PLANT",
"I_PURCHASEORDERITEM",
"I_SUPPLIER",
"P_STORLOCDEFAULTADDRESS"
],
"ASSOCIATED":
[
"I_ADDRESS_2",
"I_PURCHASEORDER",
"P_STORLOCDEFAULTADDRESS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/