Skip to Content
Technical Articles
Author's profile photo Prabhjot Bhatia

E-Mail Templates in S/4 HANA – Translations

This is a continuation of my previous blog related to E-mail template concept and usage in S/4 HANA. If you haven’t checked that, please refer :

https://blogs.sap.com/2019/10/12/e-mail-templates-in-s4-hana/

In this article, I will provide the steps how we can maintain the translation of an email template.

When we create an email template in default language EN and try to maintain the translations in German language from “copy” function, system would generate new entry in German language but the content of email would remain in English. This would be only available in disable mode so we can’t change the email content ( plain / HTML texts ).

Please find below the highlighted sections:

So we can see that even if email template is opened in change mode, HTML text editor is in display mode only and since I copied it from original English language, It’s showing the original content.

When I saw SAP standard email templates, I could find the translations maintained in different languages.

Email Template FIN_ACC_ST_EMAIL_TEMPLATE:

Email%20template%20in%20Japanese%20Language

Email template in Japanese Language

So definitely, there would be some process to maintain these translations.

 

How to maintain the translations?

In SAP world, the answer of above question is simple : SE63

Yes..I tried to find a way or correct objects in SE63 to translate email templates and following are the steps :

Step 1. Go to T-Code SE63 and select “Other Texts”:

Initial%20screen%20%3A%20Translation%20Editor

Initial screen : Translation Editor

Step 2. Expand User Interface Texts ( A5 ) and select SMTG (Output Management Email Templates )

Select%20SMTG%20%3A%20Output%20Management%20Email%20templates

Select SMTG : Output Management Email templates

Step 3. Select Email template ID and target language which needs to be translated:

Step 4. When we select edit option, system would give a blank editor to maintain in German language.So we can maintain the German translation

We can use the copy source option and just maintain the German translations from English content. Rest of the HTML content can remain same. Once translation is maintained and is activated, we can see the status “Translated” :

 

Now if go to email template and check the preview option, we would see translations in German available for use.

Preview:

 

So now, in the calling application, if customer’s correspondence language is German, the translated email content would be picked up and processed as final email.

Note: I am still investigating the option to translate the E-Mail subject in Email templates. Once I find anything , I will update this section.

Translation of Email subject:

One of the community members have explored how we can handle the translations of subject line . Thanks Dikshant Mishra

When we are done with above steps to maintain the translation in Target language, we can find out for an auto-generated tag in the content as follow:

In HTML Tag <pre data-subject= “true”>Enter Translated Subject content</pre>, We can maintain the translations.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Luis Gerardo Hinostroza Sanchez
      Luis Gerardo Hinostroza Sanchez

      Great work, congratulations.

      I have a cuestion, how can i send multiple lines inside body of HTML?, a list of materials, names, codes, etc.

      thanks for your attention.

      Author's profile photo Dikshant Mishra
      Dikshant Mishra

      Hello Luis,

      You can add a placeholder in HTML Content in your template and then you can:

      1. Get the HTML Content in your code.
      2. Convert your internal table to HTML (There are FMs available to do this).
      3. Replace the placeholder in HTML content with your internal table's converted HTML string.
      4. Set the HTML content as email body using CL_DOCUMENT_BCS=>CREATE
      5. Set the document to CL_BCS and send.

      Hope this helps,

      Dikshant

      Author's profile photo ana osako
      ana osako

      Hi Dikshant,

       

      do you have an example to do this?

      Author's profile photo Dikshant Mishra
      Dikshant Mishra

      You can translate the subject as well. When in SE63, look for the tag <pre data-subject="true">. Text following this tag is the subject of the email.

      Regards,
      Dikshant

      Author's profile photo Prabhjot Bhatia
      Prabhjot Bhatia
      Blog Post Author

      Thanks a lot for the hint. I could translate the subject lines as well using Email template concept .

      I will update the blogpost so that this solution will be accessible to viewers.

      Author's profile photo Danny Van der Steen
      Danny Van der Steen

      Hi,

      i am also investigating the email templates but in the translation i cannot just update the complete body because the system checks the HTML via an XSLT transformation in CL_SMTG_EMAIL_TRANSLATION->IF_LXE_TRANSLATION_OBJECT_L~WRITE_TEXTS via this lcl_xhtml_converter_xslt.

      Doing this it prevents me from just saving the content.  I use the BeeFree.io to generate the templates in the different languages so i just want to be able to save this complete template as it is in the different languages.

      Greetings,

      Danny

      Thx for your nice blog anyway

      Author's profile photo Danny Van der Steen
      Danny Van der Steen

      I found a note https://launchpad.support.sap.com/#/notes/2832059 which activates the editing of all languages anyway.

      Our release did not support this note so i made an enhancement in method update_content_controls of the local class lcl_dynpro_handler in include LSMTG_WBP01 copying the code from the method in my enhancement code and renaming some variables that end up being already defined and now i can edit just all languages as one would expect.

      Geetings Danny.