Sy SAP Note
2206980 - Material Inventory Managment: change of data model in S/4 HANA
Component: MM-IM-GF (Materials Management > Inventory Management > Basic Functions), Version: 20,
Released On: 20.05.2022
| Symptom
‘You want to install SAP S/4HANA and need additional information how to adjust your customer enhancements,
modifications or own functionalities to the new, simplified data model of SAP S/4HANA Supply Chain (MM - Inventory
Management)
You want to have information about what is diferent in SAP S/4HANA Supply Chain (MM - Inventory Management)
compared to Suite on HANA MM-IM.
| Other Terms
SATC,$/4 transition, MMM, Meterial Management
| Reason and Prerequisites
‘You have customer enhancements, modifications or own functionalities in the area of inventory management (component
MM-IM) which were built for SAP ERP 6.0.
You are using functionalities which behave different in SAP S/4HANA Supply Chain (MM - Inventory Management)
compared to Suite on HANA.
‘The SAP ERP 6.0 stock inventory management data model consists of the two document tables MKPF for document header
information and MSEG for document item data, Additionally there were aggregated actual stock quantity data stored
several tables. Some of these tables do also store material master data attributes like the tables MARC, MARD and M
Such tables with material master data attributes as well as actual stock quantities will be named as hybrid tables in the
following. In contrast there are also tables like MSSA containing only aggregated actual stock quantities for sales order stock.
Such tables will be called in the following as replaced aggregation tables.
\Wih Si4HANA this data model has been changed significantly. The new de-normalized table MATDOC has been introduced which contains the former
header and item data ofa material document as wall as alot of further atibutes, Material document data willbe stored in MATDOC only and not anymore
in MKPF ang MSEG. Adctonaly the aggregated actual sock quantities will not be persisted anymore in the hybrié or replaced aggregation tables. Instead
actual stock quantity deta will be calculates or-he-y from the new material document table MATDOC for which some of thase adetonal special elds are
used. Hence, with the new MMM data model he system wil work on database level in an INSERT only made without DB locks. Nevertheless, for stock
decreasing processes there wil be sill ABAP lcks io ensure stock consistency. further advantage of the new MMM data models the capably of
simple and fast reporting because the most information i ll one place: MATDOC.
[All below mentioned tables ofthe SAP ERP 6.0 produc do sl exist n SHANA a8 DDIC defntton as well as database abject anc the hybrid tables wl
stl be used to store the material master data atvbutes. For compatbily reasons there are Core Dala Service (CDS) Views assigned as proxy objects to
al those ables ensuring that each read access o one of the montoned tables below sl returns the data as before in SAP ERP 6.0. The CDS Views do
the onnely aggregation of actual stock quantities frm the new MMM data model and jin the master data attibutes from the material master data
table. Hence a customer coding reading data from those tables wil work as before because each read access to one of he tables wil get redirected inthe
database inorace layer of NetWeaver tothe assigned CDS view: Write accesses to thase tables have tobe adjusted
The affected tables are
Table description
Tabi DDL Source of CD Viewto read the content of the database View to road the mast
e S View for redirect table (w/o redirect to compat w) er data attributes only
MKP Material document header NSDM_DDL_MKPF —NSDM_MIG_MKPF :
FMSE
MAR
MAR
Me
HB
MK
Oo
MSL
Ms
Mss
MsP
Mss
Mss
Msk
MsT
MsT
MsT
Mes
Mes
Msc
Msc
MSF
MSF
Msi
Material document item
Plant Data for Material
Storage Location Data for
Material
Batch stocks
Special Stocks from Vend
Special Stocks with Vendo
Sales Order Stock
‘Total Customer Orders on
Hand
Project Stock
‘otal Special Stocks with
Vendor
Project Stock Total
Special Stocks with Custo
Stock in Transit
Stock in Transit o Sales a
rid Distribution Document
Stock in Transit for Project
DIMP: Customer Stock
DIMP: Total Customer Sto
DIMP: Customer stock wit
h vendor
DIMP: Customer stock wit
h vendor - Total
DIMP: Sales Order Stock
with Vendor
DIMP: Sales Order Stock
with Vendor - Total
DIMP: Vendor Stock with
Vendor
NSDM_DDL_MSEG
NSOM_DDL_MARG
NSOM_DDL_MARD
NSOM_DDL_MCHE
NSOM_DDL_MKOL
NSOM_DDL_MSLB
NSOM_DDL_MSKA,
NSOM_DDL_MSsA
NSDM_DDL_MSPR.
NSDM_DDL_MSsL.
NSOM_DDL_MSsa
NSOM_DDL_MSKU
NSOM_DDL_MSTB
NSOM_DDL_MSTE
NSOM_DDL_MSTQ.
NSOM_DDL_MesD
NSDM_DDL_Mcss
NSOM_DDL_MscD
NSOM_DDL_Mscs.
NSOM_DDL_MSFD
NSOM_DDL_MFS
NSOM_DDL_MSID
NSDM_MIG_MSEG
NSOM_MIG_MARC
NSOM_MIG_MARD
NSOM_MIG_MCHB
NSOM_MIG_MKOL.
NSOM_MIG_MSLB
NSOM_MIG_MSKA,
NSOM_MIG_MSSA
NSOM_MIG_MSPR
NSOM_MIG_MSSL
NSOM_MIG_MSsQ
NSOM_MIG_MSKU
NSOM_MIG_MSTB
NSOM_MIG_MSTE
NSOM_MIG_MSTQ
NSOM_MIG_McsD
NSOM_MIG_Mcss
NSOM_MIG_MScD
NSOM_MIG_Mscs
NSOM_MIG_MSFO
NSOM_MIG_MSFS
NSOM_MIG_MSID
\V_MARC_MD
\V_MARD_MD
\V_MCHE_MD
\V_MKOL_MD
V_MSL8_MD_
V_MSKA_MD
V_MSPR_MD
V_MSKU_MD
Mcsp_MD
Mcss_MD
MscD_MD
Mscs_MD
MSFD_MD
MSFS_MD
MsID_MDMsi
MSR
MSR
MAR
cH
MAR
DH
Mc
HH
MK
oun
st.
8H
MsK
AH
Mss
AH
MsP
RH
Mss
aH
Msk
UH
MsT
BH
MsT
EH
MsT
aH
Mes
DH
Mes
SH
Msc
DH
MSF
DH
Msi
DH
MSR
DH
DIMP: Vendor Stock with
Vendor - Total
DIMP: Project Stock with
Vendor
DIMP: Project Stock with
Vendor - Total
History
History
History
History
History
History
History
History
History
History
History
History
History
History
History
History
History
History
History
NSDM_DDL_MsIS
NSOM_DDL_MSRD
NSOM_DDL_MSRS.
NSOM_DDL_MARC
H
NSDM_DDL_MARD
H
NSOM_DDL_MCHB
H
NSOM_DDL_MKOL
H
NSOM_DDL_MSLB.
H
NSDM_DDL_MSKA.
H
NSDM_DDL_MSsA
H
NSOM_DDL_MSPR
H
NSOM_DDL_MSsa
H
NSOM_DDL_MSKU
H
NSOM_DDL_MSTB
H
NSOM_DDL_MSTE
H
NSOM_DDL_MSTQ
H
NSOM_DDL_McsD
H
NSOM_DDL_Mcss.
H
NSOM_DDL_MscD
H
NSOM_DDL_MSFD
H
NSOM_DDL_MSID
H
NSDM_DDL_MSRD
H
NSDM_MIG_MSIS
NSOM_MIG_MSRD
NSOM_MIG_MSRS
NSOM_MIG_MARCH
NSOM_MIG_MARDH
NSOM_MIG_MCHBH
NSOM_MIG_MKOLH
NSOM_MIG_MSLBH
NSOM_MIG_MSKAH
NSOM_MIG_MSSAH
NSOM_MIG_MSPRH
NSOM_MIG_MSSQH
NSOM_MIG_MSKUH
NSOM_MIG_MSTBH
NSOM_MIG_MSTEH
NSOM_MIG_MSTQH
NSOM_MIG_MCSDH
NSOM_MIG_MCSSH
NSOM_MIG_MSCDH
NSOM_MIG_MSFDH
NSOM_MIG_MSIDH
NSOM_MIG_MSRDH
MSIS_MD
MSRD_MD
MSRS_MD‘The hybrid tables of the formor Industry Solution DIMP have now new tables containing the material master data only. The name of the new tables is
presented in the rght column of above table,
‘According to the fact that data wil not pesised anymore in the header and item tables MKPF and MSEG the transaction DBS behaves aiferenty inthe
ceavronment of archiving,
Transaction DBS, which allows the revioval of statistical data for DB tabs grouped by the archiving objects that refer to these tables, doesnot provide
correct information for tables MKPF and MSEG. When selecting tables from which data is archived for archiving object MM_MATBEL, and navigating to
“Onin Space” or "Space Stasis” fr tables WKPF or MSE, the statistics “No. Records" and "Table Space” are shown inthe resul screen, These
rnumbers ae taken from the orignal ables MKF and MSEG, and not calculates by redirecting the -equest fo lable MATDOC. Consequently, when
‘executing archiving for arching object MM_MATBEL, this wil hve no fect on the numbers shown for tables MKPF and NSEG in transaction DBS.
‘Some ofthe hybrid tables contain a feld wih the semantic “date of last change" (in many cases fleld name Is LAEDA). Inthe ERP solution this ld has
eon updated with each material document posting. With the introduction ofthe new data model in S/4 the hybrid tables wil nol be updated with actual
sock data anymore and als the eld LAEDA will ot be updated. Hence, te Semantic ofthis fel forthe matorial maser data hybrid tables changos to
"date oflast change of master dat’.
I Solution
(One impact of the simplified MM.IM data model does exis if there ae customer APPENDS or INCLUDES with customer fells onthe mentioned tables, The
‘NetWeaver redirect capability requires that DB table and assigned proxy view is compatible inthe structure: numberof field, ther sequence ane ther ‘ype.
Thus there is an APPEND or INCLUDE on one of the above mentioned tables then the assigned DDL. source ofthe CDS view must be made compabble
In some cases for SiAHANA on-premise 1511 this does not require customer interaction especialy in those cases were the append nas been put atthe
‘end ofa table which Is strongly recommended (not somewhere between which may happen fa table Is composed by Include structures tke fr MARC),
For other casos and In gonoral for S/4HANA on-premise 1610 th structure of tho proxy view can be made compatblo tothe table by extension view. This
‘extension view is alvays an extension to the above mentioned view in the DDL. sauce of te CDS view used fr ree. nthe extension view the lds
have tobe Istod In exact the same order as inthe append. For more information about view extension sv0 0.9, SAP NotWeaver 7-4 documentation.
Another impact ofthe simplified MMLIM data models performance decrease of DB read operations on the above mentioned tabes just becouse a data
fetch on one ofthe mentioned tables in SI4HANA slower than in SAP ERP 6.0 due tothe onthe-ly aggrogation an the JOIN operation. Hence
performance crieal customer coding may be adjused to improve perfomance, Furhermare customer casing wring data fo aggregated actual stock
‘quanti oto the former document header ol table shall be adjusted!
41, Customer Apponds
With SAP Note 2184818 and 2187982 SAP offers a check tobe executed on te start release to dently APPEND issucs described in the following sub
chapters, Hence customer i nat forced to scan all above sted tables manually
1.4 Customer Apponds on the former document tablos MKPF and MSEG
It thorw aro APPENDS on MKPF and MSEC whore elds wih the same fldname do exist thon there fs @ namo confetn ease that the conto of fla
MAPE-Ais diferent ftom feld MSEG-A (felds with same name and identical contnt do exist on MKPF and MSEG also in SAP Standard for performance
reasons 0.9. BUDAT), In this case tis requited to adda further fil A_ NEW to te append, copy the data from Ato A_NEW with a special customer
program and then all coding sections, Dynoros, et. need to be adjusted to use A_NEW and then fel! Aneeds tobe dropped trom the append. This must
bbe done befoe migration fom ERP 6.0% S/BHANA.
Ifthe attributes in the APPEND or INCLUDEs (e.g, C|_M* INCLUDES as introduced with consulting note 996214) on table MKPF and MSEG do have a
‘master data o process contrling character then the feds from the APPENDsIINCLUDEs need fo be appended tothe table MATDOC and te assigned
proxy views can be made compatible via extension views.
In case of @ system conversion all these customer fils in such APPENDS or INCLUDES need tobe appended to table MATDOC curing the ACT_UPG
phase (SPDD). Ithas tobe dane in any case before the MMM converison program wil be executed which move the data from MKPF and MSEG to
'MATDOC otherwise data in customer feds gots lost. The structure compatbilty between table MKPFIMSEG and their assigned proxy view shall be
created direct after system conversion by creating extend views, soe note 2242679,
Flats from APPENDSINCLUDES to table MKPF should be appended to sub structure NSDM_S_ HEADER of table MATDOC.
Flas from APPENDSINCLUDES to table MSEG should be appended to sub structure NSDM_S_ITEM of table MATDOC.
444 Customer include Cl_COBL in table MSEG
Table MSEG contains the customer include Cl_COBL where customers can insert ovm fields. The Cl_COBL include has been made avaiable alo in the
ew MMLIM data model with note 2280878. This note must be applied before the data migration starts inthe ACT_UPG phase (SPDD); otherwise you may
loose data. With the implemented Cl_COAL the table MSEG and is assigned proxy view is rot compatble in thir structure anymore. The structural
compatbily can be re-created by apolying note 2242679, This must be done drectly after system conversion has been finshed.
¥ you later on tike to make vse of ane ofthe feds in EXTEND VIEW for CI_COBL inthe app “Custom fes an logic” then you need to flaw the
Instructions given inthis article inthe SAP Hele paral. Basically you need fo remove te fd from the EXTEND VIEW for Cl GOBL. save without activate
‘and then add the field inthe app °Custom fds and logic". This is valid for release 1709 and higher.
112 Customer Apponds on the hybrid and replaced aggregation tables
12.1 Fields containing material mastor data attributes
It the append is nota the end of he hybrid table then the append should be movee tothe end f possible an then no futher action fs required bacause the
alvered DDL sources forthe proxy views provide the SEXTENSION feature within SIMMANA on-premise 1511, Dus to too many side effects ike
Unpredictable sequence of flds rom APPENDs, this has bean changed with Si4HANA On-Premise 1610 where always an EXTEND VIEW for a COS
proxy view has tobe created for an APPEND on a material master data table. For the DIMP tables the append has tobe appended also ta the new pureDIMP material master data tablos.
Te structural compatibility between ible and COS proxy view canbe re-created by applying note 2262879, This must be done drecty afer system
conversion has been fished (e.9 featng just an EXTEND VIEW wit the customer fds using ABAP Development Tools for SI4HANA On Premise 1610
and higher.
For eplaced aggregation tables appends with master data atrbules ae not supported. I such appends ae realy required inthe cuslomer processes then
the approach deserved in te nex! chapter maybe feasible nthe ore funetionaliy of material dacument processing there wil be no wile process on
those tables. Thus update of th fds in te appends requires maybe some additonal customer coding.
1.22 Fields representing a customer defined stock type or quantityivalue to be aggregated
HY own stock ypes ora cimension which needs tobe aggregated have been introduced by the customer ten the view stack of the COS view assigned to
the table withthe addtional tock type needs to be macted, Right now, there Is no technology support for madificaton free enhancement, If the stock ype
has not been introduced by new enties or eninancements inthe tables T158x (T15S, T1SSSY, TISBM, T1SEF) - which controls inthe core functionality the
‘mapping between a posting and a stock typo - then the process logic needs lo be adaptog
1. Customer Appends on views
‘There are several views in SAP Standard which also do have an assigned proxy view because the view provide actual stock quanty data. View and
assigned proxy view must be compatible in structure too. If there are customer appends on such view the same rules as fr tables apply. Views with
assigned proxy compatiilly view can be detormined by searching via ransacton SE16N in table DDO2L with TABCLASS = VIEW and VIEWREF <>" or
you may use above montiones check functonaly in you stat release.
4134 Customer views on MKPFIMSEG
Views are database objects and thus a view is executed onthe database. Because the table MKPF and MSEG willnat contain data arymor (except
legacy data rom migration) sucha custome view wil never tum any record. Such views have tobe ether adjusiod by fetching data from table MATOOC
or 1 be created new as DDL source witha diferent name, In the last case all sages ofthe old DDIC SQL. view must be replaced by the new CDS view,
412.2 Customer views on material master attributes
‘Such views using only material master data atvibutes from the hybrid tables do not need tobe changed,
13.3 Customer views using aggregated stock quantity data
CCusiomer views having a east one actual stock quanty aggregate cannot be used anymore because
+ the field representing his aggregate onthe database wll be empty forever
+ the quanity must be aggregated from table MATDOC which isnot possible wih DDIC SQL views.
‘Such views mast be defined new as DDL source wth a new name, Each ofthe above mentioned DDL sources can be used as template. Al usages ofthe
‘old DDIC SQL view must be replaced by the new CDS view.
2 Code adjustments and optimizations
Technical itis stil possible to do 08 wite cperatons (INSERT, UPDATE, DELETE, MODIFY) onthe tables MKPF, MSEG as well as the ils
representing actual stock quan in the hybrid and replaced aggregation tables. Sut such write operations are without any effect! Therefore write
‘operations an NKPF, MSEG as wel asthe felds representing actual stock quantities inthe hybrid and replaced aggregation tables shall be remaved fom
customer cocing, Wite operations on the material master data atibutes inthe hybrid tables are sUl possible. Write operations on table MATDOC ard your
‘moved customer append fields are dore by class CL_NSDM_STOCK.
1B read operations on the hybrid and replaced aggregation tables have a performance decrease. In general it shall be avoided to read any stock
{quantities when only master data is required. Therefore it's recommended to adjust the customer coding inte felling way:
+f material master dota as well s actual
tock quantity data are requir than the SELECT...
shouldbe replaced by using a data access
‘method from class CL_NSDM_SELECT_tale>. These class provide access methods for single as wel as aray read operations. Those access
‘methods shal not be used ifthe KEY table contains more than 1000 records to to limitations ofthe SELECT... FOR ALL ENTRIES,
+f matarial master data are required then the SELECT.
should be replaced by SELECT...V_
_MD where V_
_MDis one ofthe
‘ove mentioned views for mastr data access. Alteratiely corresponding material master data read methods inthe class
CCL_NSDM._SELECT_stable> can be used (those access methods shal not be used if the KEY table contains more than 1000 records to to
lations ofthe SELECT...FOR ALL ENTRIES.) Also the datatype declarations shouldbe acjusted from TYPE.
to
TYPE...V_stable>_MO.
+ If actual sock quantty data are required then the SELECT,..
should be replaced by SELECT. .NSDMLV_
_DIFF where
[NSDM_V_
_DIFF is one ofthe views inthe view stack of the above mentioned proxy View. Also the data type declarations should be adjusted
from TYPE... to TYPE. NSDM_V_
_DIFF
+ For table MARC and field STAWN valid fom SisHANA On Premise 1619 please read note #mee tame tit
For perlormance ertcal coding parts these adjustments are strongly recommended. For non ical parts itis oponal short term but recommended on long
term,
To dentty such locations, itis required to make use of he where-used funcionalty of ransacton SE and considering other techniques Ike transacton
(CODE_SCANNER tof oeatons which SE11 cannot handle = Ike dynamic programming e: naive SOL statements,
Consider SAP Note 28022 thre ave iss wth the whare.used functionally in the custome system. nthe wher-used dialog is posse via he button
"Search Range" to search specie for key words ko SELECT, INSERT and so on
| Attributes
Key ValueOther
‘Components
Materials Management > Inventory Management > Basic Functions > Migration to the new material document
data model (MM-IM-GF-MIG)
| Software Components
‘Software Component
S4CORE
S4CORE
| This document refers to
SAP Note/KBA.
2378796
2242679
2240878,
2197392
2194618
28022
From To And subsequent
101 x01 x
Component Title
SLL-LEG-FUN-CLS Material classification: Change in data model in SAP S/4HANA 1610
MM-IM-GE Redirect inconsistency - Proxy Substitution
MM-IM-GF
MM-IM-GF
MM-IM-GF
BC-DWB-UTL
| This document is referenced by
SAP
Note/KBA
2595627
3216468
2000002
3446808
3163754
3030981
3023744
2995838
2759888
2713495
2686694
2600991
2592627
2569435
2493434
2425478
2345668
‘Component
MM-IM-GF
HAN-DB-PERF
MM-IM-GE-BM.
MN-IM-GF
MOB-APP-MAO-
ERP.
‘MM-IM-GI
XX-CSC-RU-LO
MM-IM-GE-MIG
MM-IM-GF
MM-IM-GF
1S-ADEC-SUB
LO-RFM-PUR-
RRP
‘MM-IM-GF
‘MM-IN-GF-MIG
‘MM-IM-GF
1S-OIL-DS-HPM,
Title
‘Accessing table from Sii6/SEA6N shows different results to SAP HANA database
Procurement - Inventory Management - Standard behaviors guide and How-to scenarios
Runtime error DBSOQL ILLEGAL CLIENT SPECIFIED in program SAPLCORC
S/4HANA: History stock tables within the new data model for Inventory Manags
ment
Stock:
thange table is not getting updat
‘S42 sales order/project stock postings into non-valuated GR blocked stock - special stock fel
usage in table MATDOC
4 ARMOBVEDH Stock Overview (New), Issues after adaptation of the report tothe new Inventory
Management data model
chock performance: skip KALNR-cheeke
‘S/4HANA: Performance issues in cust
Increase Pi
1m code when using the obsolete stock data model
How-To: MSEG- DBSQL_ REDIRECT INCONSISTENCY
DI_PCS MRP: SHANA MM-IM data model in
RRP: performance of MARC access,
covements
‘Remove content from obsolete tables in MM-IM: Save DB memory and remove data that is not
covered by Information Lifecycle Management
Restriction note for inventory management data conversion
‘roxy substitution: Reset to SAP delivered proxy,
‘Resolve findings of ERP IS-OIL S/4HANA pre checks2319579
2236753,
2281657
2270451
2259038
2249800
2246602
vigrave
2242679
2238690
2197379
MM-IM-GF STI. - Performance optimizations within Material Document Processing - Jock behavior and
stock underrun protection
‘MM-IM-GF-MIG §/4HANA MM-IM migration: error, post-processing and info messages
MIG S/4HANA MM-IM migration by SUM with sMIG feature
MM-IM-GF MIM S/4HANA customer fields in MKPF or MSEG are not updated with
SANGRE, DOCUMENT: moc
‘MM-IM-GI
MM-IM-GI ‘S/4HANA: Partitioning of table MADOC
‘MM-IM-GF-
‘MM-IM-GF —_recompacting scheduling in case system performance gels slowed dawn during 2 posting period
MM-IM-GF Resolve findings of core ERP MM-IM $/4HANA pre checks
MM-IM-GF Redirect inconsistency - Proxy Substitution
MM-IM-GF-MIG $/4HANA MM-IM migration by SUM.
‘Resolve findings of DIMP epecific MM-IM S/4HANA pre checks
| Attachments
‘Name
Mime Type
SI1 Logistics MM_IM New Datamodel paf ugh application/pdf