@VDM.lifecycle.contract.type: #PUBLIC_REMOTE_API
@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'APURCHASEORDER'
@VDM.viewType : #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@EndUserText.label: 'Purchase Order'
@ObjectModel: {
usageType.serviceQuality: #C,
usageType.sizeCategory: #L,
usageType.dataClass: #TRANSACTIONAL,
sapObjectNodeType.name: 'PurchaseOrder'
}
@Metadata.ignorePropagatedAnnotations:true
@OData.entitySet.name : 'A_PurchaseOrder'
//@VDM.usage.type:[#TRANSACTIONAL_PROCESSING_SERVICE]
//@ObjectModel.entityChangeStateId: 'LastChangeDateTime'
define root view A_PurchaseOrder
as select from R_PurchaseOrder as Root
composition [1..*] of A_PurchaseOrderItem as _PurchaseOrderItem
composition [0..*] of A_PurchaseOrderNote as _PurchaseOrderNote
association [1..1] to I_PurchaseOrderSupplierAddress as _SupplierAddress on $projection.PurchaseOrder = _SupplierAddress.PurchaseOrder
--Extension Association
association [1..1] to E_PurchasingDocument as _PurchaseOrderExtension on $projection.PurchaseOrder = _PurchaseOrderExtension.PurchasingDocument
{
// @ObjectModel: { readOnly: true }
key PurchaseOrder,
// @ObjectModel: { readOnly: true }
CompanyCode,
// @ObjectModel: { readOnly: true }
PurchaseOrderType,
// @ObjectModel: { readOnly: true }
PurchaseOrderDeletionCode as
PurchasingDocumentDeletionCode,
// @ObjectModel: { readOnly: true } -- not createable, but updateable
PurchasingProcessingStatus,
// @ObjectModel: { readOnly: true }
CreatedByUser,
// @ObjectModel: { readOnly: true }
CreationDate,
// @ObjectModel.readOnly: true
//@Semantics.systemDateTime.lastChangedAt: true
LastChangeDateTime,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
Supplier,
// @ObjectModel.readOnly: true
PurchaseOrderSubtype,
// @ObjectModel: { readOnly: true }
Language,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
@ObjectModel.sapObjectNodeTypeReference: 'PaymentTerms'
PaymentTerms,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
CashDiscount1Days,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
CashDiscount2Days,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
NetPaymentDays,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
CashDiscount1Percent,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
CashDiscount2Percent,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
PurchasingOrganization,
// @ObjectModel.readOnly: true
PurchasingDocumentOrigin,
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
@ObjectModel.sapObjectNodeTypeReference: 'PurchasingGroup'
PurchasingGroup,
// @ObjectModel: { readOnly: true }
PurchaseOrderDate,
@Semantics.currencyCode
@ObjectModel.sapObjectNodeTypeReference: 'Currency'
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION' }
DocumentCurrency,
cast(ExchangeRate as abap.char(12)) as ExchangeRate,
ExchangeRateIsFixed,
ValidityStartDate,
ValidityEndDate,
SupplierQuotationExternalID,
// Once added Uncomment this
// QuotationSubmissionDate,
PurchasingCollectiveNumber,
SupplierRespSalesPersonName,
SupplierPhoneNumber,
SupplyingSupplier,
// Once added Uncomment this
// PurchaseContract,
SupplyingPlant,
@ObjectModel.sapObjectNodeTypeReference: 'IncotermsClassification'
// @ObjectModel: { readOnly: 'EXTERNAL_CALCULATION'}
IncotermsClassification,
//References
CorrespncExternalReference, //Your reference
CorrespncInternalReference, //Our reference
InvoicingParty,
// Once added Uncomment this
// ReleaseCode,
ReleaseIsNotCompleted,
PurchasingCompletenessStatus,
@ObjectModel.sapObjectNodeTypeReference: 'IncotermsVersion'
IncotermsVersion,
IncotermsLocation1,
IncotermsLocation2,
//Address Data
ManualSupplierAddressID,
//Data Privacy and Protection
// @ObjectModel.readOnly: true
IsEndOfPurposeBlocked,
_SupplierAddress._Address_2.CityName as AddressCityName,
_SupplierAddress._Address_2._CurrentDfltFaxNumber.InternationalFaxNumber as AddressFaxNumber,
_SupplierAddress._Address_2.HouseNumber as AddressHouseNumber,
_SupplierAddress._Address_2.OrganizationName1 as AddressName,
_SupplierAddress._Address_2.PostalCode as AddressPostalCode,
_SupplierAddress._Address_2.StreetName as AddressStreetName,
_SupplierAddress._Address_2._CurrentDfltLandlinePhoneNmbr.InternationalPhoneNumber as AddressPhoneNumber,
_SupplierAddress._Address_2.Region as AddressRegion,
_SupplierAddress._Address_2.Country as AddressCountry,
_SupplierAddress._Address_2.CorrespondenceLanguage as AddressCorrespondenceLanguage,
// Fields pending for approval in GFC (once approved and added in the underlying view, this can be uncommented
//ReasonForCancellation,
//GoodsReceiptReasonCode,
//RetentionIndicator,
//RetentionPercentage,
//DownPaymentIndicator,
//DownPaymentPercentage,
//DownPaymentDueDate,
//ItemNumberInterval,
//@ObjectModel: { readOnly: true }
//ItemNumberIntervalForSubitems,
//IncompletenessCategory,
//GoodsHandoverLocation,
//
// fields from product compliance
PurgAggrgdProdCmplncSuplrSts,
PurgAggrgdProdMarketabilitySts,
PurgAggrgdSftyDataSheetStatus,
PurgProdCmplncTotDngrsGoodsSts,
// @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_PurchaseOrderItem,
// @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_PurchaseOrderNote
}
where
PurchaseOrderDeletionCode = ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ADDRCURDEFAULTFAXNUMBER",
"I_ADDRCURDFLTLANDLINEPHONENMBR",
"I_ADDRESS_2",
"I_PURCHASEORDERSUPPLIERADDRESS",
"R_PURCHASEORDER"
],
"ASSOCIATED":
[
"A_PURCHASEORDERITEM",
"A_PURCHASEORDERNOTE",
"E_PURCHASINGDOCUMENT",
"I_PURCHASEORDERSUPPLIERADDRESS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/