pp_mrp_read_purchase_req
Deprecated: Replaced by I_MRPPurchaseRequisition
pp_mrp_read_purchase_req is a CDS View that provides data about "Deprecated: Replaced by I_MRPPurchaseRequisition" in SAP S/4HANA. It reads from 7 data sources and exposes 47 fields. It has 1 association to related views.
Data Sources (7)
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_MRPElementCategory | delkz |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | E_Purchaserequisitionitem | MM_PURREQN_ITEM_EXT | $projection.PurchaseRequisition = MM_PURREQN_ITEM_EXT.PurchaseRequisition and $projection.PurchaseRequisitionItem = MM_PURREQN_ITEM_EXT.PurchaseRequisitionItem |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | V_MRP_PUR_REQ | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| EndUserText.label | Deprecated: Replaced by I_MRPPurchaseRequisition | view |
Fields (47)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| PurchaseRequisition | v_mrp_purch_doc | purchasingdoc | ||
| PurchaseRequisitionItem | v_mrp_purch_doc | purchasingdocitem5 | ||
| Material | v_mrp_purch_doc | material | ||
| MaterialProcurementCategory | v_mrp_purch_doc | purchasingdocitemcategory | ||
| supplyingplantelseendasMRPPlant | ||||
| plantelseendasSupplyingPlant | ||||
| MRPController | marc | dispo | ||
| fixedvendorendasVendor | ||||
| PurchaseRequisitionIsFixed | mdtb | fix01 | ||
| PurchasingInfoRecord | v_mrp_purch_doc | purchasinginforecord | ||
| PurchasingOrganization | v_mrp_purch_doc | purchasingorganization | ||
| PurchasingGroup | v_mrp_purch_doc | purchasinggroup | ||
| TotalQuantity | v_mrp_purch_doc | purchasingdocumentorderqty | ||
| OrderedQuantity | v_mrp_purch_doc | orderedquantity | ||
| OpenQuantity | ||||
| PurchaseRequisitionUnit | v_mrp_purch_doc | purchasingdocorderqtyunit | ||
| materialidbyvendorendasVendorMaterial | ||||
| InventorySpecialStock | v_mrp_purch_doc | inventoryspecialstock | ||
| SalesDocument | v_mrp_purch_doc | salesdocument | ||
| SalesDocumentItem | v_mrp_purch_doc | salesdocumentitem | ||
| SalesDocumentType | vbk | auart | ||
| SalesDocumentItemMaterial | vbap | matnr | ||
| Customer | vbk | kunnr | ||
| WBSElementInternalID | v_mrp_purch_doc | wbselementinternalid | ||
| WBSElement | psp | posid | ||
| WBSDescription | psp | post1 | ||
| WBSResponsiblePerson | psp | vernr | ||
| WBSResponsiblePersonName | psp | verna | ||
| ProjectInternalID | psp | psphi | ||
| Project | proj | pspid | ||
| ProjectDescription | proj | post1 | ||
| MaterialPlannedDeliveryDurn | v_mrp_purch_doc | materialplanneddeliverydurn | ||
| MaterialGoodsReceiptDuration | v_mrp_purch_doc | materialgoodsreceiptduration | ||
| ReleaseDate | ||||
| DeliveryDate | v_mrp_purch_doc | deliverydate | ||
| PurchaseOutlineAgreement | v_mrp_purch_doc | purchaseoutlineagreement | ||
| PurchaseOutlineAgreementItem | v_mrp_purch_doc | purchaseoutlineagreementitem | ||
| StandardPurchaseOrderQuantity | eine | norbm | ||
| MaximumPurchaseOrderQuantity | eine | bstma | ||
| MinimumPurchaseOrderQuantity | eine | minbm | ||
| MaterialStagingDuration | eine | staging_time | ||
| PurchaseOrderRoundingProfile | eine | rdprf | ||
| MaterialFixedLotSizeQuantity | marc | bstfe | ||
| MaterialMinLotSizeQuantity | marc | bstmi | ||
| MaterialMaxLotSizeQuantity | marc | bstma | ||
| MaterialRoundingQuantity | marc | bstrf | ||
| MaterialRoundingProfile | marc | rdprf |
@AbapCatalog.sqlViewName: 'V_MRP_PUR_REQ'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #XL, dataClass: #MIXED}
@EndUserText.label: 'Deprecated: Replaced by I_MRPPurchaseRequisition'
define view pp_mrp_read_purchase_req
with parameters
P_MRPElementCategory : delkz
as select from v_mrp_purch_doc as pur
left outer join eina as eina // Pur. Info Record
on eina.mandt = pur.mandt
and eina.infnr = pur.purchasinginforecord
left outer join eine as eine // Pur. Info Record
on eine.mandt = pur.mandt
and eine.infnr = pur.purchasinginforecord
and (
eine.werks = pur.plant
or eine.werks = ''
)
and eine.ekorg = pur.purchasingorganization
and eine.esokz = '0'
left outer join marc as marc
on marc.mandt = pur.mandt
and marc.werks = pur.plant
and marc.matnr = pur.material
left outer join mdtb as mdt // MRP data
on mdt.mandt = pur.mandt
and mdt.delnr = pur.purchasingdoc
and mdt.delps = pur.purchasingdocitem6
and mdt.delkz = $parameters.P_MRPElementCategory
/* additional joins to sales orders or projects */
left outer join(
prps as psp
inner join proj as pro on psp.mandt = pro.mandt
and psp.psphi = pro.pspnr
)
on pur.mandt = psp.mandt
and pur.wbselementinternalid = psp.pspnr
left outer join(
vbak as vbk
inner join vbap as vbp on vbk.mandt = vbp.mandt
and vbk.vbeln = vbp.vbeln
)
on pur.mandt = vbp.mandt
and pur.salesdocument = vbp.vbeln
and pur.salesdocumentitem = vbp.posnr
association [0..1] to E_Purchaserequisitionitem as MM_PURREQN_ITEM_EXT on $projection.PurchaseRequisition = MM_PURREQN_ITEM_EXT.PurchaseRequisition
and $projection.PurchaseRequisitionItem = MM_PURREQN_ITEM_EXT.PurchaseRequisitionItem
{
pur.purchasingdoc as PurchaseRequisition,
pur.purchasingdocitem5 as PurchaseRequisitionItem,
pur.material as Material,
pur.purchasingdocitemcategory as MaterialProcurementCategory,
case $parameters.P_MRPElementCategory
when 'BA' then pur.plant
when 'U2' then pur.supplyingplant
else ''
end as MRPPlant,
case $parameters.P_MRPElementCategory
when 'BA' then pur.supplyingplant
when 'U2' then pur.plant
else ''
end as SupplyingPlant,
marc.dispo as MRPController,
case pur.fixedvendor
when '' then pur.vendor
else pur.fixedvendor
end as Vendor,
case pur.fixedvendor
when '' then ''
else 'X'
end as VendorIsFixed,
mdt.fix01 as PurchaseRequisitionIsFixed,
pur.purchasinginforecord as PurchasingInfoRecord,
pur.purchasingorganization as PurchasingOrganization,
pur.purchasinggroup as PurchasingGroup,
pur.purchasingdocumentorderqty as TotalQuantity,
pur.orderedquantity as OrderedQuantity,
(pur.purchasingdocumentorderqty - pur.orderedquantity) as OpenQuantity,
pur.purchasingdocorderqtyunit as PurchaseRequisitionUnit,
case pur.materialidbyvendor
when '' then eina.idnlf
else pur.materialidbyvendor
end as VendorMaterial,
pur.inventoryspecialstock as InventorySpecialStock,
pur.salesdocument as SalesDocument,
pur.salesdocumentitem as SalesDocumentItem,
vbk.auart as SalesDocumentType,
vbp.matnr as SalesDocumentItemMaterial,
vbk.kunnr as Customer,
pur.wbselementinternalid as WBSElementInternalID,
psp.posid as WBSElement,
psp.post1 as WBSDescription,
psp.vernr as WBSResponsiblePerson,
psp.verna as WBSResponsiblePersonName,
psp.psphi as ProjectInternalID,
pro.pspid as Project,
pro.post1 as ProjectDescription,
pur.materialplanneddeliverydurn as MaterialPlannedDeliveryDurn,
pur.materialgoodsreceiptduration as MaterialGoodsReceiptDuration,
cast(pur.purchasingdocreleasedate as abap.dats) as ReleaseDate,
pur.deliverydate as DeliveryDate,
pur.purchaseoutlineagreement as PurchaseOutlineAgreement,
pur.purchaseoutlineagreementitem as PurchaseOutlineAgreementItem,
eine.norbm as StandardPurchaseOrderQuantity,
eine.bstma as MaximumPurchaseOrderQuantity,
eine.minbm as MinimumPurchaseOrderQuantity,
eine.staging_time as MaterialStagingDuration,
eine.rdprf as PurchaseOrderRoundingProfile,
marc.bstfe as MaterialFixedLotSizeQuantity,
marc.bstmi as MaterialMinLotSizeQuantity,
marc.bstma as MaterialMaxLotSizeQuantity,
marc.bstrf as MaterialRoundingQuantity,
marc.rdprf as MaterialRoundingProfile,
case $parameters.P_MRPElementCategory
when 'BA' then case pur.supplyingplant
when '' then case pur.fixedvendor
when '' then case pur.vendor
when '' then '024' // Unsourced Req.
else '021' // Purchase Req.
end
else '021' // Purchase Req.
end
else '022' // Transfer Req.
end
when 'U2' then '023'
else '000'
end as QuickviewCategory
// MM_PURREQN_ITEM_EXT
}
where
docispurchaserequisition = 'X'
and purchasingdocdeletion = '';
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"EINA",
"EINE",
"MARC",
"MDTB",
"PROJ",
"PRPS",
"VBAK",
"VBAP",
"V_MRP_PURCH_DOC"
],
"ASSOCIATED":
[
"E_PURCHASEREQUISITIONITEM"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA