It's been a while since this post got any answers and I'm faced with the same problem. However I'd like to add document data to material using fm/bapi. Is there such a function module?
P.S. I found a way to add document to Design Drawing but that's not where I want it to be.