Update Characteristic Values with Transaction CL20

Jimbo's picture

The standard transaction for assigning classifications and characteristics to materials is CL20. The only way to run this transaction is in batch mode; SAP launches CL20N when CL20 is called from the command field.

The sole purpose of the CL20 transaction is to assign classifications and characteristics to materials that don't already have assignments to classifications of the same type. Materials can be assigned to multiple classifications of different classification types, but not to two classifications of the same type. Recent attempts to coax CL20 into removing classifications by checking the LKENZ field have proven unsuccessful.

Updating material master data using a recording is cumbersome to say the least and updating the characteristic values using a recording is nearly impossible. With a simple workaround the CL20 transaction can be tricked into updating characteristic values for materials that already have classification assignments.

Create an LSMW object using the standard transaction like this. Ensure that the method is set to 0001. Save it and then configure the structures and field names as usual.

In the Field Mapping and Conversion Rules section of the LSMW ensure that the KLART field is populated with the classification type of the classification that is to have its characteristics updated. Populate the OBJEK field from the source file, but leave the CLASS field blank while determining what Classifications the Material is already assigned to and validating Characteristics in the Classification.

When the transaction runs, it will attempt to add an additional line with with a blank classification which the system will promptly remove and demand that the cursor be moved to a valid line. At this point the cursor is already on a valid line and, when the Enter key is pressed, it goes right into editing the characteristics. The downside is that this batch will need to be run in foreground or in Show errors only using the coffee cup method.

It's simple enough to make the LSMW object that assigns classes to materials update classes with a snippet of ABAP code that leaves the CLASS, STATU and STDCL fields blank when the classification is already assigned to the material. A complete LSMW object for loading assigning Classifications to Materials is available here.
http://www.freeiconspng.com/uploads/document-extension-file-file-format-filename-text-txt-icon--20.png|http://freeiconbox.com/icon/256/28878.png|https://cdn2.iconfinder.com/data/icons/file-format-colorful/100/txt-128.png|https://cdn2.iconfinder.com/data/icons/designers-and-developers-icon-set/32/duplicate_file-512.png|http://www.freeiconspng.com/uploads/txt-icons-txt-icons--free-icons-in-file-icons-vs-13.png|https://cfpub.epa.gov/oarweb/mkb/graphics/TextFile.jpg|http://www.standard-icons.com/stock-icons/standard-toolbar/text_file-icon.gif|http://downloadicons.net/sites/default/files/txt-file-icon-64765.png|https://cdn3.iconfinder.com/data/icons/file-extensions/512/File_TXT-128.png|http://frc-events.usfirst.org/Images/FTC/textfile_icon.pngLSMW_SAPLSMW_AssignClassifications.txt