Mobile Menu

SAP Translation Hub. ABAP Integration How-To

This article shows an easy and fast way of creating multilingual ABAP applications in order to correspond to best-practice methods and “to speak the Customer’s language”.

Here SAP Translation Hub and ABAP system configuration is described. Additionally, useful methods to manipulate languages in the ABAP system are shown.

Prerequisites

First, we shall comply with some prerequisites in Translation Hub Service on SAP Cloud Platform, our ABAP system and Cloud Connector.

Cloud Connector

We shall configure a subaccount in SAP Cloud Connector for our S-user to make it possible to connect directly SAP Cloud and our ABAP system

s0017347810trial
ul_sap

There we shall configure Cloud To On-Premise system mapping for RFC connection. There we shall grant access to function modules with LXE_ prefix as shown below.

c_to_on

SAP Cloud Platform Cockpit

We shall create Destination in the service of Translation Hub. Its name shall look like STH_<S-user> as shown below (to be considered obsolete from 23.03.2018)

cockpit

For a newer Translation Hub version, that name shall be as STH_<S-user>_<System ID>_<Client Number> to have an ability to use multiple ABAP systems for translation.

dest

We can check if our ABAP system is accessible from Cloud.

conn

ABAP Back-End System

The ABAP system is to be a Unicode system. We can check it in SAP Logon GUI in System -> Status menu item

sap_data

Functional Modules necessary for RFC calls are to be there (if not, implement SAP Note 2349776).

func_group

Create a technical user (its name is specified in the Translation Hub Destination) of Communications Data type and assign Required Authorization to this role. Check that authorization with Translation Hub Documentation.

transl_hub
ztransl_hub
cross-app

Use LXE_MASTER t-code to create an Object list for translation.

trans_admin

Put the Object List description and add Objects to translate into it. Use LIMU REPT object type for ABAP Text Elements. For Classes names you should add “=” symbols so that the name is 30 symbols long and then add “CP” in the end. You can include any other objects like Data Elements, for example, to translate them, too.

object_list

Save and generate the Object List.

erd1

Wait until Status turns into X – Generation Complete.

object_list_x

Now you can use that Object List in Translation Hub to translate all the included objects.

Create ABAP project in SAP Translation Hub

Run Translation Hub Service and create an ABAP project

git

Starting from 23 March 2018, there will be a field to choose Destination to our ABAP system as described:

procedure
svoistva

Try to choose Object List, but there is no one found.

yca

So, now we can choose Object List from our ABAP system, translate it, postprocess if needed and send it back to our system translated into the chosen languages.

Best-practices for multilingual ABAP development

Always use English as the default language for all your ABAP development.

Avoid using text constants in your code. Use text elements instead.

buttons

If possible, output screen fields or print fields shall not be fixed in width to fit any length of the text as it can change from one language to another.

A Text Pool of Text Elements is initialized each time a program object is created (Report is started, or Class Instance is created). It is initialized in the current User Session language. So, if you need to use Text Elements in a language other than the current one (to prepare emails for different receivers, for example), use SET LANGUAGE statement to do it. If the Text Pool is not switched successfully, it returns SY-SUBRC non-zero value, use some default language value in such case.

loop_at

You must use that statement in each report or class separately. As the statement switches only current Text pool and does not change any Pool in super class or called report, you must switch it inside each program object you use.

To reset Text Pool to current User Session language just use SET LANGUAGE SY-LANGU statement.

Conclusion

This article describes a simple and straightforward way of integrating ABAP development of multilingual applications into SAP Translation Hub. That speeds up and streams out line development process and makes it possible to get application that speaks a business user’s language.