Skip to Content

XML transformation - GLM alternative solutions

May 04, 2017 at 09:39 AM


avatar image

Hi guys,

question is simple.

I've already created a solution using office documents and ObjectOrientation LifeStyle....but I would like the smartest solution...

Do you think it is possible to create a label like this one below, from an XML file ?

I mean using only an XSLT transformation calling. I read about creating XSLT from XML with a software support like Dreamweaver or something else like that one, but I would like the easiest solution to be mantained in the years and to be integrated with SAP.

A solution using SAP HANA XS features would be ok as well :) perhaps an HTML page, running on the web server compiled dynamically. Anyone with experiences?

I recently implemented something with XS but only to query data on SAP, throughout XS web server, viewing from an internet browser.

A label is something different.

Thanks for your attention.

ghs-label-lg.jpg (163.4 kB)
10 |10000 characters needed characters left characters exceeded

As Jelena asked, which format do you expect?

* Please Login or Register to Answer, Follow or Comment.

5 Answers

Best Answer
Jelena Perfiljeva
May 05, 2017 at 08:00 PM

Roberto, not sure I understand the question... XML format is basically data (but I'm sure you already know that :) ). On your screenshot, I see several images (icons, company logo, barcode). Obviously that represents a challenge. I'm guessing if you include image information in XML it'd have to be binary and then you'd need something to interpret and present it correctly. I don't think XSLT or even HANA provide this kind of functionality...

Also it's not clear where exactly are you expecting this label as a result (web site? SAP? printer?). You might want to elaborate on the requirement.

Thank you.

Show 19 Share
10 |10000 characters needed characters left characters exceeded

Thanks Jelena.

Well my goal is to print a label with defined dimensions but with the complexity you see in the picture.

I read a lot of stuff about XML / XSLT integration with SAP but nothing that really helps me. In the end I decided to use a pptx template and some VBS code.

I include a dynamic XML file in PPTX as datasource and that's almost all. It's quite fast but not the smartest solution I suppose. I would like to know if someone have ever think about kind of other solutions.

My idea is an XML mapping for an XSLT generation with some kind of software, and with this XLST transformation, within SAP, generate a label, without using any other software.

Thank you very much for your attention.


Roberto, but still you haven't quite answered where exactly are you trying to plug in this functionality. You're saying "print a label" but in what context? Some kind of transaction in SAP GUI?

The label actually does not seem very complex to me and could be accomplished even with a SmartForm IMHO. The only potential problem is the signage labeled with (3) on the screenshot. There are no diamond-shaped windows in Smartforms, so you'd need to upload pre-defined images of all the possible combinations. Other than that it seems straightforward.

Sorry, I really don't get how XML/XSLT is even involved here and why... You might want to explain the business requirement, not the specific solution.


Thanks, ok, sorry.

Context will be a custom SAP transaction that will create a label.

For smartforms:

1 - We're not able to upload Transparent images in smartforms (*.png/gif) as far as I know and those images are diamond shape and will overlap on the edges.. Images will be dynamic and will change for each materia. All possible combinations would be hard to mantain in the years and too much time-expensive;

2 - smartform needs a text size to be defined and there're texts (such point 5) that will be of a dynamic dimension and it should auto-size text;

With some effort probably these two questions can be solved using some work-around ( point 1 I'm not so sure), but this wouldn't be a smart solution because of the effort that need in front of changes of new technologies.

Business requirement is to have the most versatile technology in the years of changes that will come.

With XSLT we can format an XML file through a template and that would be a simple solution to mantain.

I would like to avoid using an office document template. I don't like addictions :)

thanks a lot!



OK, thanks for clarification.

Yes, unfortunately dynamic images in the diamond pattern make any SAP form solution pretty much a no-go. Not sure about Adobe forms but it's very likely the same (wouldn't hurt to check though).

I'm not getting though how XML/XSLT could possibly help you here. Of course, you can stuff the data into XML but how would you process the data for printing? How did you envision that?

Overall though SAP is not a graphics or desktop publishing solution, so I'm afraid either way you'd need some kind of special application for this. You might want to post a more general question in MM on how other companies are printing hazmat labels.


Thanks Jelena.

Unfortunately most of companies I saw, they use external software and they pay for licensing. Example could be Ashland. They use a WWI solution. An other solution can be Selerant software. But why spend money if you can get the same results with standard and open source solutions?

If you don't like it then you'll still have the opportunity to buy something and become slave. But if it's ok, you'll be free.

To process data for printing we need a template that can be an HTML or an Office document if necessary. With some nested javascript or vbs we can manage printing.

The best for me would be a free template (no office/microsoft), something like that Open XML but I can't find an easy reference for other types of template than microsoft ones.

I tryed to post question time ago, but always no useful reply.



You should definitely try Adobe forms (as suggested by Jelena), it has much more rendering features than smart forms -> install Adobe Document Services on a java stack, and do a POC of your label. I don't see why it wouldn't be possible. It's license free in production (as long as you don't use Adobe forms as interactive forms).

Show more comments

Yep, it's a "little" work ;-), but I think it's worth looking at, and proposing to the client, especially if you have (much) more than one label to develop? You may also test the part of Adobe forms which allows you positioning fields, images, barcodes, and so on... It's named Adobe Livecycle Designer. It won't generate PDFs though (which is the job of the Adobe Document Services, which is to be installed on the SAP's java stack, the communication between ABAP/java systems is via RFC).


Thanks Sandra.

There are a bunch of labels, that changes only in page size and some output data.

I've just installed Adobe LiveCycle Designer. As you wrote it won't generate a PDF but as far I can see it generates a preview. Probably, with some workaround, is possible to get PDF data from the function module and manage PDF binary data to be printed outstide SAP? Or is it necessary to install ADS?

Before starting a try, an other question: Adobe LiveCycle Designer seems to be free. Isn't it?

We don't need to pay nothing for that?

Thanks a lot



Yes, it's required to install ADS. When you activate an Adobe form via transaction SFP, SAP will both send a binary representation of the form to ADS, and it will generate a function module. In ABAP, you get the function module name at run time by calling the function module FP_FUNCTION_MODULE_NAME, then you call the function module and pass the parameters. This function module will transmit by RFC the parameters to ADS which will bind them to the form, and will generate the PDF and return it to the function module... (or as a spool file based on what you need).

Yes ALD is free. In fact, ALD is also embedded in transaction SFP. Here, I just wanted to make you discover the Adobe forms. See the SAP instructions how to install ALD for SFP (if I remember well, it's now part of SAP GUI for Windows installation, as an optional "module", but I'm not sure).


I've just installed it and yes, It's part of SAP GUI for Windows Installation. It's well done and has all features.

I would need to know:

1 - if possible to set images dynamic by binding an image on mime repository for example;

2 - if text's size can adapt to the "rectangle" dimension (auto-fit text function :) ).

As you told me I can't activate forms and so I can't test them until we don't install ADS.

Well I suppose there's no escape for an ADS installation.

So ADS is FREE in this case, because we won't use interactive forms but only a custom already feeded form.

Do you have an idea of time to set up all the java stack in every system (develop, test, production)?

Is it possible to usa a virtual Java AS?

Thanks a lot for your support!


I had done only 2 basic Adobe interactive forms a long time ago, so I can't answer. I'm pretty sure you can add any image you want (in ABAP, load it from the MIME repository, and pass the binary; or maybe only a URL); for the text size I'm less sure it's possible, maybe you can approximate a font size based on the length of the text... Ask it in the Adobe forum.

For the installation of a java stack, I have absolutely no idea; better ask in the administration forum.


I found it's possible but with PDF preview (that is not the Print Preview but the one here attached) I can't see binding data and so I suppose ADS is necessary to test PDF printed with data I need.

Thanks Sandra!


Thanks, Sandra! Read through the comments but I'm still wondering - will even Adobe forms allow to form the dynamic label like (3) in the screenshot above? That's the main challenge here, from what I see.

This label consists of separate elements and there might be different pictograms needed, depending on the product. IMHO this is possible dynamically either with a diamond-shaped window or images with transparent background. Adobe forms certainly have more feature that Smartforms but I don't believe this would be one of them. Haven't used Adobe forms in a while though, maybe I'm missing something.

Thank you!


Jelena, really, I'm novice, but there are many more features in Adobe forms. Adobe forms can do the labels, and there are more barcode "symbologies" allowed than in smart forms. Of course, there are probably some limitations, and maybe there can be issues for creating this label, but I don't know. For diamond-shaped images, maybe that will be an issue, I don't know. But it's worth a try. At least, installing ALD and checking the available options is the least thing to do. As you said, "wouldn't hurt to check though" :)


Sandra and Jelena Thanks!

Your support is useful. I found that dynamic images are possible but I cannot test it until we don't install ASD and we binds data from an external program.

For dynamic images, the trick is to initialize some global variables with binary data and references.

The problem now would be convince to install ADS for a try and this means some questions like:

Does company have to pay for it? (--> I know that forms with no user's interaction are free to be used, but here we're creating a dynamic form with data determined in a custom program, so is it still free to be used? :) )

If I would be able to install ADS all by myself, I'd choose adobe form as solution.

But I can't see any road without ADS installation.

We'll ask to internal SAP references too! Thanks a lot!


If you mean "dynamic form" for variable layout or variable text or variable images, then it's all about "Adobe forms" as it must be frequent to get images from SAP and put them into Adobe forms. Anyway, yes, it's free. Any kind of layout is free.


Ok thanks Sandra,

note 750784 about Forms Fees is quite confuse about what is interactive and not interactive.

They talk about Pure Print forms but nothing about a PDF generated with all data already feed in.

User will only launch a transaction a get a PDF ready to be printed, or better only a printed label without any pdf generation. So we'll go forward to check out if it's our case.

Thanks again!

Show more comments
Patrick Weber May 15, 2017 at 08:58 AM

That is absolutely possible. You could render e.g. an HTML page from the content of your XML file using XSLT. As for the images, the HTML IMG tag accepts base64 data in the following notation. Try the following example:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAvCAIAAAAgvHD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I just generated and would be replaced with the base64 string in your XML file. You can set the src attribute using xsl:attribute.

<xsl:attribute name="src">
<xsl:value-of select="concat('data:image/jpg;base64,',xPath)" />
Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Patrick,

thanks a lot! Well it's exactly what I was looking for on internet but there's too much material about XML/XSLT.

If you have any references (internet links material) on how to reach this goals through SAP, please let me know.

I found something on Office template but nothing on HTML template.



Hmm, sorry I'm not sure if I fully grasp at which point you're struggling. A search on "generate html page from xml using xslt" or similar should give you a gist of the options you have:

- use and XML file with an XSLT stylesheet and rely on the browser to apply the stylesheet to serve up HTML
- write some server-side code that transforms the XML to HTML using an XSLT API and serve the result back to the client browser.

I assume you have some form of web application that invokes a BAPI, WebService or ODATA resource on your backend to retrieve the data so you would probably use the latter as you're writing code to retrieve the data anyway.


Thanks Peter.

I thought about XML/XSLT/HTML because it seems to me a low-level solution without using any other software or external web-application.

I could use transformation in sap and an HTML template in the MIME repository but I think it will not be so easy to manage a label with features like the ones you see above.

Adobe Forms seems a good tool, even if it will need some work on. How would you do act for this business requirement?

Thanks , regards!

Roberto Vacca Oct 12, 2017 at 01:28 PM


thanks all.

I think Jelena Perfiljeva and Sandra Rossi gave me the best answer because the ADS solution seems to be very powerful for this kind of solution. I mean, as you can see the output label, we're not talking about a simple report-list output, with a table and some data. There are full dynamics features including GIF images with transparency, text with auto-size, database connection data , render time, page size, hiding components conditionally, etc..

With Adobe Forms I can use javascript features and ABAP for industry 4.0 features .

That means a lot if we talk about environment reliability. My only limit was that Intermec Printers, that it's quite like trying to tame a T-rex. There's no driver in SAP working well with those printers. If it works , it takes much more time than direct print from a local application with the local configured intermec, and I'm not going to tell you about problems managing images transparency.

So I choose to print using adobe reader and local windows driver configuration. Other problem: there's no way to launch adobe reader DC from a local workstation in a remote server. My goal was to launch adobe reader DC exe centrally in a server, without opening in the local workstation, with the printer's driver configured in local on server-side, but it's not possible.

Adobe DC runs in background process and doesn't seem to be controlled. Then I struggled against creating an auto-pdf printing on the document ready phase, without saving file on the workstation (we don't like saving files). I had to use javascript and it seems to work-well.

Now the situation for printing out pdf is so complicated because of the Trexintermec, but normally, with a PDF compatible print there shouldn't be any problems to use SAP print spool managing system.

With Adobe Forms I solved the auto-size text problem, setting 0 to font-size. But it's not all, because to see this feature you need to put an X for the DYNAMIC parameter of the AdobeForms input structure sfpdocparams (even if it's not an interactive form). It's still not all. You need to set an X for the Preview data and get_pdf mode active on.

With these settings you finally obtain a pdf content printable, but only using Adobe reader, because auto-text size won't work if you open this PDF with others readers or if you print it directly without passing from adobe reader. Every technology has its limitation but I think that XML solution without any others free license productive software, is not available.

That's the output application:

I'd like to receive others experiences.

Thanks for your time!

10 |10000 characters needed characters left characters exceeded
Christoph Bergemann Oct 08, 2017 at 07:10 AM

Dear Robert

do you use EHS GLM? Normally such labels (as shown by you) is generated using EHS and then is printed using WWI.

IN te current SAP set up there is a potential set up available to generate such labels (using EHS) not using WWI but other techniques. Up to now. I have never seen anybody who succeeded to use the new option

Conclusion: To generate such labels you should use the noraml EJHS WWI set up. And here we do not have an "XML" part

But the statements are correct. Using XML and by using "transformations" (which are part of standard SAP) you can generate such a label (e.g. as well direct in pdf file etc.)

Check eg.

For XML / XSLT transformations: you will find lot of informations in internet


10 |10000 characters needed characters left characters exceeded
Jayakumar Indracanti Oct 12, 2017 at 05:28 AM

Hello Roberto,

Not sure if it helps but there in one application in SAP called Environmental Compliance 3.0, in that application we create reports in a similar fashion of using XML and XSLT transformation with a pre defined pdf layouts for Adobe Document Server.

Thanks and Regards


10 |10000 characters needed characters left characters exceeded