Skip to Content

  

 

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.

image

Example:

Class type description                                 Type 

  • Material Class                           001
  • Batch                                       023
  • Material (Configurable Objects)   200
  • Variants                                   300

 

The data base table CABN stores 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.

 

image

 

These are the material characteristics (class type 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 transaction CL03 (display class) as shown.

 

 

image

 

 

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.

 

image”  

 

 

Where OBJEK is 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 table AUSP based 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 fieldIndicator: Object/Class (MAFID) is ‘O’. ATINN (internal characteristic) can be fetched from the table CABN.i.e. pass the Characteristic Name (ATNAM) and fetch Internal characteristic (ATINN). 

So the developer may be in a view to pass directly the ATINN value fetched from CABN to the AUSP table.The value will be fetched and one can retrieve it correctly with the ATINN NUMBER but only 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 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’.

image

 

 

 

2. The value of the atinn after passing the same characteristic name in system’Y’ is ‘832’.

 

 

image

 

 

 

 

If the development considers the values obtained from CABN directly 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 in system ‘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. 

Right select query: considering the same material ‘503800 A’ and fetching the characteristic value. 

SELECT SINGLE       atinn(Internal characteristic)
                            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 and objects:

  • 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)
To report this post you need to login first.

3 Comments

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

  1. Former Member
    Great summary!  Material characteristics are very important and often poorly “fetched”.  SAP has some standard function modules.  Perhaps as a follow-up you could post some functions or routines for the additional steps such as pulling in descriptions and handling multiple attributes?  I’ve done a lot of work on this with SAPLookup.  Characteristics are so powerful, yet awkward.  Google “SAPLookup” for more info…
    (0) 
  2. Former Member
    Hi,
      i must apprecite the content delivered in this blog it solves all the queries regarding the internal characteristics and classification part in all a must read blog.

    Regards
    Sumeet Malhotra

    (0) 
    1. Former Member
      This is a nice post to fetch the characteristics of a material . Suppose if a material have come characteristics ( hided in ct04 ) it will also displayed when we fetch in this way . Is there any option to fetch data how we can see in cu50 tcode.

      Regards,
      Madhu.

      (0) 

Leave a Reply