Sonu,
I believe you will have to use the following BAPIs
BAPI_USER_GET_DETAIL
BAPI_USER_ACTGROUPS_ASSIGN
second BAPI may need modification , i.i.r.c. it overwrites instead of append.
These are used for direct role assignment so you might have to make few adjustments
Another one which you might want to explore is
BAPI_REL_CREATERELATION
Approach is to create relationships among object (i.e. HRPOSITION & AGR Activity Groups)
Regards,
Shivraj