You are on page 1of 4

1.

SAP Master Data Management


2. SAP Master Data Management
3. MDM Content and Processes

Issues in fetching internal characteristics of materials

Skip to end of metadata


Page restrictions apply
Added by Guest, last edited by Michael Theis on Feb 18, 2010 (view change)
show comment
Go to start of metadata

Introduction:
An internal characteristic is something pertaining to, constituting, or indicating the character or peculiar quality of a particular
Material. Characteristics allow to attach attributes to a material, routing, a work center, a batch or an order. It becomes a
legal requirement sometimes to fetch values of these internal characteristics. This document explains how to fetch the
internal characteristic values and gives an insight into some flaws that occur during these kinds of developments.
Internal characteristics:
Internal characteristics are defined inside a class. Classes are created in the transaction CL01 based on a class type. These
classes are then attached to the materials in material master. A list of these class types can be seen in the table TCLA.
Brief overview: Characteristic must be assigned to a class in order to use them in any SAP application. The usage of the
characteristics is defined by the class type, though the same characteristic can be assigned to different classes of different
class types. The interdependency can be explained by the following diagram.
Example:
Class type description Type
- Material Class 001
- Batch 023
- Material (Configurable Objects) 200
- Variants 300

The data base tableCABNstores all the characteristics.


Every characteristic has an internal characteristic number
(ATINN) assigned.
Let us take an example of a material 503800 A.
The characteristic values for the material are maintained in the material master as shown.
These are the material characteristics(classtype as 001(material class)),which are maintained at material level.
The characteristics descriptions that are shown in the above screens shot are just the descriptions, the actual name of the
characteristic can be viewed from the transactionCL03 (display class)as shown.
If the requirement calls for fetching these characteristics, then one must know the name of these characteristics to fetch the
value of the characteristic. The table AUSP has the values of the internal characteristic of a material. The table AUSP has
the following fields.
WhereOBJEKis the material for which the characteristic value has to be fetched.

ATINN(Internal Characteristic) is the internal characteristic number.


MAFID('O' for object and 'K' for class).
The basic logic for fetching the material characteristic is that fetch the characteristic value (ATWRT) from tableAUSPbased
on atinn, mafid and klart for a particular material(OBJEK).
As shown in the first screen shot the field class type (KLART) can be known, and the field
Indicator: Object/Class (MAFID)is 'O'.ATINN(internal characteristic) can be fetched from the tableCABN.
i.e. pass the Characteristic Name(ATNAM)and fetch Internal characteristic (ATINN).
So the developer may be in a view to pass directly theATINNvalue fetched from CABN to the AUSP table.
The value will be fetched and one can retrieve it correctly with the ATINN NUMBER butonly in a particular system(dev
system), unfortunately this solution won't work when transport requests for the code will be moved to next system (quality
system).
To explain it clearly from my project experience.
Say the development takes place in system 'X' -development system and it has been moved to the quality system 'Y'.Since
the same material is maintained in both the systems, in real scenarios the value of ATINN does change across the
systems.i.e the value of ATINN may change as shown in the following diagram.
1) The value of atinn after passing characteristic name (ATNAM) in system' X' is '912'.
2) The value of the atinn after passing the same characteristic name in system'Y' is '832'.
If the development considers the values obtained fromCABNdirectly i.e. directly passing the atinn values to the AUSP table.
It works fine in the system'X'.
Wrong select query: considering the same material '503800 A' and fetching the characteristic value.
SELECT objek (material)
atinn (Internal characteristic)
atwrt (Characteristic Value)
FROM ausp
INTO TABLE it_char(internal table to store the characteristics)
WHERE objek = '503800 A' AND
mafid = 'O' AND
klart = '001' AND
atinn = '0000000912'.
It will give you sy-subrc = 0 because for system 'X', '0000000912' is correct value.
Note: This is an example to fetch the characteristic value for a single material, the actual requirement may call for fetching
the characteristic value for multiple materials.
If the same select query is written in system 'Y', it will result in sy-subrc = 4 or may fetch a wrong value because the ATINN
value (generated insystem'Y') is different from ATINN that is generated in system 'X'i.e the code either fetches a wrong
value or doesn't fetch a value at all.
To say clearly the system fetches a wrong value when the hard coded no (ATINN) is associated with some other
Characteristic and it doesn't fetch a value when the hard coded no (ATINN) is not associated with any other characteristic.
This has been a practical problem in many cases..
To avoid such cases of failure because of change of data across the systems, it is always advised to fetch the value ATINN
firstly from CABN and then pass this ATINN to the table AUSP instead of directly passing the hardcoded values .This makes
sure that the characteristic value is fetched correctly irrespective of the System.
Rightselect query: considering the same material '503800 A' and fetching the characteristic value.
SELECT atinn(Internal characteristic)
atnam(Characteristic Name)
FROM cabn
INTO v_atinn(variable to store the ATINN value)
WHERE atnam = "name of the characteristic for which the ATINN is required"

SELECT objek (material)


atinn (Internal characteristic)
atwrt (Characteristic Value)
FROM ausp
INTO TABLE it_char(internal table to store the characteristics)
WHERE objek = ' 503800 A' AND
mafid = 'O' AND
klart = '001' AND
atinn =v_atinn.
Alternatively one can also use the function module "CONVERSION_EXIT_ATINN_INPUT"
to fetch the characteristic value (ATINN) value passing the characteristic name(ATNAM) and then passing this ATINN to
AUSP.
This function module (CONVERSION_EXIT_ATINN_INPUT) also uses the logic of fetching the ATINN from the database
table CABN.
CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'
EXPORTING
input = "name of the characteristic for which the ATINN is required"
IMPORTING
output = "v_atinn".
SELECT objek (material)
atinn (Internal characteristic)
atwrt (Characteristic Value)
FROM ausp
INTO TABLE it_char(internal table to store the characteristics)
WHERE objek = ' 503800 A' AND
mafid = 'O' AND
klart = '001' AND
atinn =v_atinn.
Note: This is an example to fetch the characteristic value for a single material, the actual requirement may call for fetching
the characteristic value for multiple materials.
Tables used in developments related to internal characteristics of the Materials.
1.Characteristics:
CABN Characteristics
CABNT Characteristic Descriptions
CAWN Characteristic values
CAWNT Value Texts
AUSP Characteristic Values
2. Class types andobjects:
TCLAO Several Objects in one Class Type
TCLA Class types
TCLAT Class Type Texts
TCLT Classifiable objects
TCLC Classification status
3.Links:
INOB Link between Internal Number and Object
KLAH Class Header Data
KSSK Allocation Table: Object (matnr) to Class
KSML Characteristics for a class (internal number)

---If you have an interval, then you need to look at field ATFLV and ATFLB instead of ATWRT
---Hi,
Unlike the other characteristics, the interval values wont be updated in the characteristic value field
(ATWRT). The interval values will be updated in the AUSP table in the fields ASUP - ATFLV (Value From)
and AUSP - ATFLB (Value to). For example,
Here, ASUP - ATFLV = 5.00E+02 means value is 5 x 10^2 = 500
ASUP - ATFLB = 1.00E+03 means value is 1 x 10^3 = 1000
Refer the KBA: 1568641 - How are the values for the different Characteristic Data Types saved in the
table AUSP ? for more details.