Hi,
First you need to create BOMs
SF Y with component A, B
SF Z with component C, D
FG X with component Y, Z
Then for each material BOM you need to create routing/ recipe.
Recipe for X, Y, Z
the operation sequence need to define based on your production process in sequence,
means if you said SF Y produce first, then SF Z, then in Recipe for X you need to put material assignment Y in previous operation before operation with Z.
Hope it will help.
Regards,
Edward