Delete partner function from VD02 or XD02


I have a requirement where i have to delete partner function (ship to )for particular customer in vd02.

e.g in vd02 for customer X . In partner function tab of vd02 , 3 ship tos SH are assigned (there may be n number of ship tos , now i want to delete these ship tos from customer X and reassign them to customer Y. We can do it by manually deleting each ship to, but for large number of ship to its very tedious job. Is there a way to do this like bdc bapi anything which can solve this problem ? Please suggest.