Académique Documents
Professionnel Documents
Culture Documents
Products Industries
Industries Services Support
Services and Support Training
Training Community
Community Developer
Developer
Partner
Partner About
About
Ask a Question Write a Blog Post Login
Technical Articles
Gokul Radhakrishnan
May 9, 2019 3 minute read
In S/4 HANA, there is always a confusion about the tables MSEG and MATDOC. This blog is to explain where
exactly your data is going and how to understand the link between MSEG and MATDOC tables.
For example, in the below case when you check the number of entries of MSEG in SE16N, it shows 55
entries.
Where as if you check the same in MATDOC, it shows the same 55 records. So which one is real?
Lets try a di erent approach. Lets try to check the correct entries through a database query using
transaction DBACOCKPIT which directly queries the database. First check in MATDOC as below.
Perfect!. it shows 55 as expected when you run a straight forward select query from MATDOC at database
level.
Lets try to run the same thing for MSEG now and I am sure you are expecting 55 here as well. Right?
Oops!. It shows 0. So it is clear that we don’t have any entries in MSEG in HANA database. It just simply
points towards MATDOC internally when you run through SE16N. How is it doing & how do we know that?
This is an important screenshot taken from transaction SE11. Go to Extras menu for table MSEG and you will
see these details.
SAP has introduced a concept called ‘Replacement Object’ where a CDS view name is mentioned. Earlier,
this was called as Proxy object till 1709 version and it looks like SAP has renamed it as ‘Replacement Object’
to avoid any confusion because of the word ‘Proxy’.
For MSEG, NSDM_E_MSEG is shown as replacement object. So when you access MSEG either in SE16N or in
your custom program, SAP routes the logic through this CDS view which gets the data from MATDOC. You
can see the logic in the below screenshot.
Give CDS View NSDM_E_MSEG in view name in SE11. You will get the below details which gives
the DDL de nition name and the DDL SQL view name (NSDM_V_MSEG) also.
View NSDM_V_MSEG in SE11 clearly shows that it gets the data from MATDOC.
Last part in the DDL de nition talks about any custom elds or appended elds and how this is handled in
these replacement objects. You need to use Extend view and append the custom elds in Eclipse editor.
Please note that you don’t have the replacement object available for all replaced tables in S/4 HANA. This
concept is di erent for each table and above explained steps are speci c to MSEG/MATDOC. Replacement
object/Proxy object concept was mainly introduced to avoid confusions/changes in custom programs
which deals with MSEG. So if a custom program does a select from MSEG, it will still work similar to what we
saw in SE16N screenshot above.
Hope this blog helped to clarify some of the doubts related to MSEG/MATDOC tables.
Alert Moderator
Assigned tags
View more...
Related Questions
MATDOC table
By Former Member , May 08, 2016
6 Comments
Michelle Crapo
Another fun trick is doing a where-used on the table for DDL Sources. That will show you some nice CDS
views over the table. Not all of them have it. MSEG does not, but NSDM_V_MSEG does have CDS views.
Very cool. One that I need may already be there.
Like (3)
Gokul Radhakrishnan
Like (1)
Like (1)
abilash n
Like (0)
Shubhangi Deshmukh
Like (0)
There’s a customer that says he has the S/4HANA but doesn’t have the MATDOC.
Do you know the SAP Note number, or SAP component release version, that is the minimum version to
have this ?
Like (0)
Share & Follow
Sitemap Newsletter