Hi,
If you record PA40 and use LSMW it will work or Use FM: 'HR_Infotype_operations' for all operations like create, delete.....
Number range is filling auto right then why enter Personnel number message come, Please check your number range is external check box click, if so we have to provide Number.
Hope it clarifies.