Hi,
Are you not using the tables Parameter DOCUMENTSTRUCTURE in the FM.
It is clearly given in Documentation of the FM to use this to create document structures.
I assume this is what you are looking for.
If not please send some more info on your requirement and code.
Regards,
K.S