Language translations for Adobe forms with fragments
With SAP S/4HANA Output Management, PDF – based forms with fragments is introduced. In which, the form templates are implemented using SAP Cloud Platform Forms by Adobe. They are based on a gateway service instead of an ABAP interface, and are usually consuming master form templates as fragments. Existing templates can be downloaded, edited offline, and need to upload them again. For editing you need Adobe LiveCycle Designer (ALD) version 10.4 or higher.
In this blog post, you will understand how to translate the Adobe form with fragments into multiple languages. In order to achieve this, you have to first download the form template from SAP Fiori App “Maintain Form Template” in English Language. Then you need to add the additional field to the template, and corresponding static text to the label assigned to it in English Language . Once your changes are completed , you need to upload the layout from your desktop into SAP using SFP transaction code in English Language . The same layout needs to be downloaded in target language, in which you want to translate or change the existing layout. Once its downloaded, the label which is assigned for the custom field needs to be changed and uploaded back into SAP through SFP transaction code in target language. Always you need to download separate Content Template along with Master template.
In this blog post, I have taken scheduling Agreement for your reference.
First Step is to download template from Fiori App.
Always download with Master fragments when downloading through Fiori App. Master template can be chosen as per project format.
After downloading the form in English language, keep both master and content layout in the same folder as shown below.
Now place the adobe designer layout short cut in your desktop to work on your form offline. First get the shortcut on the desktop.
Now open the layout from your desktop using form designer shortcut.
First open master layout format in the designer and remove the formats which are not needed for your requirement:
Here are the five existing formats which is currently available in Master fragments:
Remove the unwanted format from the five existing formats. In my case, I am deleting everything except Portrait_OutboundLetter and saved the master fragment.
After saving the layout, close the form.
Now open the content layout MM_PUR_SCHD_AGRMT_E.XDP from the downloaded folder.
Then change the location in the subform Portrait_OutboundLetter to point to the newly saved master fragment location. When you open it initially, it will be pointing to the master_fragments.xdp
Now add new fields called country in the layout and bind it to the field AgreementHeaderNode>SenderCountry. Clear out the caption for the new field in the object palette.In order to have static text for the text field.
Then add the code in the FormCalc in the Initialize event to map the caption dynamically to the label field lblCountry. This label acts like our text element for performing translation into other languages.
After adding the script, then go to subform frmHiddenStaticTexts which is by default Inactive. So make it visible first, then add the new text label named lblCountry to the subform and populate the text in English language.
After populating value, change the subform frmHiddenStaticTexts visibility back to inactive and save the form as ZMM_PUR_SCHD_AGRMT_E.xdp.
Now upload both the master layout and content layout to the system through SFP transaction.
In SFP transaction, first create Master Layout as a copy of standard master template and then upload the layout ZMM_PUR_SCHD_AGRMT_E_MASTER.xdp saved in the earlier step.
Now save the form and activate it.
Next step is to create the layout ZMM_PUR_SCHD_AGRMT_E as a Copy of standard form MM_PUR_SCHD_AGRMT and then upload the Layout ZMM_PUR_SCHD_AGRMT_E saved in the earlier step.
Save the form and activate it.
In SPRO, you have to define output types .
Now run the report APOC_RENDER_DOCUMENT to see the output:
After executing the report, the layout will get downloaded:
Now again login to the system in the target language and execute SFP transaction to download the layout in target language ‘ES’ as ZMM_PUR_SCHD_AGRMT_ES. Since the original language differs from Logon language, System always prompts for automatic translation. So skip the automatic translation by selecting the second pushbutton.
Now open the downloaded layout in adobe lifecycle designer, then change the subform frmHiddenStaticTexts visibility from inactive to visible . Once the subform is visible change the text inside the label lblCountry to País
After making the changes, always don’t forget to change subform frmHiddenStaticTexts visibility back to inactive
Then save the layout and upload it back to the system through SFP transaction in Spanish language.After saving the changes to the layout, activate it.
Now execute the report APOC_RENDER_DOCUMENT again with language as ‘ES’ .
Here is the output:
Also, all SAP templates are already available in the localized languages. So in case if you want to change any of the existing static text assigned to the text field, then you have to get the label name assigned to the caption value from the corresponding Initialization event of FormCalc . Once you get the label name, you need to make the changes in the label as done above and upload it back to the system using SFP transaction.
In case of Customized form, all the labels needs to be updated with its corresponding text in target language.
Hi Jency . This is a very informative blog. Thankyou !