//@AbapCatalog.sqlViewName: 'RPURREQNITEM'
@VDM.usage.type:[#TRANSACTIONAL_PROCESSING_SERVICE]
//@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Process Purchase Requisition Application'
@VDM.viewType: #CONSUMPTION
//@EndUserText.label: 'CDS View without Aggregate Functions for Manage PR'
@AccessControl.privilegedAssociations: [ '_ContactCard' ]
@Search.searchable: true // add in projection view
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@UI: {
headerInfo: { typeName: 'Purchase Requisitions', typeNamePlural: 'Purchase Requisitions', title: { type: #STANDARD, value: 'PurchaseRequisition' } }
}
@UI.presentationVariant: [{
visualizations: [{type: #AS_LINEITEM}],
requestAtLeast: ['PurgDocProductType', 'IsPurReqnBlocked', 'PurReqnReleaseStatus', 'PurchasingDocumentSubtype', 'IsClosed' , 'Supplier', 'PurchasingDocumentItemCategory','MaterialName' , 'PurchasingOrganization'
, 'PurchasingGroup','PurchasingDocumentCategory' ,'AccountAssignmentCategory', 'PurchaseContract','PurchaseContractItem' , 'PurchasingInfoRecord', 'PurchaseRequisitionType' , 'IsOutline' , 'PurchasingParentItem','OrderedQuantity' ]
}]
@Consumption.ranked: true
define root view entity C_PurReqnItemExtTP
as select from I_Purchaserequisitionitem as ebn1
// association [1..1] to P_SupplierPRDetails as _SupplierPurReqnDetails on $projection.FixedSupplier = _SupplierPurReqnDetails.Vendor
association [0..1] to C_PurDocItemCategoryValueHelp as _PurDocItemCategoryValueHelp on _PurDocItemCategoryValueHelp.PurchasingDocumentItemCategory = $projection.PurchasingDocumentItemCategory
and _PurDocItemCategoryValueHelp.PurgDocExternalItemCategory = $projection.PurgDocExternalItemCategory
association [0..1] to E_Purchaserequisitionitem as _Purchaserequisitionitem on $projection.PurchaseRequisition = _Purchaserequisitionitem.PurchaseRequisition
and $projection.PurchaseRequisitionItem = _Purchaserequisitionitem.PurchaseRequisitionItem
association [1..1] to I_PurReqnProcessingStatusVH as _PurReqnProcessingStatusVH on $projection.ProcessingStatus = _PurReqnProcessingStatusVH.ProcessingStatus
association [1..1] to C_PurchaseReqnItemCO2eqFprnt as _PurchaseReqnItemCO2eqFprnt on _PurchaseReqnItemCO2eqFprnt.PurchaseRequisition = $projection.PurchaseRequisition
and _PurchaseReqnItemCO2eqFprnt.PurchaseRequisitionItem = $projection.PurchaseRequisitionItem
association [0..1] to C_RfqBidderVH as _RFQBidderVH on $projection.FixedSupplier = _RFQBidderVH.Supplier
association [0..*] to C_PurReqnProposedSOS as _PurReqnProposedSOS on $projection.PurchaseRequisition = _PurReqnProposedSOS.PurchaseRequisition
and $projection.PurchaseRequisitionItem = _PurReqnProposedSOS.PurchaseRequisitionItem
association [0..1] to I_UserContactCard as _CreatedByUser on $projection.CreatedByUser = _CreatedByUser.ContactCardID
association [0..1] to I_SupplierContactCard as _ContactCard on $projection.FixedSupplier = _ContactCard.ContactCardID
association [1..1] to I_MaterialGroupText as _MaterialGroupText on $projection.MaterialGroup = _MaterialGroupText.MaterialGroup
and _MaterialGroupText.Language = $session.system_language
association [1..1] to I_MaterialText as _MaterialText on $projection.Material = _MaterialText.Material
and _MaterialText.Language = $session.system_language
// association [1..1] to I_Address as _Address on $projection.DeliveryAddressID = _Address.AddressID
association [1..1] to I_AddressDefaultRepresentation as _Address on $projection.DeliveryAddressID = _Address.AddressID
association [0..*] to C_MM_PlantValueHelp as _PlantValueHelp on $projection.Plant = _PlantValueHelp.Plant
association [0..1] to C_MM_SupplierValueHelp as _SupplierValueHelp on _SupplierValueHelp.Supplier = $projection.Supplier
association [0..*] to C_MM_SupplierValueHelp as _FixedSupplierValueHelp on _FixedSupplierValueHelp.Supplier = $projection.FixedSupplier
association [1..1] to I_Processingstatustext as _ProcessingStatusText on $projection.ProcessingStatus = _ProcessingStatusText.ProcessingStatus
and _ProcessingStatusText.Language = $session.system_language
association [1..1] to I_PurchasingCategoryMatlGroup as _PurchasingCategoryMatlGroup on ebn1.MaterialGroup = _PurchasingCategoryMatlGroup.MaterialGroup
{
@Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.9 }
@EndUserText.label: 'Purchase Requisition Number'
@Consumption.semanticObject: 'PurchaseRequisition'
@UI: { lineItem: [ {position: 5 , importance: #HIGH } , {type: #FOR_INTENT_BASED_NAVIGATION, semanticObjectAction: 'maintain' , hidden: true}
, { type: #FOR_ACTION, dataAction: 'Delete' , importance: #LOW } ],
selectionField: [{position: 1 }] }
key ebn1.PurchaseRequisition,
@EndUserText.label: 'Item Number of Purchase Requisition'
@UI.lineItem: [{position: 10 , importance: #HIGH }]
key ebn1.PurchaseRequisitionItem,
@EndUserText.label: 'Purchasing Document Number'
ebn1.PurchasingDocument,
@EndUserText.label: 'Purchasing Document Item Number'
ebn1.PurchasingDocumentItem,
@EndUserText.label: 'Purchase Requisition Hierarchy Number'
@UI.lineItem: [{position: 11 , importance: #HIGH }]
@Feature : 'SW:MM_PUR_SRVCPROC_SFWS_ITM_HIER'
ebn1.PurgConfigurableItemNumber as PurgConfigurableItemNumber,
@EndUserText.label: 'Purchase Requisition Document Type'
ebn1.PurchaseRequisitionType,
@Consumption.valueHelpDefinition: [{ entity : {name: 'C_PurDocItemCategoryValueHelp', element: 'PurchasingDocumentItemCategory' } }]
@ObjectModel.filter.enabled: true
@ObjectModel.text.element: ['PurgDocItemCategoryName']
@EndUserText.label: 'Purchasing Document Item Category'
ebn1.PurchasingDocumentItemCategory,
@EndUserText.label: 'Text for Item Category'
_PurDocItemCategoryValueHelp.PurgDocItemCategoryName as PurgDocItemCategoryName,
@EndUserText.label: 'Short Text'
@Search: { defaultSearchElement: true, fuzzinessThreshold: 0.9}
ebn1.PurchaseRequisitionItemText,
@EndUserText.label: 'Material ID'
@Search: { defaultSearchElement: true, fuzzinessThreshold: 0.9}
@UI.lineItem: [{position: 15, importance: #HIGH }]
@ObjectModel: {foreignKey.association: '_Material' }
@Consumption.semanticObject: 'Material'
@ObjectModel.text.element : [ 'PurchaseRequisitionItemText' ]
ebn1.Material,
@EndUserText.label: 'Purchasing Document Category'
ebn1.PurchasingDocumentCategory,
@EndUserText.label: 'Quantity'
@UI.lineItem: [{position: 35 , importance: #HIGH }]
ebn1.RequestedQuantity,
@EndUserText.label: 'Purchase Requisition Unit of Measure'
ebn1.BaseUnit,
@EndUserText.label: 'Price in Purchase Requisition'
ebn1.PurchaseRequisitionPrice,
@EndUserText.label: 'Price Unit'
ebn1.PurReqnPriceQuantity,
@EndUserText.label: 'Order Unit' //3097248
ebn1.MaterialOrderUnit,
@EndUserText.label: 'Goods Receipt Processing Time in Days'
ebn1.MaterialGoodsReceiptDuration,
@EndUserText.label: 'Release Indicator'
ebn1.ReleaseCode,
@EndUserText.label: 'Purchasing Organization'
@Consumption.semanticObject: 'ekorg'
@UI:{ fieldGroup:[ { label: 'Purchasing Organization', position: 30 }
], selectionField: [{position: 30}] }
@ObjectModel.text.element: ['PurchasingOrganizationName']
@Consumption.valueHelpDefinition: [{ entity : {name: 'I_PurchasingOrganization', element: 'PurchasingOrganization' } }]
@ObjectModel.filter.enabled: true
ebn1.PurchasingOrganization,
@Consumption.semanticObject: 'PurchasingGroup'
@ObjectModel.text.element: ['PurchasingGroupName']
@UI:{ fieldGroup:[ { label: 'Purchasing Group', position: 20 }
], selectionField: [{position: 20}]}
@Consumption.valueHelpDefinition: [{ entity : {name: 'C_PurchasingGroupValueHelp', element: 'PurchasingGroup' } }]
@ObjectModel.filter.enabled: true
ebn1.PurchasingGroup,
@UI:{ fieldGroup:[ { label: 'Plant', position: 10, importance:#HIGH }
], selectionField: [{position: 10}],
lineItem: [{ position: 60 }]}
@Consumption.valueHelpDefinition: [{ entity : {name: 'C_MM_PlantValueHelp', element: 'Plant' } }]
@ObjectModel.filter.enabled: true
@ObjectModel: {foreignKey.association: '_Plant' }
@ObjectModel.text.element: ['SupplyingPlantName']
@Consumption.semanticObject: 'Plant'
ebn1.Plant,
@EndUserText.label: 'Assigned Source of Supply'
ebn1.SourceOfSupplyIsAssigned,
@EndUserText.label: 'Supplying Plant'
ebn1.SupplyingPlant,
@EndUserText.label: 'Purchase Order Quantity'
// @UI.lineItem: [{position: 40 }]
ebn1.OrderedQuantity,
@EndUserText.label: 'Processing Status'
@Consumption.semanticObject: 'ProcessingStatus'
@UI:{ fieldGroup:[ { label: 'Processing Status', position: 40, importance: #HIGH }
], selectionField: [{position: 50}],
lineItem: [{ position: 65 }]}
@Consumption.valueHelpDefinition: [{ entity : {name: 'I_PurReqnProcessingStatusVH', element: 'ProcessingStatus' } }]
@ObjectModel.filter.enabled: true
@ObjectModel.text.element: ['ProcessingStatusName']
ebn1.ProcessingStatus,
@EndUserText.label: 'Number of Purchasing Info Record'
// @UI.lineItem: [{position: 190 }]
ebn1.PurchasingInfoRecord,
@EndUserText.label: 'Desired Vendor'
@Consumption.valueHelp: '_SupplierValueHelp'
// @ObjectModel.text.element: ['SupplierName']
@ObjectModel.foreignKey.association: '_SupplierValueHelp'
ebn1.Supplier,
@EndUserText.label: 'Deletion Indicator in Purchasing Document'
ebn1.IsDeleted,
@EndUserText.label: 'Overall Requisition Release'
ebn1.IsPurReqnOvrlRel,
@Consumption.valueHelp: '_FixedSupplierValueHelp'
@EndUserText.label: 'Assigned Supplier '
@Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.9 }
ebn1.FixedSupplier,
@EndUserText.label: 'Requested By' //Note 2904386
@ObjectModel.text.element: ['UserDescription']
ebn1.RequisitionerName,
_User.UserDescription as UserDescription,
@EndUserText.label: 'Name of Person who Created the Object'
@Semantics.user.createdBy: true
@ObjectModel.text.element: ['CreatedByUserDescription']
ebn1.CreatedByUser,
@EndUserText.label: 'Created by User Description'
_User.UserDescription as CreatedByUserDescription,
@Consumption.valueHelpDefinition: [{ entity : {name: 'I_PurchaseRequisitionItemBasic', element: 'DeliveryDate' } }]
@ObjectModel.filter.enabled: true
@Consumption.filter.selectionType: #INTERVAL
@UI.lineItem: [{position: 215 }]
@UI: { fieldGroup: [ { label: 'Item Delivery Date', position: 110, importance: #HIGH } ], selectionField: [{ position:110 }] }
ebn1.DeliveryDate,
@EndUserText.label: 'Requisition Date'
@Consumption.semanticObject: 'PurReqCreationDate'
@UI:{ fieldGroup:[ { label: 'Requisition Date', position: 100 }
], selectionField: [{position: 100}] }
@Consumption.valueHelpDefinition: [{ entity : {name: 'I_Purchaserequisitionitem', element: 'PurReqCreationDate' } }]
@ObjectModel.filter.enabled: true
@Consumption.filter.selectionType: #INTERVAL
ebn1.PurReqCreationDate,
@EndUserText.label: 'Manual Address Number in Purchasing Document Item'
ebn1.ManualDeliveryAddressID,
@EndUserText.label: 'Currency Key'
ebn1.PurReqnItemCurrency,
@EndUserText.label: 'Control Indicator'
ebn1.PurchasingDocumentSubtype,
@EndUserText.label: 'Number of Sources of Supply'
cast (0 as abap.int4 ) as PurReqnSourceOfSupplyCount,
@EndUserText.label: 'Start Date'
@Consumption.semanticObject: 'PerformancePeriodStartDate'
@UI:{ fieldGroup:[ { label: 'Start Date', position: 70 }
], selectionField: [{position: 70}] }
@Consumption.valueHelpDefinition: [{ entity : {name: 'I_Purchaserequisitionitem', element: 'PerformancePeriodStartDate' } }]
@ObjectModel.filter.enabled: true
@Consumption.filter.selectionType: #INTERVAL
ebn1.PerformancePeriodStartDate,
@EndUserText.label: 'End Date'
@Consumption.semanticObject: 'PerformancePeriodEndDate'
@UI:{ fieldGroup:[ { label: 'End Date', position: 80 }
], selectionField: [{position: 80}] }
@Consumption.valueHelpDefinition: [{ entity : {name: 'I_Purchaserequisitionitem', element: 'PerformancePeriodEndDate' } }]
@ObjectModel.filter.enabled: true
@Consumption.filter.selectionType: #INTERVAL
ebn1.PerformancePeriodEndDate,
@EndUserText.label: 'Requisition Processing State'
ebn1.PurReqnReleaseStatus,
@EndUserText.label: 'Planned Delivery Time in Days'
ebn1.MaterialPlannedDeliveryDurn,
@EndUserText.label: 'Number of Principal Purchase Agreement'
ebn1.PurchaseContract,
@EndUserText.label: 'Source of Supply Type'
ebn1.PurReqnSourceOfSupplyType, //To be approved
@EndUserText.label: 'Item Number of Principal Purchase Agreement'
ebn1.PurchaseContractItem,
@Search: { defaultSearchElement: true, fuzzinessThreshold: 0.9}
@EndUserText.label: 'Purchasing Organisation Name'
_PurchasingOrganization.PurchasingOrganizationName as PurchasingOrganizationName,
@Search: { defaultSearchElement: true, fuzzinessThreshold: 0.9}
@EndUserText.label: 'Description Of Purchasing Group'
_PurchasingGroup.PurchasingGroupName as PurchasingGroupName,
@EndUserText.label: 'Telephone Number of Purchasing Group'
_PurchasingGroup.PurchasingGroupPhoneNumber,
@EndUserText.label: 'Telephone Number'
_PurchasingGroup.PhoneNumber,
@EndUserText.label: 'Telephone Extension Number'
_PurchasingGroup.PhoneNumberExtension,
@EndUserText.label: 'E-Mail Address'
_PurchasingGroup.EmailAddress,
@EndUserText.label: 'Language Key'
ebn1.Language,
@Consumption.semanticObject: 'MaterialGroup'
@UI:{ fieldGroup:[ { label: 'Product Group', position: 110, importance: #HIGH }
], selectionField: [{position: 40}],
lineItem: [{ position: 25 }] }
@Consumption.valueHelpDefinition: [{ entity : {name: 'I_MaterialGroup', element: 'MaterialGroup' } }]
@ObjectModel.filter.enabled: true
@ObjectModel.text.element : [ 'MaterialGroupName' ]
@Consumption.valueHelp: '_MaterialGroup'
ebn1.MaterialGroup,
@ObjectModel.filter.enabled: false
// @Feature : 'SW:MM_PUR_SRVCPROC_SFWS_ITM_HIER'
ebn1.IsOutline,
@ObjectModel.filter.enabled: false
// @Feature : 'SW:MM_PUR_SRVCPROC_SFWS_ITM_HIER'
ebn1.PurchasingParentItem,
@EndUserText.label: 'Material Name'
_MaterialText.MaterialName,
@EndUserText.label: 'Name'
_Plant.PlantName as SupplyingPlantName,
@EndUserText.label: 'Account Assignment Category'
ebn1.AccountAssignmentCategory,
@EndUserText.label: 'Account Assignment Category Description'
_AccAssgnmtCategory.AcctAssignmentCategoryName as AcctAssignmentCategoryName,
@EndUserText.label: 'Consumption Posting'
ebn1.ConsumptionPosting,
ebn1.DeliveryAddressID,
@EndUserText.label: 'Purchaser Name'
_Address.AddresseeFullName as FullName,
@EndUserText.label: 'House Number'
_Address.HouseNumber as HouseNumber,
@EndUserText.label: 'Text Id Count'
0 as NumberOfRecords,
@EndUserText.label: 'Source of Supply Count'
cast (0000 as abap.int4) as NumberOfInfoRecords,
_Address.CityName,
@EndUserText.label: 'Country / Region Key'
_Address.Country,
@Consumption.semanticObject: 'PurchaseRequisitionReleaseDate'
@UI:{ fieldGroup:[ { label: 'Release Date', position: 90 }
], selectionField: [{position: 90}] }
@Consumption.valueHelpDefinition: [{ entity : {name: 'I_Purchaserequisitionitem', element: 'PurchaseRequisitionReleaseDate' } }]
@ObjectModel.filter.enabled: true
@Consumption.filter.selectionType: #INTERVAL
ebn1.PurchaseRequisitionReleaseDate,
@EndUserText.label: 'Total Value'
@UI.lineItem: [{position: 45 , importance: #HIGH }]
@Semantics.amount.currencyCode: 'PurReqnItemCurrency'
ebn1.ItemNetAmount as PurReqnPrice,
@EndUserText.label: 'Processing status text of purchase requisition'
@EndUserText.quickInfo: 'Processing status text of purchase requisition'
_ProcessingStatusText.ProcessingStatusName as ProcessingStatusName,
@ObjectModel.text.element: ['PurgCatName']
@EndUserText.label: 'Purchasing Category'
_PurchasingCategoryMatlGroup._PurchasingCategory.PurchasingCategory as PurchasingCategory,
@Semantics.text: true
@EndUserText.label: 'Purchasing Category Name'
_PurchasingCategoryMatlGroup._PurchasingCategory.PurgCatName as PurgCatName,
ebn1.ProductType as PurgDocProductType,
@EndUserText.label: 'Product Group Description'
_MaterialGroupText.MaterialGroupName,
@EndUserText.label: 'Follow-on Document Exists'
case
when (ebn1.ProcessingStatus = 'N' or (ebn1.ProcessingStatus = 'B' and ebn1.OrderedQuantity < ebn1.RequestedQuantity))
then ' '
else 'X'
end as PurReqnHasFllwOnDoc,
@EndUserText.label: 'Creation Indicator'
ebn1.PurReqnOrigin,
@EndUserText.label: 'Purchase Requisition Incomplete'
ebn1.IsPurReqnCmplt,
@EndUserText.label: 'Category of Incompleteness'
ebn1.PurReqnCmpltnsCat,
@UI.hidden: true
ebn1.IsPurReqnBlocked as IsPurReqnBlocked,
@UI.hidden: true
ebn1.IsClosed,
@EndUserText.label: 'CO2e Footprint'
_PurchaseReqnItemCO2eqFprnt.PFMFootprintQuantity,
_PurchaseReqnItemCO2eqFprnt.PFMFootprintUnit,
_PurchasingOrganization,
_PurchasingGroup,
_Plant,
_PlantValueHelp,
_Material,
_MaterialText,
_MaterialGroupText,
_SupplierValueHelp,
_Address,
_FixedSupplierValueHelp,
_ProcessingStatusText,
_PurReqnProcessingStatusVH,
_PurchasingCategoryMatlGroup,
_User,
@ObjectModel.filter.enabled:false
_PurDocItemCategoryValueHelp.PurgDocExternalItemCategory as PurgDocExternalItemCategory,
_PurDocItemCategoryValueHelp,
_RFQBidderVH,
_CreatedByUser,
@UI.lineItem:[{value:'_ContactCard',label: 'Fixed Supplier', type: #AS_CONTACT }]
_ContactCard,
@ObjectModel.filter.enabled:false
_PurReqnProposedSOS
}
where
ebn1.IsDeleted = ''
and(
ebn1.ProcessingStatus = 'N'
or ebn1.ProcessingStatus = 'B'
or ebn1.ProcessingStatus = 'A'
or ebn1.ProcessingStatus = 'K'
or ebn1.ProcessingStatus = 'L' //3075832
)
and(
PurReqnCmpltnsCat <> 'A'
)
and ebn1.IsPurReqnBlocked = ''
and ebn1.IsClosed = ''
and(
ebn1.PurReqnReleaseStatus <> '08'
)
and(
ebn1.ExternalApprovalStatus <> 'P'
and ebn1.ExternalApprovalStatus <> 'R'
)
and ebn1.PurchasingDocumentItemCategory <> '9'
and not(
ebn1.PurReqnOrigin = 'S'
and ebn1.ExtCompanyCodeForPurg <> ''
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_PURCHASEREQNITEMCO2EQFPRNT",
"C_PURDOCITEMCATEGORYVALUEHELP",
"I_ACCASSGNMTCATEGORY",
"I_ADDRESSDEFAULTREPRESENTATION",
"I_MATERIALGROUPTEXT",
"I_MATERIALTEXT",
"I_PLANT",
"I_PROCESSINGSTATUSTEXT",
"I_PURCHASEREQUISITIONITEM",
"I_PURCHASINGCATEGORY",
"I_PURCHASINGCATEGORYMATLGROUP",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"I_USER"
],
"ASSOCIATED":
[
"C_MM_PLANTVALUEHELP",
"C_MM_SUPPLIERVALUEHELP",
"C_PURDOCITEMCATEGORYVALUEHELP",
"C_PURREQNPROPOSEDSOS",
"C_RFQBIDDERVH",
"I_ADDRESSDEFAULTREPRESENTATION",
"I_MATERIAL",
"I_MATERIALGROUPTEXT",
"I_MATERIALTEXT",
"I_PLANT",
"I_PROCESSINGSTATUSTEXT",
"I_PURCHASINGCATEGORYMATLGROUP",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"I_PURREQNPROCESSINGSTATUSVH",
"I_SUPPLIERCONTACTCARD",
"I_USER",
"I_USERCONTACTCARD"
],
"BASE":
[
"I_PURCHASEREQUISITIONITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/