on 2025 May 02 10:48 AM
In S/4HANA Public Edition, you can create custom forms. This works great as long as you can use the SAP standard data providers (IDP). You can see where this is going... we can't use those, our data selection is completely custom and involves several data sources.
In this scenario you have no alternatives but to take control and build everything in a piece of custom coding. In our case, due to the need for other on-stack features/APIs, we built this code on stack as well. This is all still in a Public Edition environment.
A large part of the process is perfectly explained in this blog:
SAP Forms service by Adobe in SAP BTP, ABAP environment
There are several steps required to eventually get to the PDF form. A connection to the template store on BTP, a reference to a data service which exposes a CDS view, and of course in the end a method to combine form layout with form data. Very basic versions of all these steps are in place and do work.
" This creates the MT_OUTLINE structure that contains the data layout
data(lo_fdp_util) = cl_fp_fdp_services=>get_instance( 'ZSD_customform' ).
" Based on the key, this should always return a single top level record
data(lv_data) = lo_fdp_util->read_to_data( lt_keys ). " In readable data format
data(lv_xml) = lo_fdp_util->read_to_xml_v2( lt_keys ). " In XML format
data(lv_xsd) = lo_fdp_util->get_xsd_v2( ). " In XSD schema format
Now comes the tricky bit. Besides having a CDS view as data source, we require to query an external data source as well. When loading the initial data service, SAP generates the data structure for you. Very convenient and it saves you the trouble of manually building the XML and XSD. This of course only includes the fields known to the data service, not the ones from the external data source.
What would be a sensible solution here? Manually creating the XSD feels wrong in every way. How can we integrate both data sources into a working XML file (for actual data) and XSD schema (for data layout)? That schema can then be uploaded to the template store.
Request clarification before answering.
Hi Egbert,
Have you tried the solution that is explained here https://community.sap.com/t5/enterprise-resource-planning-blog-posts-by-sap/calling-custom-adobe-for...? This talks about how to build a custom form using Adobe Form Service on BTP, host it on BTP and integrate that with your RAP application to generate custom forms.
Thanks,
Prasanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prasanth,
Thanks for the suggestion, that example roughly involves the same steps as the one I linked.
This solution is based on a single Service Definition as well... no additional data sources. So whilst it does work for simple scenarios with a single RAP service, it doesn't help me combine data sources.
User | Count |
---|---|
30 | |
21 | |
16 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.