Hello Daniela
This process is not supported by the standard system.
Even if you set the discontinuation for material B, the error message "Multi-level discontinuation not supported" will be generated when you run MRP and you will not be able to plan this material.
BR
Caetano