@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@AbapCatalog.sqlViewName: 'CPURORDERFS'
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType: #CONSUMPTION
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Purchase Order'
@UI.headerInfo:{
typeName: 'Purchase Order',
typeNamePlural: 'Purchase Order',
title.value: 'PurchaseOrder',
description.value: 'PurchaseOrderType_Text'
}
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #M
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@AccessControl.privilegedAssociations: [ '_User', '_SupplierAddress' ]
@Search.searchable: true
define view C_PurchaseOrderFs
as select from I_PurchaseOrderEnhanced as I_PurchaseOrderEnhanced
association [0..*] to C_SuplInvPurOrdRef as _SuplInvPurOrdRef on $projection.PurchaseOrder = _SuplInvPurOrdRef.PurchaseOrder
association [0..*] to C_PurOrdItemEnh as _PurchaseOrderItem on $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder
// S/4 LIMIT
association [0..*] to C_PurchaseOrderLimitItem as _PurchaseOrderLimitItem on $projection.PurchaseOrder = _PurchaseOrderLimitItem.PurchaseOrder
association [0..*] to C_PurOrdSuplrConfDisplay as _PurOrdSuplrConfDisplay on $projection.PurchaseOrder = _PurOrdSuplrConfDisplay.PurchaseOrder
association [0..*] to C_PurReqItemByPurOrder as _PurReqItemByPurOrder on $projection.PurchaseOrder = _PurReqItemByPurOrder.PurchaseOrder
association [0..*] to C_PurOrdRefPurConItm as _PurOrdRefPurConItm on $projection.PurchaseOrder = _PurOrdRefPurConItm.PurchaseOrder
association [0..*] to C_PurchaseOrderGoodsReceipt as _PurchaseOrderGoodsReceipt on $projection.PurchaseOrder = _PurchaseOrderGoodsReceipt.PurchaseOrder
association [0..*] to I_IncotermsClassificationText as _IncotermsClassificationText on $projection.IncotermsClassification = _IncotermsClassificationText.IncotermsClassification
association [0..1] to I_PurchasingDocumentStatusText as _PurchasingDocumentStatusText on $projection.PurchasingDocumentStatus = _PurchasingDocumentStatusText.PurchasingDocumentStatus
and _PurchasingDocumentStatusText.Language = $session.system_language
association [0..*] to I_PaymentTermsText as _PaymentTermsText on $projection.PaymentTerms = _PaymentTermsText.PaymentTerms
association [0..1] to I_User as _User on _User.UserID = $projection.CreatedByUser
association [0..1] to I_PurchasingDocumentType as _PurchaseOrderType on $projection.PurchaseOrderType = _PurchaseOrderType.PurchasingDocumentType
and _PurchaseOrderType.PurchasingDocumentCategory = 'F'
association [1..1] to I_SupplierOrAddressContactCard as _SupplierHeadOffice on (
_SupplierHeadOffice.ContactCardType = 'Supplier'
and _SupplierHeadOffice.ContactCardID = $projection.Supplier
and _SupplierHeadOffice.ContactCardRole = 'Supplier'
)
association [0..1] to E_PurchasingDocument as _HeaderExtension on $projection.PurchaseOrder = _HeaderExtension.PurchasingDocument
association [0..*] to C_PurOrderItemHierFactSheet as _PurchaseOrderItemHierarchy on $projection.PurchaseOrder = _PurchaseOrderItemHierarchy.PurchaseOrder
association [1..1] to E_PurchasingDocument as _PurchaseOrderExtension on $projection.PurchaseOrder = _PurchaseOrderExtension.PurchasingDocument
association [0..*] to C_PurOrderPartnerFactSheet as _PurchaseOrderPartner on $projection.PurchaseOrder = _PurchaseOrderPartner.PurchaseOrder
association [1..1] to C_POSupplierAddressFactSheet as _POSupplierAddressFactSheet on $projection.PurchaseOrder = _POSupplierAddressFactSheet.PurchaseOrder
{
@UI.facet: [
{ label:'General Information',
id:'GeneralInformation',
isSummary: true,
type: #COLLECTION,
position: 10
},
{
label: 'Basic Data',
id: 'BasicData',
parentId: 'GeneralInformation',
type: #IDENTIFICATION_REFERENCE,
position: 10
},
{ label:'Supplier Contact Data',
id:'idSupplierContactData',
isSummary: true,
type: #COLLECTION,
position: 190
},
{
label: 'Basic Data',
id: 'BasicData2',
parentId: 'idSupplierContactData',
type: #IDENTIFICATION_REFERENCE,
position: 190
}
]
//Key
@UI.hidden: false
@ObjectModel.text.association: '_PurchaseOrderTypeText'
@Consumption.semanticObject: 'PurchaseOrder'
@UI.lineItem: [{
position: 05,
importance: #HIGH }]
@UI.identification: [{
position: 05,
importance: #HIGH }]
@Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
key I_PurchaseOrderEnhanced.PurchaseOrder,
@Consumption.semanticObject: 'PurchaseOrder'
@UI.identification: [{
position: 05,
importance: #HIGH }]
@EndUserText.label: 'Purchase Order'
PurchaseOrder as PurchasingDocument,
//Category
@ObjectModel.foreignKey.association: '_PurchaseOrderType'
@ObjectModel.text.association: '_PurchaseOrderTypeText'
PurchaseOrderType,
PurchaseOrderSubtype,
PurchasingDocumentOrigin,
_PurchaseOrderType.PurchasingDocumentCategory,
_PurchaseOrderType.PurchasingDocumentType,
@UI.hidden: true
_PurchaseOrderType._Text[1: Language = $session.system_language].PurchasingDocumentTypeName as PurchaseOrderTypeName,
//Admin
@UI.identification: [{
position: 15,
importance: #HIGH }]
@ObjectModel: { text.element: [ 'UserFullName' ], readOnly: true }
CreatedByUser,
@Semantics.businessDate.createdAt
@UI.identification: [{
position: 20,
importance: #HIGH }]
@Semantics.businessDate.at: true
CreationDate,
PurchaseOrderDate,
Language,
//Status
PurchasingDocumentDeletionCode,
ReleaseIsNotCompleted,
PurchasingCompletenessStatus,
//Organization
//--[ GENERATED:012:GFBfhyK17kY4ofIXD8GUQG
@Consumption.valueHelpDefinition: [
{ entity: { name: 'C_MM_CompanyCodeValueHelp',
element: 'CompanyCode' }
}]
// ]--GENERATED
@ObjectModel.foreignKey.association: '_CompanyCode'
@ObjectModel.text.element: [ 'CompanyCodeName' ]
@UI.fieldGroup: [{
qualifier: 'Recipient',
groupLabel: 'Recipient',
position: 10,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail3',
groupLabel: 'Recipient',
position: 10,
exclude: false,
importance: #HIGH
}]
CompanyCode,
//@Semantics.text: true
_CompanyCode.CompanyCodeName,
@ObjectModel.foreignKey.association: '_PurchasingOrganization'
@ObjectModel.text.element: [ 'PurchasingOrganizationName' ]
@UI.fieldGroup: [{
qualifier: 'Recipient',
groupLabel: 'Recipient',
position: 30,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail3',
groupLabel: 'Recipient',
position: 30,
exclude: false,
importance: #HIGH
}]
PurchasingOrganization,
//@Semantics.text: true
_PurchasingOrganization.PurchasingOrganizationName,
@ObjectModel.foreignKey.association: '_PurchasingGroup'
@UI.fieldGroup: [{
qualifier: 'Recipient',
groupLabel: 'Recipient',
position: 20,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail3',
groupLabel: 'Recipient',
position: 20,
exclude: false,
importance: #HIGH
}]
@ObjectModel.text.element: [ 'PurchasingGroupName' ]
PurchasingGroup,
//@Semantics.text: true
_PurchasingGroup.PurchasingGroupName,
//Supplier
//--[ GENERATED:012:GFBfhyK17kY4ofIXD8GUQG
@Consumption.valueHelpDefinition: [
{ entity: { name: 'C_MM_SupplierValueHelp',
element: 'Supplier' }
}]
// ]--GENERATED
@ObjectModel.foreignKey.association: '_Supplier'
@UI.identification: [{
position: 10,
importance: #HIGH }]
@ObjectModel.text.element: [ 'SupplierName' ]
@Consumption.semanticObject: 'Supplier'
Supplier,
//@Semantics.text: true
@UI.lineItem: [{
position: 20,
importance: #HIGH }]
_SupplierHeadOffice.FullName as SupplierName,
ManualSupplierAddressID,
SupplierAddressID,
//--[ GENERATED:012:GFBfhyK17kY4ofIXD8GUQG
@Consumption.valueHelpDefinition: [
{ entity: { name: 'C_MM_SupplierValueHelp',
element: 'Supplier' }
}]
// ]--GENERATED
@ObjectModel.foreignKey.association: '_SupplyingSupplier'
@ObjectModel.text.element: [ 'SupplyingSupplierName' ]
SupplyingSupplier,
// UX 3.0 Improvement
@ObjectModel.readOnly: true
@Consumption.filter.hidden: true
@Semantics.text: true
_SupplyingSupplier.SupplierName as SupplyingSupplierName,
@ObjectModel.foreignKey.association: '_SupplyingPlant'
@ObjectModel.text.element: [ 'SupplyingPlantName' ]
SupplyingPlant,
// UX 3.0 Improvement
@ObjectModel.readOnly: true
@Consumption.filter.hidden: true
@Semantics.text: true
_SupplyingPlant.PlantName as SupplyingPlantName,
//--[ GENERATED:012:GFBfhyK17kY4ofIXD8GUQG
@Consumption.valueHelpDefinition: [
{ entity: { name: 'C_MM_SupplierValueHelp',
element: 'Supplier' }
}]
// ]--GENERATED
@ObjectModel.foreignKey.association: '_InvoicingParty'
@ObjectModel.text.element: [ 'InvoicingPartyName1' ]
InvoicingParty,
// UX 3.0 Improvement
@ObjectModel.readOnly: true
@Consumption.filter.hidden: true
@Semantics.text: true
_InvoicingParty.SupplierName as InvoicingPartyName1,
//payment terms
@ObjectModel.foreignKey.association: '_PaymentTerms'
@ObjectModel.text.association: '_PaymentTermsText'
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment',
position: 10,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment',
position: 10,
exclude: false,
importance: #HIGH }]
PaymentTerms,
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment',
position: 20,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment',
position: 20,
exclude: false,
importance: #HIGH }]
@EndUserText.label: 'Days 1 / In Percent'
CashDiscount1Days,
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment',
position: 30,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment',
position: 30,
exclude: false,
importance: #HIGH }]
@EndUserText.label: 'Days 2 / In Percent'
CashDiscount2Days,
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment',
position: 40,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment',
position: 40,
exclude: false,
importance: #HIGH }]
NetPaymentDays,
CashDiscount1Percent,
CashDiscount2Percent,
// Modeled only
// will be filled in OData Implementation
//Incoterms
@ObjectModel.foreignKey.association: '_IncotermsClassification'
@ObjectModel.text.association: '_IncotermsClassificationText'
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment',
position: 70,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment',
position: 70,
exclude: false,
importance: #HIGH }]
IncotermsClassification,
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment',
position: 60,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment',
position: 60,
exclude: false,
importance: #HIGH }]
IncotermsVersion,
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment',
position: 90,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment',
position: 90,
exclude: false,
importance: #HIGH }]
IncotermsLocation1,
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment',
position: 100,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment',
position: 100,
exclude: false,
importance: #HIGH }]
IncotermsLocation2,
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment',
position: 110,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment',
position: 110,
exclude: false,
importance: #HIGH }]
@EndUserText.label: 'Message on Goods Receipt requested'
@Feature: 'MM_PUR_PO_ADD_FIELDS_APP_API'
@Semantics.booleanIndicator: true
MsgOnGoodsReceiptIsRequested,
@Semantics.currencyCode
@ObjectModel.foreignKey.association: '_DocumentCurrency'
DocumentCurrency,
@UI: { hidden: true }
I_PurchaseOrderEnhanced.PurchasingHasItemHierarchy,
// ExchangeRate,
//Additional Calculated fields
@Semantics.amount.currencyCode: 'DocumentCurrency'
@DefaultAggregation: #NONE
@UI.dataPoint: {
title: 'Net Value'}
@UI.identification: [{
position: 30,
label: 'Net Value',
importance: #HIGH }]
PurchaseOrderNetAmount,
// ###### TO GO BACK TO MPC_EXT annotations enable following text.association ######
// @ObjectModel.text.association: '_PurchasingDocumentStatusText'
PurchasingDocumentStatus,
_User.UserDescription as UserFullName,
@UI.dataPoint:{title:'Status'}
@UI.lineItem: {position:30}
cast (_PurchasingDocumentStatusText.PurchasingDocumentStatusName as mm_po_status) as PurchasingDocumentStatusName,
----------------------------------------------------------------------------------------
-- HDM enablement for attachments --
----------------------------------------------------------------------------------------
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_MM_PUR_PO_MAINT_V2_TRA_EXIT'
}
@UI.hidden: true
cast ('' as hdm_adoption_ind) as HarmonizedDocumentMgmtIsActive,
@ObjectModel.readOnly: true
@UI.hidden: true
I_PurchaseOrderEnhanced._PurchaseOrderType.PurgHasFlxblWorkflowApproval,
// Associations
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_PurchaseOrderItem,
// S/4 LIMIT
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_PurchaseOrderLimitItem,
_PurOrdSuplrConfDisplay,
_PurchaseOrderType,
_CompanyCode,
_CreatedByUser,
_Supplier,
// _ContactCard,
// _SupplyingSupplier,
// _InvoicingParty,
_PurchasingOrganization,
_PurchasingGroup,
_DocumentCurrency,
_IncotermsClassification,
_SupplierAddress,
_Status,
_PurchaseOrderType._Text as _PurchaseOrderTypeText,
_PaymentTermsText,
_SuplInvPurOrdRef,
_PurOrdRefPurConItm,
_PurchaseOrderGoodsReceipt,
_IncotermsClassificationText,
_PurchasingDocumentStatusText,
_PurReqItemByPurOrder,
_PaymentTerms,
_SupplyingSupplier,
_SupplyingPlant,
_InvoicingParty,
_User,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
@ObjectModel.filter.enabled: false
@ObjectModel.sort.enabled: false
_PurchaseOrderItemHierarchy,
_PurchaseOrderPartner,
_POSupplierAddressFactSheet
}