Hi Balajisha,
If I get you correctly, your want to replace your purchasing group, with the Head of the Org unit.
So in that case for the User, under the Details, the checkbox, "Head of Organizational Unit" should be checked.
Now what you can do is, fetch the user who is assigned as head of the org unit using the FM " BBP_OM_STRUC_GET_MGR_FROM_ORG", here you will get the ID of head of the Org unit under et_manager_id. (Checkbox Head of Organizational Unit" should be checked for the User)
You can use this ID, as the username and use the FM "BBP_READ_ATTRIBUTES".
Not sure, whether this will work, but you can give it a try.
Regards,
Aakash Awasthi