How To Find A Check Table in LSMW
It is always preferable to identify invalid data during the conversion step rather than during the load, but it isn't always obvious when a database table is being used by SAP to perform validation; SAP will reject data to be loaded in a transaction if it does not exist in the check table for domain from which the field comes.
There is an easy way in LSMW to determine what table is behind the check routine and then to write a snippet of code for validation, but more on that later (scroll down if there is no access to SE80). The preferred way to find a check table is by using SE80 to view the field in the ABAP Dictionary.
Start by launching SE80 and clicking the "Repository Information System" then drill down to ABAP Dictionary→Table Fields. Populate the field to be viewed and a table if it is known where the data to be loaded will go. Press F8 to go to the next screen.
Next, double-click on the table name, then double-click the name of the field in the "Fields" tab, then double-click on the Domain in the "Data Type" tab. The check table that SAP validates values against is in the "Value Range" tab.
For those with no access to SE80 . . .
Select the field to that needs validation and press the button. A warning may appear that explains the mapping may be deleted, but it is okay to ignore that message and proceed by clicking the "YES" button. After that a box from which to select a value will appear depending on the field that is being assigned a constant value.
Press "F4" or click the button next to the field for a list of available options. A new window with available options will appear. Click on one of the options and then press "F1" for the Performance Assistant. Click the "Technical Information" button () and the next window will have information about the check table behind field that SAP uses to validate the data.
Use the check table information to develop a custom snippet of code to validate the field during the conversion step. It should include a step to populate the target field with the source data and an action to take if the field value is invalid. In this case a warning is given as part of the conversion report and the entire transaction is skipped. The report is enriched with as much information as possible to facilitate the correction by the team performing the transformation on the data including the related material and plant values, the invalid data and even the field name.