Hi Sreekanth,
This can be done by time constraints V_554y_B, first try to get the time constraints of both the leave types,then you have to go to the table V_554y_B and see what is the reaction indicator has been set for the both maternity and annual leave ,
Please look at the below document for more explanation
http://scn.sap.com/docs/DOC-64666
Thanks
SRiram