Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member217925
Active Participant
32,303


Last month, i published my abstraction class to manage Word OLE link. It can generate complete (and complex) word document, but it is a little slow for big tables.

OLE is an old technology... DOCX is an XML file extension... Enough to change my mind about word file generation. Exit OLE, welcome XML :smile:

I updated my abstraction class to generate DOCX file from ABAP directly, without any OLE usage. I know there are actually some projects that want to do that (abap2docx for example). But i think theses projects are too complex to use, or not yet usable in the true life.

With my class, it never be easier to generate DOCX. You never have to use or understand XML.

Here is the code of the "hello word" program.



The class is simple, but can manage complex documents !

Here is the feature list :

  • Empty document creation or with use of template (docx, dotx, docm, dotm)

  • Write text with or without style (character style and/or paragraph style)

  • Option to manualy apply bold, underline, italic, strike, subscript, superscript, small caps, font name & size, font color, highlight color, letter spacing

  • Management of alignment, indent, spacing before/after paragraph

  • Break line, page, section, continuous section

  • Write table with or without style (and option to define cell format : bold, color...)

  • Write Header / footer

  • Write end note / foot note

  • Write comments

  • Write numbered label (figure, table...)

  • Write table of labels (figures, tables...)

  • Choose portrait/landscape, manage page border

  • Add images

  • Add canvas

  • Insert table of content (toc)

  • Add and manage document properties

  • Create and insert custom fields

  • Style creation (character/paragraph)

  • Manage files in SAP Web Repository for template/image (SAPWR, access with transaction SMW0)


In the download file, you will find a test program that contain the class CL_WORD and a demo of how to use it. You will find also some images and 1 template. Theses files are used by the test program, but are not necessary for the class itself.

And there is a direct download link (remember that you will need SAPLINK to install .slnk file) :

Download link : https://www.mediafire.com/folder/if3ljcnesme7y/ABAP

A use case of the class can be found in ZAUTODOC : Automatic generation of technical BW documentation

 

Feel free to comment here :smile:




My others blogpost :

LISTCUBE replacement : a new way to display data

ZAL11 : a replacement for AL11

ZTOAD - Open SQL editor

Abstraction class to generate MSWORD with SAP using OLE

ZAUTODOC : Automatic generation of technical BW documentation

86 Comments
Labels in this area