Sometimes it’s necessary to filter an inventDim record and only get the active product dimensions. This can be useful if you, for example, define additional data for an item and its product dimensions and have to call this data in a sales order line where the associated inventDim record also contains storage dimensions like site and warehouse.
In this case you want to strip out the unwanted dimensions from the inventDim record which you can do by using following code:
Basically you define a new inventDim buffer, transfer the data from your current inventDim record and find the active dimensions for the specific item. After that is done you can clear all dimensions which are not active and search for the correct inventDim record.