Vous êtes sur la page 1sur 7

Products

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

S/4 HANA : MSEG or MATDOC Where is my data going?


Follow RSS feed Like

16 Likes 2,515 Views 6 Comments

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

SAP S/4HANA | MM Purchasing | abap | MATDOC | mseg |

View more...

Related Blog Posts


Key di erences between SuiteonHANA(SoH) & S/4 HANA Inventory Management Data models
By Former Member , Jun 03, 2016

Architecture Of S/4 HANA vs ERP


By KIRAN KUMAR VADREVU , Nov 06, 2015

S/4 Hana – My understanding


By Sumit Ghanty , Jun 21, 2015

Related Questions

SAP ERP6 TABLES and S/4 HANA


By Jonny Wellard , Jul 18, 2019

append structures s/4 upgrade


By Glenn Karlsson , Oct 25, 2016

MATDOC table
By Former Member , May 08, 2016

6 Comments

You must be Logged on to comment or reply to a post.

Michelle Crapo

May 9, 2019 at 12:32 pm


Great blog!!!  Let me tell you it took me more than a couple of hours to gure that one out.

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

May 13, 2019 at 3:49 am

Thanks Michelle and thanks for sharing.

Like (1)

Prasenjit Singh Bist

May 13, 2019 at 10:02 am


Nice blog thanks

Like (1)

abilash n

May 16, 2019 at 9:00 am


Nice Finding Gokul and thanks for sharing it…

Like (0)

Shubhangi Deshmukh

June 20, 2019 at 9:34 am


very good blog.

Like (0)

Arthur Alves Teixeira

July 26, 2019 at 7:01 pm


Hi Gokul,

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

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Sitemap Newsletter

Vous aimerez peut-être aussi