Technology Blog Posts by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
tandx94
Associate
Associate
432

This service is no stranger to most SAP customers as it is the go to service when comes to generation of interactive forms or static PDF forms based on pre-configured templates, that may be used as attachments for transactions or documents on ECC or S/4HANA.

However, with the advancement in technology over the years, I cannot stop to wonder, why do customers prefer or still using this two-decade old service even though there are other innovative solutions in the market?  I noticed another problem while researching on the service via the web, most of the blogs and SAP’s help documentation only focus on integration with ECC or S/4HANA using ABAP coding. This sounds like a good technology that can be used outside of SAP context and have led me to my next burning question, "Did anyone try to maximise this service beyond SAP context and with the use of python?" Sadly, there is limited information on this.

Recently, I had a chance to build and demonstrate a proof of concept with this service on BTP, based on an actual use case. Finally, I got all my answers. Hence, let’s dive into the details.

Use Case:

Customer is keen on exploring BTP services to create an application for their ground staff to generate unique labels for their finished goods. These are some of their business requirements:

  1. Ground staffs can input production data into the application.
  2. Ground staffs can use the custom-built application to pull S/4HANA data and use it as part of label creation.
  3. The label follows a standard format but, it comes with a unique QR code and contents.
  4. Current label template is on SAP Form Service by Adobe, and customer has specifically instructed to leverage on existing service and template.

Solution:

Create an application using SAP Build Apps, a low-code, no-code service for frontend development and a backend service using python, that integrates with database, object repository and SAP Form Service by Adobe. The backend service will be hosted on SAP Cloud Foundry Runtime.

Technical Architecture

tandx94_0-1749528715143.png

For this blog, I will be focusing only on using SAP Form Service by Adobe and calling the service via python with the standard APIs.

How to start?

Prerequisite: To create form templates, you will need to download and install Adobe Lifecycle Designer. There are some SAP Notes and SAP’s help documentation available online that can guide you on how to get this software. Please refer to this link for more information.

Step 1: Create a form template using Adobe Lifecycle Designer

tandx94_1-1749528884480.png

First realisation: Adobe lifecycle designer is a business user friendly software.

The drag and drop feature within Adobe Lifecycle Designer, enables user to create form template easily. It comes with a comprehensive object library containing the most commonly used objects (components) like button, check box, etc., for a form. It also allows user to embed a QR code in the template and specify the data beneath it. All the user needs to do is to drag their desired objects into the design panel and design the form template.

Step 2: Create a data schema in xsd format

tandx94_2-1749529092223.png

These are the XML data that I wish to insert into the form template. Let’s convert the XML data into xml data schema in xsd format.

tandx94_3-1749529203032.png

Step 3: Bind the data with the objects in the template and export the template

tandx94_4-1749529243942.png

User has the option to bind with a sample XML data file to visualise the final form outcome before binding it with a xml schema. Once this is done, export the template in xdp format.

Step 4: Activate SAP Form Service by Adobe via BTP cockpit. Access the UI to upload template and data schema.

You can refer to this link to learn more about the service setup on BTP cockpit.

tandx94_5-1749529779351.png

Once the service is set up and with the appropriate roles assigned, you may access the SAP Form Service Landing page.

tandx94_6-1749529810241.png

Step 5: Upload Form Template and Data Schema under “Template Store”

First, create a Form on SAP Form Service by Adobe. You can proceed to upload the form template (xdp file) and data schema (xsd file) into the service.

tandx94_7-1749529884703.png

Second realisation: Python can be used to create the necessary files for PDF rendering.

Step 6: Create a backend python service

a. Use the SAP Form Service by Adobe standard API to pull the template from ADS service.

tandx94_8-1749529935034.png

b. Generate encoded xml data encoded Base64 file using Xml.etree.Element tree library.

tandx94_9-1749530042209.png

c. Render PDF to generate label via API

When Render PDF API (labelled as ADS - Render Requests on SAP Business Accelerator Hub [link]) is called with the necessary payload information, the response will return a Base64 encoded file of the rendered PDF. You will need to decode it and save it to your desired destination, either on local machine or into an object repository.

tandx94_10-1749530145976.png

tandx94_11-1749530163061.png

Output

tandx94_12-1749530190154.png

Conclusion

As you can see from above, SAP Form Service by Adobe can be further leverage by expanding the use cases outside of ERP context, with the use of a different coding language, python. I hope that this blog can serve as a good reference for the community to maximise the usage of this service.

Happy learning and exploring!