07-22-2008 1:49 PM
Hello,
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
07-22-2008 2:02 PM
Hi,
Did you check the table: AUSP, as this may be relevant for your requirements.
Regards,
Ashok
07-22-2008 2:21 PM
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.
07-22-2008 2:33 PM
Hi,
AUSP should be the appropriate table and ATINN is the internal class number field which u need to pass to the table KLAH.KLART is the class type here.
Hope that this should be helpful.
Regards
Zarina
07-22-2008 2:39 PM
Thanks, but ATINN is the internal CHARACTERISTIC number, not the CLASS number. Characteristics are created independently and can be assigned to multiple classes.
07-22-2008 3:22 PM
Hi there
KSSK ===> with classtype 023 (batch) as minimum
SWOR using the internal class number from KSSK.
You might need in the KSSK lookup to also set the Object type to restrict search.
Cheers
Jimbo
11-19-2010 4:12 PM
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).
Thanks!
01-04-2011 5:39 PM
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.
br,
Richard
09-28-2015 10:52 PM
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>
OBJECTABLE = "MARA"
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.>
OBJECTTABLE = "MCHA"
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>
OBJECTTABLE = "MARA"
Then it returns the classes for the Material itself.
Hope that helps someone.