Hello.
if my previous post http://scn.sap.com/community/abap/application-development/blog/2013/03/08/what-is-open-xml
i wrote a short description about Open XML standard.
Open XML let us the possibility to read , write and manipulate Open XML (OOXML) documents.
sounds confusing?
let’s explain this.
we want to read Microsoft Word .docx extension into SAP , upload the file and then do some actions on this file.
in the old days we had .doc extension file that was uploaded into SAP and we had no possibility to manipulate the file.
we could only use Office Integration methods or OLE methods
and we had to open Word application to use it.
now , with OOXML we have a lot of opportunities.
Open XML files are really ZIP files and not Binary files as the legacy .doc or .xls extensions are.
we can see here examples of OPC extensions
let’s have an example.
we will create a new Microsoft Word document.
the document contains a header with a logo and some text.
save it as scnExample.docx file.
now, let’s change the file extension to .zip.
now we have scnExample.docx.zip file.
we will unzip the file
and we got a zip directory contains subdirectories and files.
this is the structure of the Open Packaging Conventions (OPC) which is a container-file technology.
this is a combination of xml and non xml files that together create an Open XML document.
now , you can understand what’s the main difference between legacy and Open XML files.
Open XML let us the freedom to handle the documents as we need on any platform we need.
this is a huge advantage over the old methods that used macros and so on.
from here we will upload the file using any method of file uploading into SAP server,
( local file or Read dataset method ).
the file will be inserted into a Zip object in ABAP
and then we could manipulate and handle every part of the ZIP object.
think about in as a puzzle or a Lego.
you break it into pieces ( called parts in OPC )
handle the pieces you need
and then collect all the pieces into one ZIP object.
and more to come…
Ronen Almog
Thanks Ronen for the easy understanding of OPC. This is a new concept for me. Looking forward to your blogs to come. 🙂
Hi Alok Kumar.
thank you.
Open XML is a wide area and and i try to give here
some concepts and examples of combine OOXML with SAP.
of course there will be more blogs regarding these topics.
Ronen Almog
Thanks Ronen! Very clarifying article, looking forward to read your next posting.
Hi Frans.
liked your reply,
i hope asap.
Ronen Almog
Hi Ronen,
thanks for this explanation.
I wrote about OXML some years ago http://scn.sap.com/community/abap/blog/2010/07/12/abap2xlsx–generate-your-professional-excel-spreadsheet-from-abap.
I would also suggest you to join the open source project on SAP Code Exchange abap2docx, your experience would be really useful for this project.
Thanks
Ivan
Hi Ivan.
thanks,
looks interesting.
Ronen Almog
Tomorrow 10th April we will have an informal discussion on ooxml.
If any of you is interested please follow instruction here
Ronen,
Very intersting. Its a really new technology,
Can you give examples to use it in the SAP?
Yossi Levi,
SAP FI Analyst
Hi Yossi.
there are many usings for Open XML in every organization.
note that Open XML is also includes Excel and Powerpoint.
it can be used for Interactive forms,
print forms, upload data from excel,
and many more as you can imagine.
Ronen Almog
Excellent article!… I am working on a solution for docx to pdf conversion in abap and have been through this code for OOXML and CL_ABAP_ZIP recently. Nice work!
Any pointers on conversion from docx(xstring) to pdf(xstring) within abap?
Hi Asif.
thank you.
about converting docx or xlsx to pdf
there is a service on Sharepoint
that converts the document to pdf.
there are also some more services int the market.
i suggest you to look at open xml developers site
http://openxmldeveloper.org/
i’m sure you will find the correct answer.
Ronen Almog
Thanks for quick reply!
I will check the website mentioned.
I am exploring the options to convert within SAP(ABAP) using FOP or ADS.
I figured out that we could use Sharepoint word automation service but the problem is we are only using Sharepoint as tool and it seems the conversion service ( word automation service ) is not available as “web service” out of the box.
Any idea if it is readily available or do we need to have some development work ( webservice generation) done on sharepoint side ?
You like to convert docx to pdf.
converting it using ABAP is not impossible.
you can use ABAP to produce and manipulate OOXML.
there are a lot of converters in the marks for this purpose.
the solution is rendering the document output stream
to a specified directory where the converter is active as a service.