8 Replies Latest reply: Sep 29, 2015 7:18 AM by Warren Burns RSS

Determining the Batch Class of a Material

Jim Sharkey
Currently Being Moderated



I'm trying to programmatically determine the batch class name for a given material.  I thought the table to use was KSSK.  When I query that table with a material number and class type 023, I get an internal class number.  From there I query KLAH with the internal class number expecting to see the class name that is showing on the classification view of the material master, but instead I see a different class name.


Does anyone know what I am doing wrong?


Thanks in advance for any help you can provide.


-Jim Sharkey

  • Re: Determining the Batch Class of a Material
    Ashok Kumar P
    Currently Being Moderated


    Did you check the table: AUSP, as this may be relevant for your requirements.





  • Re: Determining the Batch Class of a Material
    Jim Sharkey
    Currently Being Moderated

    Thanks for the quick response, but AUSP only holds the characteristics and there values for a given object.  It does not contain any reference to the batch class name or it's associated internal number.

  • Re: Determining the Batch Class of a Material
    Jim Sharkey
    Currently Being Moderated

    Thanks, but ATINN is the internal CHARACTERISTIC number, not the CLASS number.  Characteristics are created independently and can be assigned to multiple classes.

  • Re: Determining the Batch Class of a Material
    David Andrewlavage
    Currently Being Moderated

    Hello Jim,


    Were you ever able to find out which table stores a Materials batch class assignment?


    I've been querying KSSK with which many articles seem to point to using OBJEK = MATNR (material #) and the only results I get are the materials 'Material Class' assignment. No entries whatsoever for KLART (Class Type) 023.


    I'm not sure where I can find this, but the Batch Class assignment (023) entry clearly displays on the Material Masters Classification View (MM03-Classification).



  • Re: Determining the Batch Class of a Material
    Richard Hankins
    Currently Being Moderated

    Hi all,


    The table that I believe that you are looking for is INOB.


    Within INOB, specify 023 for field KLART and MARA for field OBTAB.  The field OBJEK with contain your material number.

    The field CUOBJ will contain a key that can link back to table KSSK to field OBJEK.


    From there, table KSSK contains the link to KLAH to get your class name.


    I hope this helps.





  • Re: Determining the Batch Class of a Material
    Warren Burns
    Currently Being Moderated

    Hi - this is a reply to quite an old post, but I figured out a slightly more elegant way to get what you want, using function modules rather than table lookups (puts the onus slightly more on SAP).  Any hoo - here's what I did:


    Use FM CLAF_CLASSIFICATION_OF_OBJECTS but I set the arguments in a slightly odd way... and it worked.


    CLASSTYPE = "022" (or "023" in your case)

    OBJECT = <18-digit Material Number and that is all - nothing else appended or concatenated>



    The FM returns a list of the classes in T_CLASS, and a list of characteristics for those classes in T_OBJECTDATA.  The "tabix" field of a given row in T_OBJECTDATA relates to the class row in T_CLASS.


    In this case, I suppose because the the ClassType = 022, it is returning the Batch Class to use for the Material.


    Soooo... you can either loop through T_CLASS and find your class name, or if you know a characteristic of the class you could find the characteristic in T_OBJECTDATA and work backwards through "tabix" to get the row in T_CLASS.



    If you set

    CLASSTYPE = "022"

    OBJECT = <Concatenation of 18-digit Material Number, Plant, Batch Number, etc.>




    It would return the same data for you... AS LONG AS the Batch has already been classified!  But what if the batch has not yet been classified?  In that case, this second approach fails with a hard exception that the object is not yet classified.



    If, on the other hand, you set

    CLASSTYPE = "001"

    OBJECT = <18-digit Material Number>



    Then it returns the classes for the Material itself.


    Hope that helps someone.