How to get XML data for local preview of print forms without output history
Since the beginning of 2023 I have been conducting monthly live sessions on the topic Print form adaptation with Adobe LiveCycle Designer for SAP cloud solutions where I show how to implement typical use cases, solve common problems and mention other useful things. You can find registration information for the Live Sessions at the end of this blog.
This blog is the beginning of a series about print forms and adaptation of them with the Adobe LiveCycle Designer (ALD) and shall act as an addition to the live sessions.
Most of the live session and blog series topics will focus on Adobe LiveCycle Designer (ALD) itself, so they will be applicable for several SAP cloud solutions where Adobe LiveCycle Designer is used.
When it comes to settings or demonstrations within the solutions, I will usually refer to SAP Sales/Service Cloud (in former times SAP Cloud for Customer, C4C) and mention similarities or differences with/to SAP Business ByDesign (ByD). Print form maintenance is handled very similar in those two solutions.
This blog is intended for users of both solutions who design or adapt print form templates with Adobe LiveCycle Designer.
List of print form blogs:
- How to get XML data for local preview of print forms without output history (this blog)
- Data Binding Basics in Print Forms
- Data Binding with Repeating Items and Simple Tables in Print Forms
- Data Binding with Repeating Items and Complex Tables in Print Forms
- Building Tables with Scripts
When it comes to adapting print form templates with Adobe LiveCycle Designer, the first thing I tell my audience is to always use your own sample data to preview the form template and in some rare cases my advice has been: Start making use of sample data in general! 😉
However sample data is not sample data. Most print forms come with SAP sample data within the downloaded zip-file. But depending on your or your customer’s business, you can still have completely different requirements. This starts with the fields that are in use, continues with things like the typical length of names and descriptions, and maybe ends with customer specific extension fields.
And uploading the print form to the system, publishing it, reopening the sample object and clicking the preview button after each and every small change in ALD should be the last way out.
So where to get your own sample data from?
The Easy Way: Download XML Data from Output (History) tab
Downloading the sample data from your own tenant can be quite easy… as long as the business object, that you want to adapt the print form for, offers the output (history) tab! From there you can View XML Data and also save it for local preview within the ALD.
In SAP Business ByDesign many business objects offer the Output History tab (e.g. Customer Invoices, Purchase Orders, Sales Orders, Delivery Notes, …).
In contrast to that in SAP Sales/Service Cloud it’s actually only the Sales Quote that has the Output tab.
The Harder Way: Use the “Debug Sheet” template
In both solutions there are objects, that offer PDF generation (Preview), but unfortunately no output tab and hence no easy option for end users to download XML data from the frontend.
In SAP Sales/Service Cloud typical candidates are Ticket Summary (template name: Service Request) and Account Summary. They can only be generated “on the fly”, which is pretty much the “Preview” feature of a business object with output (history) tab. The ticket allows you to save the generated PDF as attachment, but that’s only for saving the PDF. It doesn’t give you the opportunity to access the XML data.
In SAP Business ByDesign candidates are Invoice Request and Expense Reports, just to name two.
So what to do?
The official recommendation is to create an incident and request the XML data from SAP support. This is described below as the alternative. However, an obvious disadvantage of this way is (apart from creating an incident): waiting for the data.
No matter if you blocked your afternoon for the print form adaptation and forgot to request the data ahead or if you just noticed that the sample data, that you requested earlier, doesn’t contain all relevant fields and now you need an update.
The result is, that you have to interrupt your work, request the data again and usually continue on another day, immerse yourself in the topic again and so on and so forth.
During my days as a consultant I developed a special print form that was helpful in such situations. Now, that I’m not a consultant anymore, I have decided to publish it.
I’ve named it “Debug Sheet”, although it does not really debug anything. Instead it contains some scripts, that read the XML data provided by the system and prints it on the sheets, so that we can copy the XML content and paste it into a new xml-file with hopefully not too many manual post processing…
This is how it looks like in action. The XML content uses a smaller font to avoid truncated lines, thus might be hard to read in the screenshot:
You can download the Debug Sheet here.
Please note, that the Debug Sheet is no official tool! You can’t ask SAP support for help!
You can use it “as is” and at your own risk. (It won’t destroy anything in your system, but only use it in DEV and TEST tenants. Read the Instructions for why.)
Instructions – How to use it?
You have to upload the Debug Sheet to the cloud solution, publish the template and trigger the PDF generation for the respective form template. That’s the reason why you should only upload it to DEV or TEST tenants. Because you need to make it available to end users. Furthermore, after the template has been used in an output, you cannot delete the form template anymore.
When you upload the template to the cloud solution you can either overwrite an existing variant or copy an existing variant as new template and overwrite this. The latter has the advantage, that you don’t touch the original template and can give it an appropriate name, so that everyone is aware what the template really contains. When generating the PDF you can then choose between the two templates. (see the screenshot Ticket Print Preview with Debug Sheet entry in Template Selection below)
Some steps for the sake of completeness (although I guess, when you read this blog, you know the basics of form template maintenance):
- Navigate to the work center view Form Template Maintenance.
In ByD you can find it in the work center Application and User Management.
In Sales/Service Cloud you can find it in the work center Administrator.
- Recommendation: Use the advanced filter and filter for the From Template Group, where you want to get the data from. E.g.: Service Request
- Select an existing variant and choose Copy ➡️ As New Template.
Enter a reasonable name and choose the respective Country and Language for your use case.
- Now select the newly created entry and choose Upload ➡️ To Replace Existing Variant.
Select the DebugSheet.xdp file from the zip (find the download link above).
- Choose Publish to make the template available to end users.
The result could look like this:
Make sure you choose the right Country and Language for your use case when creating the new variant or uploading the form over an existing variant. The following help pages and knowledge base articles (KBAs) hopefully help you:
- SAP Sales/Service Cloud:
- SAP Help: Form Templates – Variants
- KBA 2415900 – Service Request Template – Summary Preview Error
*️⃣ Ticket Summary (Service Request) must use country US or blank!
- KBA 2860317 – How Document Language determination works in Tickets?
- SAP Business ByDesign:
After you have uploaded the template, you can navigate to the place, where you can generate the desired PDF. Let’s stick to the SAP Service Cloud Ticket use case:
Navigate to the Tickets work center view and open a ticket for which you want to get the XML data. Choose Actions ➡️ Generate Summary. In the dialog the Debug Sheet should appear in the Select Form Template dropdown list. Choose it and select Preview (or alternatively Generate to save the PDF as attachment).
Now you can copy and paste the XML text from the debug sheet PDF to your favorite text (xml) editor. If the editor supports it, do a syntax check and pretty print the XML for better readability (e.g. Notepad++ with XML Tools plugin does that).
Save it as .xml file and choose this file for preview in the Adobe LiveCycle Designer (assuming you have the respective form template already loaded):
- Choose menu File ➡️ Form Properties… ➡️ Preview
- Select the xml-file as Data File and confirm the dialog.
- Choose the Preview tab. In case it’s not visible yet, choose menu View ➡️ Preview PDF or press F5.
If everything worked without any broken XML parts, encoding or escaping issues, you should now see the PDF generated with the “manually downloaded” XML data.
Alternative: Request data via support incident
For business objects, that do not have an Output (History) tab, you can also request the XML data from SAP support with an incident. From the quality perspective, this is of course the more reliable way, because the XML has been exported straight from the system without any scripting and PDF print constructions.
You can use the following template for your incident:
|Subject||Request XML data for Ticket 123|
Hello SAP Support,
please provide XML data for PDF print form preview of Ticket 123 according to KBA 2193339.
Steps to trigger PDF generation in front end: Navigate to work center Service -> view Tickets. Open ticket 123 and choose Actions -> Generate Summary -> Preview
Thanks and best regards,
Of course, replace Ticket, 123 and the navigation path with your own details.
The mentioned KBA is an internal one that contains the necessary steps to download the XML data for print forms. It helps that the incident is not mixed up with other requests and avoid misunderstandings.
Always keep in mind that our support colleagues might not only work in one area of the system. “Request XML data” without any other context could also refer to an integration message or if you would request data for ByD and only mention “Order 123”, support would potentially not know, if you are referring to Sales Orders or Purchasing Orders. Always keep these little details in mind… 😉
Another pitfall, that I have seen in projects: Keep in mind that you (or the respective key user) have to forward this incident to SAP Support! And for this the forwarding user must have appropriate permissions and contact data maintained! Don’t forget this step, otherwise you have to postpone your blocked ALD time again 😉
As already mentioned at the beginning of this post, I’m delivering monthly live sessions with a changing agenda on the topic print form adaptation. If you are interested and would like to join, here are some details:
The live session is available on SAP Learning Hub. You need a subscription with access to the SAP Customer Experience learning resources in order to register for the live session.
There are two ways to access to the registration page of the live session (as well as the schedule of the next occurrences):
- You can use the following direct link, but please remember you need to be logged in on SAP Learning Hub first to use the link!
Direct link: Live Sessions – SAP Customer Experience: C4C Extensibility
- Alternatively you can go to SAP Learning Hub, and search for “Print Form Adaptation with Adobe LiveCycle Designer”. Look for a webinar with the headline “Live Sessions – SAP Customer Experience: C4C Extensibility” and the code: (LS_CX_C4CEXT_EN / EXPERT_LED) under “Learning Content”
If you want to get informed about the next blogs of this series or updates on the live session, please follow this blog post by clicking on the green “follow” button on the left. You can also follow me Felix Wyskocil for more blog posts about SAP Customer Experience Solutions – Integration and Extensibility topics.