Prerequisites
This functionality is provided for
SAP NetWeaver Release 7.31 SP14 and
higher as well as Release 7.40 SP08 and higher.
Context
In your program, you want to use a text that is translatable.
Examples
You want to create a text symbol from the following write statement:
Procedure
- In the source code editor, write text-xxx where xxx is the
placeholder for the text key of your text symbol.
Note The text key has three characters that can be letters and / or numbers.
However, it must not start with %_ or contain empty spaces.
- Position the cursor somewhere on text-xxx.
- In the context menu, choose Quick Fix or use the shortcut
(Ctrl 1).
Note Text in uppercase is not considered for translation. In this case, no
quick assist is provided.
- In the Quick Fix dialog box, double-click Create text
001 in the text pool.
The New Text Symbol creation wizard is opened.
Note Following entries are write-protected:
- ADT automatically derives the name of the Text Pool from the
name of the development object you are currently working on.
- The value of the Original Language is derived from the
original language of the ABAP program.
- The Text Key identifies the text symbol in the text
pool.
- In the Text Content input field, add the information you want to display
in the program.
Note You can enter a maximum of 132 characters.
- Enter the Maximum Length for the text content to be translated. You can
also use the slider in order to determine the number for the Maximum
Length.
Note
Text translations in other languages may need more space due to an
increased number of characters.
In order to provide the required space for such translations, the
following automatic rules are defined in ADT:
- If the actual length is less than 20 characters, ADT adds 10
characters to the actual length.
- If the actual length is greater than or equal to 20 characters, ADT
doubles the number of the actual length.
- Choose Next.
- Assign a transport request.
- Select the Choose from requests in which I am involved radio
button to pick an already existing transport request.
- Select the Create a new request radio button in order to generate
a new transport request. In the Request description field, type in
further information.
- Select the Enter a request number in order to add your class to
an existing request. Choose the Browse... button if you want to
select a request that has already been created by a certain user.
- Start the creation with Finish.
Results
The text symbol is created in the text pool and activated.
Example
The write statement is the same as it was before execution because the text content
has been added in the creation wizard.
In the
Quick Assist view, the following quick assists are provided:
- Add literal for text to change the notation from text-xxx to
'hello'(xxx)
- Edit text to change the text of the text symbol
Tip This procedure is also provided for similar use cases. In addition,
take a look at the following differences:
Table 1:
Comparing Similar Use Cases for Creating Text Symbols
Description |
Code Example before Execution |
Code Example after Execution |
Procedure |
Differences |
You can write a text followed by a certain text key enclosed
in brackets. |
greeting = 'hello'(B01). |
greeting = 'hello'(B01). |
Use quick assists to create or edit the text symbol. |
- In the Text Content input field, the given text 'hello'
is already added.
|
You can write a text without providing any text key. |
print( 'Page was printed!' ). |
print( 'Page was printed!'(100)
). |
Use the quick assist to create the text symbol. |
- ADT automatically uses a text key that has not been used
so far.
- In the Text Content input field, the given text 'Page
was printed!' is already added.
Note If the same already exists as a text symbol, you will get
a quick assist proposal to reuse the text symbol.
|