Experts,
I'm still a fairly new SAP developer, with only about 6 months under my belt. I've found myself having to duplicate the same code over and over again with slight modifications, which I feel is inefficient. I noticed that the Marketing Documents appear to all share the same fields, both at the header and line levels, and even UDFs appear to be propagated throughout all of the Marketing tables. So I got to thinking, couldn't I write a generic method that could take an input Marketing Document and then spit out another Marketing Document of any other type? Such a function would be highly valuable, and we wouldn't have to repeat so much code over and over again.
So, I've attached for your perusal the actual method itself (written in VB.NET called cloneMarketingDoc.txt), which is non-functioning. I was hoping to get your feedback on where I went wrong, and if such a thing is even possible. When we try to run this method and use different origin and resulting documents, we get all sorts of different error messages for each combination. So I've come to the conclusion that SAP must have some built in "invisible" logic that treats Marketing Documents differently, even though they all share all of the same fields. I was hoping that one of you might be able to shed light on this and perhaps offer an alternative solution? Is there indeed a set of "invisible" logic that treats Marketing Documents differently from each other, and if so, are the detailed proprietary and hidden from us, or is it documented somewhere?
Otherwise, I'll just keep chugging way and writing individual "clone" methods to copy these individual document types into each other, though honestly it seems inefficient.
Thanks in advance for any help that you can give me!