Translating Text Elements

To translate text elements into other languages, start on the ABAP Development Workbench screen and choose Utilities ® Translation ® Short/long texts. On the subsequent Translate Short/Long Texts screen, choose Translation ® Short texts ® Program and then select the text element you want to translate. The following screen appears:

Enter the name of the program to which the text elements belong, the source and the target languages, and choose Edit.

The text elements are displayed in the language in which they were entered. You can enter remarks and use the line below the text elements to enter the translation (see example below).

After translating all text elements of the current type, use the functions in the Goto menu to translate the text elements of the other types.

After translating all text elements, save your translations by choosing Save.

In this way, you can create complete text pools in different languages.

If text pools of different languages exist, you can influence the output language of your program with

· the logon language: By default, the system automatically uses the logon language of the user.

· the SET LANGUAGE statement: With this ABAP statement, you can specify the output language within the program explicitly, regardless of the logon language.

Syntax

SET LANGUAGE <lg>.

The language <lg> can be a literal or a variable.

When you select a certain language (either through the logon language or explicit specification), the system searches in the text pool of that language for the text elements included in the program. If it does not find a text symbol in this text pool, it outputs the text in the program code to the screen or skips the relevant WRITE statement (see Text Symbols). The system does not use text elements from other languages.

Suppose you have the following program with the original language English.

PROGRAM TRANTEST.

WRITE TEXT-010.

and the output looks as follows:

If you log on to the system in German and no English text symbols exist, you see the following line when the text symbols of the program are displayed:

The character "E" in the column Spr indicates that an English text symbol 010 exists.

The text elements are translated from English to German as follows in the ABAP Development Workbench.

Titles and headings:

Text symbols:

If you logon to the R/3 system and specify the language "D", the output of the program TRANTEST looks as follows:

You can fix the output language of the program TRANTEST to German by changing the program code as follows.

PROGRAM TRANTEST.

SET LANGUAGE 'D'.

WRITE TEXT-010.

Now, the output is always German, regardless of the logon language.