Hi Ramesh,
You may use Transformation Groups(TG) for the same.
Map the first rule(source & target) in the first TG & the second rule (source & target) in
the second TG. And use the ABAP code our friend has mentioned above in the Transformation rules.
Regards
Anoop