Hi Dinakar
As product Z is a non-valuated stock for you I think you will go for SO costing process where your production Order will not be a cost object rather SO will be a cost object. In prod order you will book Mat Y and process cost (Activity) to calculate cost of Z at your level and settle it to SO. Asper as Mat X is concerned , it is a non-valuated stock and will be transferred with fer to your SO and directly book it to SO level to get the actual cost of product Z.
Kamal