Hi Karhik,
Did you ever solve this issue?
I have found the same issue when using LSMW and SU10. I have found the cause to be a new version of SU10 introduced before ECC6 SAP_BASIS release 731 release 0005, which is my current version. A colleague on an earlier Basis release of ECC6 does not have an issue with LSMW and SU10. I have also successfully written many LSMW/SU10 scripts on earlier versions of SAP, and also written LSMW/SU01 scripts on this version.
It appears that the focus is on the reference user, rather than the role name when changing to the roles tab. With a straightforward recording of adding a role, the script does not include the role assignment.
Regards,
Jeremy