Hi
I have recently use this BAPI in assigning/extending role validity. The key thing to be taken care of is you need to pass all the role details irrespective of whether you want to change them or not else it will delete all other roles.
To do a user comparison in ABAP write a program for the same
Nabheet