Terminology
Terminology
Master Form | One or more static layout definitions |
Master Form Template | An xdp file containing one or more static layout definitions |
Layout Variant | One specific static layout definition (for example, Portrait Outbound Letter) |
Fragment | Technical type of one specific static layout definition in a master form template |
Content Form | The layout definition of a business document including the reference to a specific layout variant of a master form |
Content Form Template | An xdp file containing the specific layout definition of a business document including the reference to a specific layout variant of a master form as a fragment |
The fragment construct was introduced by Adobe to allow general reuse of parts across forms. SAP has defined specific names for the fragments (such as Portrait_OutboundLetter), and only these fragments can actually be reused in forms in SAP S/4HANA.
There are two very important master form templates as follows:
- SOMU_FORM_MASTER_A4
- SOMU_FORM_MASTER_LETTER
A master form template contains fragments. A fragment is an Adobe LiveCycle Designer form element that allows for cross-form reuse. It therefore allows for one or several master pages to be reused.
This fragment technology is the foundation for SAP master form templates. SAP master form templates are a specialization of the general Adobe LiveCycle Designer idea of fragments. An SAP master form template contains one or multiple fragments. Each fragment is called a layout variant.
The fragments have predefined names. These names have to be respected, otherwise the overall process will not function properly. This is because these predefined names are reused by the system when the actual document is being created.
These specific fragments contain form hierarchy content, especially master pages and dependent objects. Dependent objects include placeholders for boilerplate texts and logos, but there can also be other dependent objects, such as text fields.
A content form template refers to such a fragment. By way of this reference, it inherits the content of the fragment, so that the fragment and its master pages indirectly become a part of the content form template.
With the SAP S/4HANA output management derivation rule, the master form template that is to be combined with a given content form template is derived at runtime from dynamic conditions. This means that, from the beginning, the content form template is known and the master form template is derived accordingly.
When customizing the derivation rule (which happens before runtime), the business process expert configures which master form template is to be used and which content is to appear in which placeholder such as "Board of Directors" text for placeholder Text1). At runtime, these configuration will be retrieved and used for the creation of the actual document.
The fragment is an Adobe LiveCycle Designer entity and is a concept outside of forms in SAP S/4HANA. Within forms in SAP S/4HANA, it represents one layout variant. Such a layout variant can be assigned to a content form via SAP S/4HANA output management configuration.
A fragment in the context of forms in SAP S/4HANA has the following:
A predefined name
A content (see in form element hierarchy)
One or several master pages
Placeholders for logos and texts
Other content elements (such as for title or sender address)
Logos and texts are assigned via SAP S/4HANA output management configuration.
Title, sender address, recipient address, or any other specific value can be assigned from the content form via scripting.
A content form template refers to a certain fragment. In Adobe LiveCycle Designer, this is done with a reference to another .xdp file that contains the master's layout.
Note
Remember, the customer will usually copy an SAP content form template, so this reference will already be contained.
With a reference to the master form, the content form has (indirectly) the same content, but in read-only mode.
From the content form, the "inherited" content can be addressed via scripting. The scripting must be added to form elements of the content form, but it can programmatically access the field content of the inherited content. In this way, one can set, for example, the recipient address.
At runtime, an application (such as Create a Purchase Order) will trigger a request for a print. This could happen via a user interaction. For example, a Print Document button.
First, the form data provider will be called. The data for the document will be retrieved from the database and returned as a service document.
Then, SAP S/4HANA output management will evaluate the configuration for this application object. This will return a form for the business content, either a standalone form or a content form.
If it is a content form, the required master form will be identified via the master form derivation rule.
From the derivation rule, reusable texts for the text blocks and the logos will be identified (and fetched from the text repository and the logo repository respectively).
All of this will be mixed together and passed to Adobe Document Services to create the actual .pdf document.
New Customer Master Form Template
The need to create a new master form template for a customer does not occur very often, as reusable texts, logos, and values (like the recipient address) can be set either via settings or via scripting.
However, the creation of a customer master form template is technically possible.
Reasons for the creation of a customer master form template might include:
- Wanting a placeholder to appear at other positions
- Needing new dynamic values
Best practice to create a customer master form template would be as follows:
- Copy an SAP master form template
- Keep the predefined names of fragments and placeholders
- Add elements (such as hidden information)
- Move elements (such as placeholders)
The customer master form template can be uploaded to the backend system with the SAP Fiori Maintain Forms app. The options in the app are the same as for standalone forms and content forms.