@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', typeName_AsOTR: '005056AC156F1EE587E6502639D41B8A',
typeNamePlural: 'Purchase Order', typeNamePlural_AsOTR: '005056AC156F1EE587E6502639D41B8A',
typeImageUrl: '/sap/bc/ui5_ui5/sap/mm_purorders1/images/purchaseorder.png',
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,
//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', groupLabel_asOtr: 'FA163EDF73161EE587C742C45B2B0F3D',
position: 10,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail3',
groupLabel: 'Recipient', groupLabel_asOtr: 'FA163EDF73161EE587C742C45B2B0F3D',
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', groupLabel_asOtr: 'FA163EDF73161EE587C742C45B2B0F3D',
position: 30,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail3',
groupLabel: 'Recipient', groupLabel_asOtr: 'FA163EDF73161EE587C742C45B2B0F3D',
position: 30,
exclude: false,
importance: #HIGH
}]
PurchasingOrganization,
//@Semantics.text: true
_PurchasingOrganization.PurchasingOrganizationName,
@ObjectModel.foreignKey.association: '_PurchasingGroup'
@UI.fieldGroup: [{
qualifier: 'Recipient',
groupLabel: 'Recipient', groupLabel_asOtr: 'FA163EDF73161EE587C742C45B2B0F3D',
position: 20,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail3',
groupLabel: 'Recipient', groupLabel_asOtr: 'FA163EDF73161EE587C742C45B2B0F3D',
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'
SupplyingSupplier,
@ObjectModel.foreignKey.association: '_SupplyingPlant'
SupplyingPlant,
//--[ GENERATED:012:GFBfhyK17kY4ofIXD8GUQG
@Consumption.valueHelpDefinition: [
{ entity: { name: 'C_MM_SupplierValueHelp',
element: 'Supplier' }
}]
// ]--GENERATED
@ObjectModel.foreignKey.association: '_InvoicingParty'
InvoicingParty,
//payment terms
@ObjectModel.foreignKey.association: '_PaymentTerms'
@ObjectModel.text.association: '_PaymentTermsText'
PaymentTerms,
CashDiscount1Days,
CashDiscount2Days,
NetPaymentDays,
CashDiscount1Percent,
CashDiscount2Percent,
// Modeled only
// will be filled in OData Implementation
@UI.fieldGroup: [{
qualifier: 'BasicData2',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 10,
exclude: false,
importance: #HIGH }, {
qualifier: 'BasicData2',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 10,
exclude: false,
importance: #HIGH }]
cast('' as mm_pur_paymenttermstext) as PaymentTermsDescription,
//Incoterms
@ObjectModel.foreignKey.association: '_IncotermsClassification'
@ObjectModel.text.association: '_IncotermsClassificationText'
@UI.fieldGroup: [{
qualifier: 'BasicData',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 20,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 20,
exclude: false,
importance: #HIGH }]
IncotermsClassification,
@UI.fieldGroup: [{
qualifier: 'DelivAndPayment',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 30,
exclude: false,
importance: #HIGH }, {
qualifier: 'Detail2',
groupLabel: 'Delivery and Payment', groupLabel_asOtr: '40F2E93067D51EE5849F988EA19FC670',
position: 30,
exclude: false,
importance: #HIGH }]
IncotermsTransferLocation,
@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', label_asOtr: '005056AC156F1EE587F8BC1D8963371E' }
@UI.identification: [{
position: 30,
label: 'Net Value', label_asOtr: '005056AC156F1EE587F8BC1D8963371E',
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', title_AsOTR: '005056B2532A1EE585B97A4F343C0274'}
@UI.lineItem: {position:30}
cast (_PurchasingDocumentStatusText.PurchasingDocumentStatusName as mm_po_status) as PurchasingDocumentStatusName,
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_MM_PUR_PO_MAINT_V2_TRA_EXIT'
}
@UI.hidden: true
cast ('' as boolean) as PurchaseOrderPrtnFuncIsEnbld,
@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
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_PURCHASEORDERENHANCED",
"I_PURCHASEORDERTYPE",
"I_PURCHASINGDOCUMENTSTATUSTEXT",
"I_PURCHASINGDOCUMENTTYPE",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"I_SUPPLIERORADDRESSCONTACTCARD",
"I_USER"
],
"ASSOCIATED":
[
"C_POSUPPLIERADDRESSFACTSHEET",
"C_PURCHASEORDERGOODSRECEIPT",
"C_PURCHASEORDERLIMITITEM",
"C_PURORDERITEMHIERFACTSHEET",
"C_PURORDERPARTNERFACTSHEET",
"C_PURORDITEMENH",
"C_PURORDREFPURCONITM",
"C_PURORDSUPLRCONFDISPLAY",
"C_PURREQITEMBYPURORDER",
"C_SUPLINVPURORDREF",
"E_PURCHASINGDOCUMENT",
"I_ADDRESS",
"I_COMPANYCODE",
"I_CURRENCY",
"I_INCOTERMSCLASSIFICATION",
"I_INCOTERMSCLASSIFICATIONTEXT",
"I_PAYMENTTERMS",
"I_PAYMENTTERMSTEXT",
"I_PLANT",
"I_PURCHASINGDOCUMENTSTATUS",
"I_PURCHASINGDOCUMENTSTATUSTEXT",
"I_PURCHASINGDOCUMENTTYPE",
"I_PURCHASINGDOCUMENTTYPETEXT",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"I_SUPPLIER",
"I_SUPPLIERORADDRESSCONTACTCARD",
"I_USER"
],
"BASE":
[
"I_PURCHASEORDERENHANCED",
"I_PURCHASINGDOCUMENTTYPE"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/