@VDM.lifecycle.contract.type: #PUBLIC_REMOTE_API
@AbapCatalog.dataMaintenance: #DISPLAY_ONLY
@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'APURORDERITEM'
@VDM.viewType: #COMPOSITE
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@EndUserText.label: 'Item'
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations:true
@OData.entitySet.name : 'A_PurchaseOrderItem'
//@ObjectModel.representativeKey: 'PurchaseOrderItem'
//@ObjectModel: {
// createEnabled: true,
// updateEnabled: true,
// deleteEnabled: true
//}
define view A_PurchaseOrderItem
as select from R_PurchaseOrderItem
association to parent A_PurchaseOrder as _PurchaseOrder on $projection.PurchaseOrder = _PurchaseOrder.PurchaseOrder
//composition [1..*] of A_PurchaseOrderInvoicingPlan as _PurchaseOrderInvoicingPlan
composition [1..*] of A_PurOrdPricingElement as _PurchaseOrderPricingElement
composition [1..*] of A_PurchaseOrderScheduleLine as _ScheduleLine
composition [0..*] of A_PurOrdAccountAssignment as _AccountAssignment
composition [0..*] of A_PurchaseOrderItemNote as _PurchaseOrderItemNote
association [1..1] to I_PurOrdItemDeliveryAddress as _DeliveryAddress on $projection.PurchaseOrder = _DeliveryAddress.PurchaseOrder
and $projection.PurchaseOrderItem = _DeliveryAddress.PurchaseOrderItem
----Extension Association
association [1..1] to E_PurchasingDocumentItem as _PurchaseOrderItemExtension on $projection.PurchaseOrder = _PurchaseOrderItemExtension.PurchasingDocument
and $projection.PurchaseOrderItem = _PurchaseOrderItemExtension.PurchasingDocumentItem
// RFM enhancement : value-added services
association [0..*] to A_ValAddedSrvcMM as _ValueAddedService on $projection.PurchaseOrder = _ValueAddedService.ValAddedSrvcMMRefDocNmbr
and $projection.PurchaseOrderItem = _ValueAddedService.ValAddedSrvcMMRefDocItem
association [0..*] to A_ValAddedSrvcMM_2 as _ValueAddedService_2 on $projection.PurchaseOrder = _ValueAddedService_2.PurchaseOrder
and $projection.PurchaseOrderItem = _ValueAddedService_2.PurchaseOrderItem
// Additional Fields: Batch and Free of Charge
association [1..1] to P_PurchaseOrderItemAddFields as _PurchaseOrderItemAddFields on $projection.PurchaseOrder = _PurchaseOrderItemAddFields.PurchaseOrder
and $projection.PurchaseOrderItem = _PurchaseOrderItemAddFields.PurchaseOrderItem
{
// @ObjectModel.foreignKey.association: '_PurchaseOrder'
key PurchaseOrder,
// @ObjectModel: { readOnly: true }
key PurchaseOrderItem,
// @ObjectModel: { readOnly: true }
PurchasingDocumentDeletionCode,
PurchaseOrderItemText,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
Plant,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
@ObjectModel.sapObjectNodeTypeReference: 'StorageLocation'
StorageLocation,
// Once added uncomment: BEDNR
// RequirementTracking
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
MaterialGroup,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
PurchasingInfoRecord,
SupplierMaterialNumber,
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderQuantityUnit'
// @DefaultAggregation: #NONE
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
OrderQuantity,
@Semantics.unitOfMeasure:true
PurchaseOrderQuantityUnit,
@Semantics.unitOfMeasure: true
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
OrderPriceUnit,
OrderPriceUnitToOrderUnitNmrtr,
OrdPriceUnitToOrderUnitDnmntr,
// @ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'Currency'
@Semantics.currencyCode: true
DocumentCurrency,
@Semantics.amount.currencyCode: 'DocumentCurrency'
NetPriceAmount,
@Semantics.quantity.unitOfMeasure: 'OrderPriceUnit'
// @DefaultAggregation: #NONE
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
NetPriceQuantity,
TaxCode,
ShippingInstruction,
TaxDeterminationDate,
TaxCountry,
PriceIsToBePrinted,
// Once added uncomment: MAHN1 ,MAHN2 ,MAHN3
// NoDaysReminder1,
// NoDaysReminder2,
// NoDaysReminder3,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
OverdelivTolrtdLmtRatioInPct,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
UnlimitedOverdeliveryIsAllowed,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
UnderdelivTolrtdLmtRatioInPct,
ValuationType,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
IsCompletelyDelivered,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
IsFinallyInvoiced,
PurchaseOrderItemCategory,
@ObjectModel.sapObjectNodeTypeReference: 'AccountAssignmentCategory'
AccountAssignmentCategory,
MultipleAcctAssgmtDistribution,
PartialInvoiceDistribution,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
GoodsReceiptIsExpected,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
GoodsReceiptIsNonValuated,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
InvoiceIsExpected,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
InvoiceIsGoodsReceiptBased,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
PurchaseContract,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
PurchaseContractItem,
Customer,
Subcontractor,
SupplierIsSubcontractor,
@Semantics.quantity.unitOfMeasure: 'ItemWeightUnit'
// @DefaultAggregation: #NONE
ItemNetWeight,
@Semantics.unitOfMeasure: true
ItemWeightUnit,
@ObjectModel.sapObjectNodeTypeReference: 'TaxJurisdiction'
TaxJurisdiction,
PricingDateControl,
@Semantics.quantity.unitOfMeasure: 'ItemVolumeUnit'
// @DefaultAggregation: #NONE
ItemVolume,
@Semantics.unitOfMeasure: true
ItemVolumeUnit,
SupplierConfirmationControlKey as SupplierConfirmationControlKey,
@ObjectModel.sapObjectNodeTypeReference: 'IncotermsClassification'
IncotermsClassification,
IncotermsTransferLocation,
// Once added : Uncomment
// SupplierSubrange
EvaldRcptSettlmtIsAllowed,
PurchaseRequisition,
PurchaseRequisitionItem,
IsReturnsItem,
RequisitionerName,
ServicePackage,
//deprecated
EarmarkedFunds,
EarmarkedFundsDocument,
//deprecated
EarmarkedFundsItem,
EarmarkedFundsDocumentItem,
IncotermsLocation1,
IncotermsLocation2,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
Material,
InternationalArticleNumber, //aka EAN/UPC
ManufacturerMaterial,
ServicePerformer,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
@ObjectModel.sapObjectNodeTypeReference: 'ProductType'
ProductType,
//Start -- Limit PO API - 1802
@Semantics.amount.currencyCode: 'DocumentCurrency'
ExpectedOverallLimitAmount,
@Semantics.amount.currencyCode: 'DocumentCurrency'
OverallLimitAmount,
PurContractForOverallLimit,
//End -- Limit PO API - 1802
//Data Privacy and Protection
// IsEndOfPurposeBlocked,
// Additional Fields for item hierarchy implementation
//PurchasingParentItem and SubItemCategory were part of RFM extension view, Now brought to standard.
PurchasingParentItem,
//Decided to move SubItemCategory back to RFM extension view-
//SubItemCategory,
PurgConfigurableItemNumber,
PurgDocAggrgdSubitemCategory,
PurgDocSubitemCategory,
PurgExternalSortNumber,
// Additional Fields add with CFD
_PurchaseOrderItemAddFields.Batch,
_PurchaseOrderItemAddFields.PurchasingItemIsFreeOfCharge,
//Address Data
ReferenceDeliveryAddressID, //it corresponds to ADRN2
ManualDeliveryAddressID as DeliveryAddressID, //it corresponds to ADRNR
//deprecated
_DeliveryAddress._Address_2.OrganizationName1 as DeliveryAddressName,
// _DeliveryAddress.BusinessPartnerName1 as DeliveryAddressName1,
_DeliveryAddress._Address_2.OrganizationName2 as DeliveryAddressName2,
_DeliveryAddress._Address_2.AddresseeFullName as DeliveryAddressFullName,
_DeliveryAddress._Address_2.StreetName as DeliveryAddressStreetName,
_DeliveryAddress._Address_2.HouseNumber as DeliveryAddressHouseNumber,
_DeliveryAddress._Address_2.CityName as DeliveryAddressCityName,
_DeliveryAddress._Address_2.PostalCode as DeliveryAddressPostalCode,
_DeliveryAddress._Address_2.Region as DeliveryAddressRegion,
_DeliveryAddress._Address_2.Country as DeliveryAddressCountry,
_DeliveryAddress._Address_2.DistrictName as DeliveryAddressDistrictName,
//Fields not in the underlying CDS but present in the GFC
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
//PerformancePeriodStartDate
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
//PerformancePeriodEndDate
//ShippingTypeTransportMode
//DeliveryDateQuantityIsFixed
//LogicalSystem
//AllocationTable
//AllocationTableItem
//IssuingOrReceivingStorageLoc
//FunctionalArea
//ShelfLifeExpirationDatePeriod
//ProductConfiguration
//Batch
//PurchasingOrderReason -- retail
//MinRemainingShelfLife
//MaterialSeasonYear
//RetailPromotion
//MaterialConditionGroup
//IsCashDiscountGranted
// Fields pending for approval in GFC (once approved and added in the underlying view, this can be uncommented
// RetainedInvoiceValueInPercent
// Down Payment
DownPaymentType,
DownPaymentPercentageOfTotAmt,
@Semantics.amount.currencyCode: 'DocumentCurrency'
// @DefaultAggregation: #NONE
DownPaymentAmount,
DownPaymentDueDate,
//DownPaymentIndicator,
//DownPaymentPercentage,
//ExternalDocument
//ExternalDocumentItem
//IsGoodsIssRelatedGoodsRecActv
//RejectionReasonQuotAndSalesOrd
//RequirementUrgency
//OverallMaterialReqnsPriority
//IsAcceptanceAtOrigin
//IsOutwardDeliveryComplete
//IsPartialDeliveryAtItem
//IsItemForSubsequentSettlement
//RfqNumber
//RfqItemNumber
//ReferenceDocument
//ReferenceDocumentItem
//PurchasingSubItemCategory
//PurchasingDocumentParentItem - added altogether with hierarchy fields
//GoodsHandoverLocation
//Proposed but doubtful. Can be uncommented after clarification and addition in underlying view
//IsFreeItem
//PurgRebateSettlementGrp2
//PurgRebateSettlementGrp3
//FundLong
//ItemNumberLength
//External Sorting
//ExternalHierarchyCategory
//BlockingReasonText
//BlockingReasonID
//GoodsReceiptLatestPossibleDate
//Expose the associations
// @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
//_PurchaseOrderInvoicingPlan,
// @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_PurchaseOrderPricingElement,
// @ObjectModel.association.type: [#TO_COMPOSITION_ROOT, #TO_COMPOSITION_PARENT]
_PurchaseOrder,
// @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_ScheduleLine,
// @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_AccountAssignment,
// @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_PurchaseOrderItemNote,
//_DeliveryAddress
// Brazilian fields
BR_MaterialUsage,
BR_MaterialOrigin,
BR_CFOPCategory,
BR_IsProducedInHouse,
BR_NCM as ConsumptionTaxCtrlCode,
// fields from product compliance
PurgProdCmplncSupplierStatus,
PurgProductMarketabilityStatus,
PurgSafetyDataSheetStatus,
PurgProdCmplncDngrsGoodsStatus,
// RFM enhancement : value-added services
// @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_ValueAddedService,
_ValueAddedService_2
}
where
PurchasingDocumentDeletionCode = ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ADDRESS_2",
"I_PURORDITEMDELIVERYADDRESS",
"P_PURCHASEORDERITEMADDFIELDS",
"R_PURCHASEORDERITEM"
],
"ASSOCIATED":
[
"A_PURCHASEORDER",
"A_PURCHASEORDERITEMNOTE",
"A_PURCHASEORDERSCHEDULELINE",
"A_PURORDACCOUNTASSIGNMENT",
"A_PURORDPRICINGELEMENT",
"A_VALADDEDSRVCMM",
"A_VALADDEDSRVCMM_2",
"E_PURCHASINGDOCUMENTITEM",
"I_PURORDITEMDELIVERYADDRESS",
"P_PURCHASEORDERITEMADDFIELDS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/