CDS views used for transactional data load to MRP live
SAP introduced the MRP live in S/4 HANA to perform the production planning. This tool is similar to classic MRP from business perspective but is completely different from the technical side since it’s leveraging the new capabilities of S/4 HANA like the use of the CDS views or the execution of AMDP method on the database level to select the data. I want to share with you, in this blog, how SAP S/4 HANA is using CDS views to load the transactional data needed for the MRP calculation under MRP live.
As all Functional consultants (I suppose), I have started looking for CDS view to be able to use them or to propose them whenever a custom development is needed (Interfaces, Fiori applications or an ABAP report) since its performance is much more better than selection to the application server and assume like SAP recommends to use the existing objects like methods and function module while building the reports, it could be recommended to use available CDS views when possible. This search brings me to the function module MD_MDPSX_READ_API which is recommended in SAP note 2268085 to be used to extract MD04 records. By diving into the function module, I found AMDP method GET_MRP_ELEMENTS of class CL_PPH_READ_CLASSIC that includes the CDS view used by SAP to select the transaction records.
1- List of CDS views
The DDL SQL view for every transactional object are:
|Transactional object||DDL SQL View|
|Planned independent requirements for MRP||v_pph_mdpb|
|Order Item/Schedule Line (EKET)||v_pph_mdbs|
|Stock Transport Order for Release Order||v_pph_mdub|
|Stock Transfer Reservations||v_pph_mdur|
|Stock Transfer Purchase Requisition’s Reqmts||v_pph_mdua|
|QM Inspection Lot||v_pph_mdqm|
|Order confirmations (EKES)||v_pph_mdla|
|Confirmations in Case of Returns||v_pph_mdrela|
2- Use cases
These CDS views could be used to select the transactional data in the same way as used by SAP.
For example, let suppose that I want to select the open quantity for a purchase order. In ECC, this is reacheable by performing a calculation in ABAP. However, in S/4 HANA, I can use CDS view v_pph_mdbs to select field MNG01 by using DELNR that contains the purchase order number and DELPS that contains the purchase order item.
Another example could be the extraction of open in-house production planned orders, It will be sufficient to use CDS views v_pph_plaf_rg or v_pph_plaf_pw (production plant <> planning plant) to get the planned orders relevant for planning.
What I like when displaying any of the listed CDS views, is that I can find which selection or join SAP has used and which are the selection criteria used to fetch the transactional records relevant for planning. This helped me to understand better the data model of SAP.
I hope that you that you like this blog. Please feel free to comment, your remarks are welcome and will for sure improve our knowledge.