


create new relation in final document between main document part (final merged document) and alternative part(merging document).

store a content of document which you want to merge/import in newly created alternative part.create new alternative part with unique ID for document (merging document).In order to altChunk one document into other you have to:

But it does not offer options needed to use altChunk technique. Standard ABAP class which work with word document in openXML approach is CL_DOCX_DOCUMENT. I investigated if SAP offers any standrad funcitonality what can be used to “altChunk” more documents into one final and I came into conclusion that there is none. You can import html, rtf, xhtml, xml, textplain, macro, word template or another word document. Microsoft Word is able to import couple of content types with tag AltChunk. AltChunk tag tells application to import content stored in alternative part of document into main document part where tag can be used. It is very useful and powerful technique in comparism to 1st option. This will do most of the job instead of you. Second much easier way is to use tag called altChunk.ĪltChunk stands for alternative chunk. Something like you would do when manually copying content of one word document into other using Ctrl+C and Ctrl+V. During this process you will have to deal with plenty of issues like comments, styling, margins, footers, headers and many other things. You can write a program which will read whole documents tag by tag and put his into other document. By merging in this case I mean putting separately stored word documents files into one big word file going one by one. Here I will try to show how we can merge multiple word documents into one final document. Please read these blogs before going through this one and if you are new to this topic I reccomend to start with introduction to OpenXML in ABAP. In my previous blogs Custom XML part – mapping flat data and Custom XML part – mapping structured data I have discussed custom XML parts and how to use it to bind custom data in document.
