Professional Documents
Culture Documents
Material Number Ranges and Formatting
Material Number Ranges and Formatting
Formatting
Technical Solution Guide
SAP and R/3 are the trademarks or registered trademarks of SAP AG in Germany and in several other countries.
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
6/19/2005
Page 2 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 3 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 4 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 5 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 6 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 7 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Notice that the interval range contains leading zeros. This explains why zero filled
material numbers exist even though the MATNR domain is defined as a character type.
6/19/2005
Page 8 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Table TNRGT
6/19/2005
Page 9 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 10 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 11 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Transaction OMSL is used to access table TMCNV, which is the configuration table that
contains control settings for formatting the material number.
6/19/2005
Page 12 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 13 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 14 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
CONVERI
ON_EXI
T_+Conve
r
s
i
onr
out
i
nena
me+
_I
NPUT
CONVERI
ON_EXI
T_+Conve
r
s
i
onr
out
i
nena
me+
_OUTPUT
6/19/2005
Page 15 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Function CONVERSION_EXIT_MATN1_OUTPUT
Converts the external material number to the internal format. The logic flow is as
follows:
Calls customer function 901 if it exists.
Reads table TMCNV and formats the number based on the settings in the table.
Calls customer function 902 if it exists.
6/19/2005
Page 16 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Business Requirement
The customer wants to display the material using the format xxxx-xxx-xx.
Solution
To solve this problem, standard configuration will be used to add an edit mask to the
material number.
6/19/2005
Page 17 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Using transaction OMSL, the edit mask is specified in the material number template
field.
6/19/2005
Page 18 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 19 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Using transaction SE16, two MARA records are displayed. The conversion exit does not
execute until the record detail is displayed. The material number internal format has not
changed. It is still eighteen bytes, zero filled.
6/19/2005
Page 20 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 21 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Business Requirement
The customer uses material numbers that are either six or seven bytes long. They always
want seven bytes displayed, even if the actual number is six bytes long. For numbers that
are six bytes long, they want a leading zero to display.
Solution
To solve this problem, we will add logic to zero fill six byte numbers (to seven bytes)
when outputting the material number. This logic will be added to customer function 902
in the output conversion exit of the material number
(CONVERSION_EXIT_MATN1_OUTPUT).
It is assumed that the reader understands the CMOD/SMOD enhancement concept.
6/19/2005
Page 22 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
The output conversion exit for material numbers contains two customer function calls.
Function 901 is called at the beginning of the logic and function 902 is called at the end,
just before the exit. For this project, we will use function 902.
Tona
vi
ga
t
ei
nt
ot
hec
us
t
ome
rf
un
c
t
i
on,doubl
ec
l
i
c
kont
hef
unc
t
i
onna
me
902
.
6/19/2005
Page 23 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
The customer function does not contain any code, only an INCLUDE. The actual code
will be added to the INCLUDE.
Double click on t
hei
nc
l
udena
meZXMG0U11.Thes
y
s
t
e
mwi
l
lr
e
s
pondwi
t
h
I
nc
l
ude
ZXMG0U11doe
snote
xi
s
t
,Doy
ouwi
s
ht
oc
r
e
a
t
ei
t
.Youne
e
dt
og
ot
hr
ut
henor
ma
l
steps to create the INCLUDE, assign a transport request, etc.
6/19/2005
Page 24 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 25 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
The logic is added into the INCLUDE. This logic is quite simple. We check the length of
the material number. If it is six bytes long, a single leading zero is added.
6/19/2005
Page 26 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
For standard customer functions, there will be an existing enhancement. It can be found
using the search tool in transaction SMOD.
6/19/2005
Page 27 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 28 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 29 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Using transaction CMOD, create a customer specific project. Customer specific projects
mus
tbe
g
i
nwi
t
ht
hel
e
t
t
e
r
Z
.
6/19/2005
Page 30 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
One or more enhancements (SMOD) can be assigned to a project. In this case, we will
assign the standard material number enhancement.
6/19/2005
Page 31 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
On the main screen of transaction CMOD are the activate/deactivate buttons. The project
must be activated from this screen.
6/19/2005
Page 32 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
Using transaction SE16, two MARA records are displayed. The conversion exit does not
execute until the record detail is displayed. The material number internal format has not
changed. It is still eighteen bytes, zero filled.
6/19/2005
Page 33 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 34 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com
6/19/2005
Page 35 of 35
Copyright 2005 The Smith Consulting Group, Inc. All Rights Reserved.
SAPtechsolutions.com