Use
You use built-in function $SUM_PARTS in a procedure, to produce a sum of the values of a characteristic, across several configurable materials in a configuration structure.
The procedure can only be processed properly if all the relevant BOM components are known in the configuration.
For this reason, only process the procedure at the end of the BOM explosion.
$SELF.<characteristic> = $SUM_PARTS (<object variable>, <numeric characteristic>)

To add together the weights of the different components in a BOM, create characteristic WEIGHT and allocate it to all the configurable materials that you want to include in your calculation.
Create a configurable material as a placeholder and enter this material as the last item in the BOM. Assign characteristic WEIGHT is to the material. Allocate a procedure with the following source code to the BOM item:
$SELF.WEIGHT = $SUM_PARTS ($PARENT, WEIGHT)
$SELF is characteristic WEIGHT of the BOM item that has the procedure. $SUM_PARTS adds together the weights of all components of the superior material $PARENT, to infer a value for the weight of the placeholder material.
You use a constraint to transfer this value to the superior material.

Prerequisites
You can only use this function of a procedure for an object that can be configured interactively on multiple levels.