Well, from that portion of code it is not possible to find out why it's not working.
The most probably CAN initializtion is not correctly done, or maybe (Tx/Rx) interrupts have no definition.
From the link below you can download S12X pack of example in which two are for the CAN. You can use that as a reference:
S12X Examples Pack
Regards,
iggi