Tag > i18n
Supported by
Supported by Inetum

Change selection screen texts without hard coding them

images/thumbnail.jpg - Thumbnail
Even though many ABAP programmers tend to forget this, the less texts you hard code in your program the simpler it will be to translate it. Here’s a simple but rather obscure way to manipulate selection screen texts while still being able to translate then. This way you can, for example, prefix them with icons.

SAP helps you translate to any language

images/thumbnail.jpg - Thumbnail
Every once in a while I find yet another hidden SAP virtue. I just found out that there is a transaction which, for a given word in a given language, will help you translate it to another language by showing you which other translations already exist for that same word. How cool is that? Ok, it’s not Google Translate, but it’s a nice help. Oh, I almost forgot. The transaction is called STERM.

Abapinho Dev Tools: Translator

images/thumbnail.jpg - Thumbnail
Nuno Morais has developed another very useful tool to help simplify mass translations of most SAP objects. The toold is not for automatic translation between two languages. Instead, it has the following features: Export an Excel file with texts Import an Excel file with texts Copy texts from one language into one or more languages Create a transport order with the changed texts

Thou shalt use readily translatable explicit literals in programs

images/thumbnail.jpg - Thumbnail
In reports, instead of WRITE TEXT-001, use WRITE ‘bla bla bla’(001). This way a default text will always be there and besides the readability of the program is improved. https://abapinho.com/en/2011/11/programas-poliglotas/

Thou shalt not REPLACE ‘.’ with ‘,’ just like that

images/thumbnail.jpg - Thumbnail
If you need to adapt the content of a file with amounts, always take into consideration the user settings (USR01-DSCFM). If you need to convert a string to a number use FM MOVE_CHAR_TO_NUM. If you need to convert a number to a string use WRITE curr TO str [CURRENCY waers].

Read the texts of a program

images/thumbnail.jpg - Thumbnail
An easy way of programmatically accessing the texts of any program: DATA: t_textos TYPE TABLE OF textpool. READ TEXTPOOL sy-repid INTO t_textos LANGUAGE sy-langu STATE 'A’. Now, you have all of the texts available in the internal table T_TEXTOS. As if this were not enough, you can also change the texts programmatically with the following commands: INSERT TEXTPOOL sy-repid FROM t_textos LANGUAGE sy-langu. DELETE TEXTPOOL PROGRAM LANGUAGE 'E’. According to SAP, these last two commands are for internal use only.

Decimal to alphanumeric without depending on the user

images/thumbnail.jpg - Thumbnail
When reading a file with numeric values to an internal table or vice versa, the success of the conversion depends on whether the user has defined the dot or comma as the decimal separator. It is customary to then go and read the user setting and then adjust the values from the file with a dot or a comma as required. But this is unfortunate and rather inelegant. There should be a way of not making this depend on the user. And there is.

Insert variables in standard texts

images/thumbnail.jpg - Thumbnail
Everyone uses standard texts. But did you know that standard texts can have dynamic fields in the middle? SAP calls them “text symbols”. The way to do it is identical to that of the old forms of the harmful SE71, in other words wrapping them in the & symbol. Thus: &KNA1-NAME1;&. It’s really handy. I’ll show you how it’s done.

Automating the ALV field catalogue

images/thumbnail.jpg - Thumbnail
Sometimes I ask myself what percentage of the world’s ABAP code is unnecessary. A paradigmatic example of how time can be wasted writing code which is of no use to anyone and only creates problems is the ALV’s all-too-common field description definition sitting directly in ABAP.

Multilingual programs that know what they are talking about

images/thumbnail.jpg - Thumbnail
SAP is multilingual. But ABAP not always. ABAP does have some ability to learn and speak a few languages, but sometimes the programmers do not let it. A lot of programmers whack literal texts directly into the program, leaving it forever unable to communicate in multiple languages. I can think of two reasons for shackling a program to just one language: Laziness, the main reason for doing things badly;

<!--:pt-->Transacção I18N = Internacionalização<!--:-->

images/thumbnail.jpg - Thumbnail
Os americanos são tão bons como os tibetanos a arranjar mnemónicas e abreviaturas para tornar as coisas fáceis de decorar. Internationalization é uma palavra inglesa com 20 letras. Então, a abreviatura adoptada foi I18N, constituida pela primeira e última letras entremeadas por um 18 que representa as 18 letras do meio. Meio maluco mas giro e a verdade é que pegou. Pegou tanto que o SAP tem uma transacção chamada I18N.