I think it should work for header level as well. I think all you should need to do is pass the header GUID wherever the item GUID is being passed. In the code I posted, I don't see the INPUT_FIELDS table being passed to the *PRIDOC_MAINTAIN* FM. So, maybe it's not even required.
To check whether the object name you've used is a valid one in CRM or not, you can check the entries in table CRMC_OBJECTS.