Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member185414
Active Contributor
Specific Example: In this document, I would show the steps needed to enhance the data model to enable addition of custom fields in the standard MIGO transaction in S4 HANA.

Some background before jumping in the modelling.

With the advent of S4HANA, the data model has changed for many business objects. Same is the case with Material Documents (which is the case study for this blog). A new table ‘MATDOC’ has been introduced which stores the combined results of MKPF and MSEG tables. Any write operation persists the results in MATDOC table only. Also, these tables have been enhanced with proxy objects (aka CDS views) namely NSDM_E_MKPF and NSDM_E_MSEG. They are primarily used during data retrieval. Also, any enhancement in these tables needs to consider the proxy objects as well.

In traditional ECC (non S4HANA) days, we used only below options of enhancing any standard table(wherever allowed)

  1. Option 1 – Use the provided CI include and add custom fields

  2. Option 2 – Create a new append structure with custom fields


Same could be followed in S4HANA paradigm as well. Following Option 1 will lead to the addition of the custom fields in all the places where the CI include is used. This in turn forces us to enhance all the associated proxy objects or CDS views as well. This is good in case the custom fields are needed in all views and at all levels. But, if it’s a non-reusable then Option 2 is the quick and easy way to do it.

Here, I will demo option 2 where I will enhance the MSEG table with custom fields.

There are 3 steps in options 2.

a. Enhance MSEG table for BAPI or BADI processing.

b. Enhance the MATDOC table for persisting the data.

c. Enhance the associated CDS view on MSEG to be able to retrieve the stored data.

Details -

a. We can add an append structure in MSEG as below



b. We can locate the suitable place in MATDOC where custom field can be added. We need to read the description of all includes and see fields in them to identify the suitable place.





 



c.  In this step, we need to identify the proxy object. After that we need to extend that proxy object with custom fields.







PS: This blog is on similar lines to Joachim's blog @ https://blogs.sap.com/2016/07/11/appending-tables-in-s4hana-easy-mbew/

Feedback is much appreciated.
4 Comments