@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Purchase Order Item Internal View'
@VDM.viewType: #BASIC
@AbapCatalog.sqlViewName: 'RMMPURCHORDRITEM'
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.representativeKey: 'PurchaseOrderItem'
@ObjectModel.uniqueIdField: 'PurchaseOrderItemUniqueID'
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #A
@ObjectModel.usageType.sizeCategory: #L
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@AccessControl.privilegedAssociations: [ '_ManualDeliveryAddress', '_ReferenceDeliveryAddress', '_DeliveryAddress' ]
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
define view R_PurchaseOrderItem
as select from R_PurchasingDocumentItem
association [1..1] to R_PurchaseOrder as _PurchaseOrder on $projection.PurchaseOrder = _PurchaseOrder.PurchaseOrder
association [0..*] to R_PurOrderItemDeliveryAddress as _DeliveryAddress on $projection.ManualDeliveryAddressID = _DeliveryAddress.DeliveryAddressID
association [1..*] to I_PurOrdPricingElement as _PurchaseOrderPricingElement on $projection.PurchaseOrder = _PurchaseOrderPricingElement.PurchaseOrder
and $projection.PurchaseOrderItem = _PurchaseOrderPricingElement.PurchaseOrderItem
association [1..1] to I_PurchaseOrderItemCalcFields as _PurchaseOrderItemCalcFields on $projection.PurchaseOrder = _PurchaseOrderItemCalcFields.PurchaseOrder
and $projection.PurchaseOrderItem = _PurchaseOrderItemCalcFields.PurchaseOrderItem
association [0..1] to I_Material as _Material on $projection.Material = _Material.Material
association [0..*] to I_PurchaseOrderHistoryBasic as _PurchaseOrderHistory on $projection.PurchaseOrder = _PurchaseOrderHistory.PurchaseOrder
and $projection.PurchaseOrderItem = _PurchaseOrderHistory.PurchaseOrderItem
association [0..*] to I_PurOrdAccountAssignment as _PurOrdAccountAssignment on $projection.PurchaseOrder = _PurOrdAccountAssignment.PurchaseOrder
and $projection.PurchaseOrderItem = _PurOrdAccountAssignment.PurchaseOrderItem
{
//Key
@ObjectModel.foreignKey.association: '_PurchaseOrder'
key cast (PurchasingDocument as vdm_purchaseorder preserving type) as PurchaseOrder,
key cast (PurchasingDocumentItem as vdm_purchaseorderitem preserving type) as PurchaseOrderItem,
PurchasingDocumentItemUniqueID as PurchaseOrderItemUniqueID,
@ObjectModel.foreignKey.association: '_PurgDocumentCategory'
PurchasingDocumentCategory as PurchaseOrderCategory,
// Header fields ***************
@Semantics.currencyCode: true
DocumentCurrency,
PurchasingOrganization,
PurchasingGroup,
PurchasingDocumentType as PurchaseOrderType,
//************************************
PurchasingDocumentDeletionCode,
PurchasingDocumentItemOrigin,
//Product
@ObjectModel.foreignKey.association: '_MaterialGroup'
MaterialGroup,
@ObjectModel.foreignKey.association: '_Material'
Material,
MaterialType,
SupplierMaterialNumber,
SupplierSubrange,
ManufacturerPartNmbr,
Manufacturer,
@ObjectModel.foreignKey.association: '_ManufacturerMaterial'
ManufacturerMaterial,
PurchasingDocumentItemText as PurchaseOrderItemText,
@ObjectModel.foreignKey.association: '_ProductType'
ProductType,
@ObjectModel.foreignKey.association: '_CompanyCode'
CompanyCode,
@ObjectModel.foreignKey.association: '_Plant'
Plant,
@ObjectModel.foreignKey.association: '_ManualDeliveryAddress'
ManualDeliveryAddressID,
@ObjectModel.foreignKey.association: '_ReferenceDeliveryAddress'
ReferenceDeliveryAddressID,
@ObjectModel.foreignKey.association: '_Customer'
Customer,
@ObjectModel.foreignKey.association: '_Subcontractor'
Subcontractor,
SupplierIsSubcontractor,
@ObjectModel.foreignKey.association: '_ConfigurableProduct'
CrossPlantConfigurableProduct,
//@ObjectModel.foreignKey.association: '_ProductCategory'
ArticleCategory,
PlndOrderReplnmtElmntType,
@Semantics.unitOfMeasure: true
ProductPurchasePointsQtyUnit,
@Semantics.quantity.unitOfMeasure: 'ProductPurchasePointsQtyUnit'
@DefaultAggregation: #NONE
ProductPurchasePointsQty,
@ObjectModel.foreignKey.association: '_StorageLocation'
StorageLocation,
@Semantics.unitOfMeasure:true
@ObjectModel.foreignKey.association: '_OrderQuantityUnit'
OrderQuantityUnit as PurchaseOrderQuantityUnit,
OrderItemQtyToBaseQtyNmrtr,
OrderItemQtyToBaseQtyDnmntr,
@Semantics.quantity.unitOfMeasure: 'OrderPriceUnit'
@DefaultAggregation: #NONE
NetPriceQuantity,
IsCompletelyDelivered,
IsFinallyInvoiced,
GoodsReceiptIsExpected,
InvoiceIsExpected,
IsOrderAcknRqd,
InvoiceIsGoodsReceiptBased,
PriceChangeInSESIsAllowed,
@ObjectModel.foreignKey.association: '_PurchaseContractItem'
PurchaseContractItem,
@ObjectModel.foreignKey.association: '_PurchaseContract'
PurchaseContract,
@ObjectModel.foreignKey.association: '_PurchaseRequisition'
PurchaseRequisition,
RequirementTracking,
@ObjectModel.foreignKey.association: '_PurchaseRequisitionItem'
PurchaseRequisitionItem,
RequestForQuotation,
RequestForQuotationItem,
SupplierQuotation,
SupplierQuotationItem,
EvaldRcptSettlmtIsAllowed,
UnlimitedOverdeliveryIsAllowed,
OverdelivTolrtdLmtRatioInPct,
UnderdelivTolrtdLmtRatioInPct,
RequisitionerName,
PlannedDeliveryDurationInDays,
GoodsReceiptDurationInDays,
PartialDeliveryIsAllowed,
ConsumptionPosting,
@ObjectModel.foreignKey.association: '_ServicePerformer'
ServicePerformer,
ServicePackage,
@Semantics.unitOfMeasure: true
BaseUnit,
@ObjectModel.foreignKey.association: '_PurgDocumentItemCategory'
PurchasingDocumentItemCategory as PurchaseOrderItemCategory,
ProfitCenter,
@Semantics.unitOfMeasure: true
@ObjectModel.foreignKey.association: '_OrderPriceUnit'
OrderPriceUnit,
@Semantics.unitOfMeasure: true
VolumeUnit as ItemVolumeUnit,
@Semantics.unitOfMeasure: true
WeightUnit as ItemWeightUnit,
MultipleAcctAssgmtDistribution,
PartialInvoiceDistribution,
PricingDateControl,
IsStatisticalItem,
PurchasingParentItem,
GoodsReceiptLatestCreationDate,
IsReturnsItem,
IsGoodsCountCorrectionItem,
GdsCtCrrtnDelivDocBySuplr,
GdsCtCrrtnDelivDocItemBySuplr,
PurchasingOrderReason,
@ObjectModel.foreignKey.association: '_IncotermsClassification'
IncotermsClassification,
IncotermsTransferLocation,
IncotermsLocation1,
IncotermsLocation2,
IncotermsSupChnLoc1AddlUUID,
IncotermsSupChnLoc2AddlUUID,
IncotermsSupChnDvtgLocAddlUUID,
@ObjectModel.foreignKey.association: '_PriorSupplier'
PriorSupplier,
InvoicingPlan,
InternationalArticleNumber,
IntrastatServiceCode,
CommodityCode,
MaterialFreightGroup,
DiscountInKindEligibility,
PurgItemIsBlockedForDelivery,
//ConfirmationControl,
SupplierConfirmationControlKey,
PurgDocOrderAcknNumber,
PriceIsToBePrinted,
AccountAssignmentCategory,
@ObjectModel.foreignKey.association: '_PurchasingInfoRecord'
PurchasingInfoRecord,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
NetAmount,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
GrossAmount,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
EffectiveAmount,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
Subtotal1Amount,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
Subtotal2Amount,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
Subtotal3Amount,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
Subtotal4Amount,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
Subtotal5Amount,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
Subtotal6Amount,
// ekpo.ktmng as TargetQuantity,
@Semantics.quantity.unitOfMeasure: 'PurchaseOrderQuantityUnit'
@DefaultAggregation: #NONE
OrderQuantity,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
NetPriceAmount,
// ekpo.zwert as OutlineAgreementTargetAmount,
@Semantics.quantity.unitOfMeasure: 'ItemVolumeUnit'
@DefaultAggregation: #NONE
ItemVolume,
@Semantics.quantity.unitOfMeasure: 'ItemWeightUnit'
@DefaultAggregation: #NONE
ItemGrossWeight,
@Semantics.quantity.unitOfMeasure: 'ItemWeightUnit'
@DefaultAggregation: #NONE
ItemNetWeight,
OrderPriceUnitToOrderUnitNmrtr,
OrdPriceUnitToOrderUnitDnmntr,
GoodsReceiptIsNonValuated,
IsToBeAcceptedAtOrigin,
TaxCode,
TaxJurisdiction,
TaxCodeValidFromDate,
TaxCountry,
TaxDeterminationDate,
ShippingInstruction,
ShippingType,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
NonDeductibleInputTaxAmount,
StockType,
ValuationType,
ValuationCategory,
ItemIsRejectedBySupplier,
PurgDocPriceDate,
PurchasingInfoRecordUpdateCode,
PurgDocReleaseOrderQuantity,
InventorySpecialStockType,
DeliveryDocumentType,
IssuingStorageLocation,
AllocationTable,
AllocationTableItem,
RetailPromotion,
// Additional Fields for hierarchy implementation
PurgConfigurableItemNumber,
PurgDocAggrgdSubitemCategory,
PurgDocSubitemCategory,
PurgExternalSortNumber,
// PurgExternalHierarchyCategory,
// Down Payment
DownPaymentType,
DownPaymentPercentageOfTotAmt,
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
DownPaymentAmount,
DownPaymentDueDate,
// S/4 Limit
ExpectedOverallLimitAmount,
OverallLimitAmount,
PurContractForOverallLimit,
// fields from product compliance
PurgProdCmplncSupplierStatus,
PurgProductMarketabilityStatus,
PurgSafetyDataSheetStatus,
PurgProdCmplncDngrsGoodsStatus,
RequirementSegment,
SubcontrgCompIsRealTmeCnsmd,
// CRM third party order process
ThirdPtyOrdProcgExtReference,
ThirdPtyOrdProcgExtRefItem,
// Public Sector account assignment fields
Fund,
BudgetPeriod,
FundsCenter,
@VDM.lifecycle.status: #DEPRECATED
@VDM.lifecycle.successor: 'CommitmentItemShortID'
CommitmentItem,
cast( CommitmentItemShortID as fmis_ci_internalname preserving type ) as CommitmentItemShortID,
FunctionalArea,
GrantID,
EarmarkedFundsDocument,
EarmarkedFundsDocumentItem,
EarmarkedFundsDocument as EarmarkedFunds,
EarmarkedFundsDocumentItem as EarmarkedFundsItem,
CostCenter,
GLAccount,
WBSElementInternalID,
PartnerReportedBusinessArea,
// Brazil Extension
@ObjectModel.foreignKey.association: '_BR_MaterialOrigin'
BR_MaterialOrigin,
@ObjectModel.foreignKey.association: '_BR_MaterialUsage'
BR_MaterialUsage,
@ObjectModel.foreignKey.association: '_BR_CFOPCategory'
BR_CFOPCategory,
@ObjectModel.foreignKey.association: '_BR_NCM'
BR_NCM,
ConsumptionTaxCtrlCode,
IN_GSTControlCode,
BR_IsProducedInHouse,
// Additional Fields from Fashion Management
//X_RFM_I_PurchaseOrderItem
// Seasons
ProductSeasonYear,
ProductSeason,
ProductCollection,
ProductTheme,
SeasonCompletenessStatus,
// CommittedQuantity,
// PSST
ShippingGroupRule,
ShippingGroupNumber,
// Characteristics
ProductCharacteristic1,
ProductCharacteristic2,
ProductCharacteristic3,
// Sub Items
SubItemCategory,
// PODiversion
DiversionStatus,
ReferenceDocumentNumber,
RefDocNmbrForTrcblyInPO,
ReferenceDocumentItem,
PurchaseOrderReferenceType,
ReferenceDocumentScheduleLine,
ItemHasValueAddedService,
ValAddedSrvcParentItmNumber,
//Foot Print Intigration
PFMTransDataFootprintUUID,
// X_RFM_I_PurchaseOrderItemSeg
// Segmentation
StockSegment,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_PurchaseOrderPricingElement,
_PurchaseOrder,
_DeliveryAddress,
_PurchaseOrderHistory,
_PurOrdAccountAssignment,
_DocumentCurrency,
_PurchaseOrderItemCalcFields,
_CompanyCode,
_Plant,
_StorageLocation,
_Material,
_ManufacturerMaterial,
_MaterialGroup,
_OrderPriceUnit,
@VDM.lifecycle.status: #DEPRECATED
@VDM.lifecycle.successor: '_ManualDeliveryAddress_2'
_ManualDeliveryAddress,
_ManualDeliveryAddress_2,
@VDM.lifecycle.status: #DEPRECATED
@VDM.lifecycle.successor: '_ReferenceDeliveryAddress_2'
_ReferenceDeliveryAddress,
_ReferenceDeliveryAddress_2,
_PurgDocumentCategory,
_PurgDocumentItemCategory,
_IncotermsClassification,
_PriorSupplier,
_ConsumptionPosting,
//I_PurchasingDocumentItem._ScheduleLine,
_PurchaseRequisitionItem,
_PurchasingInfoRecord,
//I_PurchasingDocumentItem._Manufacturer,
_Customer,
_Subcontractor,
_ConfigurableProduct,
_PurchaseRequisition,
_PurchaseContract,
_PurchaseContractItem,
_ServicePerformer,
_OrderQuantityUnit,
_ProductType,
_AllocationTable,
_AllocationTableItem,
_RetailPromotion,
//Associations for Brazilian specific fields
_BR_MaterialOrigin,
_BR_MaterialUsage,
_BR_CFOPCategory,
_BR_NCM
}
where
PurchasingDocumentCategory = 'F'
and IsEndOfPurposeBlocked = ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"R_PURCHASINGDOCUMENTITEM"
],
"ASSOCIATED":
[
"I_ADDRESS",
"I_ADDRESS_2",
"I_ALLOCATIONTABLE",
"I_ALLOCATIONTABLEITEM",
"I_BR_CFOPCATEGORY",
"I_BR_MATERIALORIGIN",
"I_BR_MATERIALUSAGE",
"I_BR_NCM",
"I_BUSINESSPARTNER",
"I_COMPANYCODE",
"I_CONSUMPTIONPOSTING",
"I_CURRENCY",
"I_CUSTOMER",
"I_INCOTERMSCLASSIFICATION",
"I_MATERIAL",
"I_MATERIALGROUP",
"I_ORGANIZATIONADDRESS",
"I_PLANT",
"I_PRODUCTTYPECODE",
"I_PURCHASECONTRACT",
"I_PURCHASECONTRACTITEM",
"I_PURCHASEORDERHISTORYBASIC",
"I_PURCHASEORDERITEMCALCFIELDS",
"I_PURCHASEREQUISITION",
"I_PURCHASEREQUISITIONITEM",
"I_PURCHASINGDOCUMENTCATEGORY",
"I_PURCHASINGINFORECORDAPI01",
"I_PURGDOCUMENTITEMCATEGORY",
"I_PURORDACCOUNTASSIGNMENT",
"I_PURORDPRICINGELEMENT",
"I_RETAILPROMOTION",
"I_STORAGELOCATION",
"I_SUPPLIER",
"I_UNITOFMEASURE",
"R_PURCHASEORDER",
"R_PURORDERITEMDELIVERYADDRESS"
],
"BASE":
[
"R_PURCHASINGDOCUMENTITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/