Skip to Content
avatar image
Former Member

Writing ABAP for Translating - Best Practice

Hi Folks,

I want to setup some guidelines in my team for writing good code\forms to allow for translations as our project rolls on to non-English speaking countries.

I am looking for a document that gives good examples for best coding practice when it comes to translations, for example, when writing messages to the screen use:

'This is the text'(001) or text-001 instead of just writing 'This is the text'

I have searched the net but I can't see any quick useful guides that I could hand to my team. Does anyone know of any guides that might be worthwhile?

Thanks,

Colm

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 27, 2013 at 04:01 PM

    Hi Colm,

    As SAP is geared towards multiple language support most objects cope with this without additional considerations.  From my experience I would offer the following;

    Use Text Symbols for language specific text in programs (in the format Kamesh mentions above in point 2) and set the Maximum length to 10% to 15% longer than the English version.

    Don't use text symbols for anything other than text.  For example if you program uses a function code 'SAVE' store this as a literal or a constant, if it's stored as a text symbol and gets translated things will stop working.

    Always use numbered placeholders in messages (SE91) as the word order in the translated text may be different to English.  For example, Document &1 is locked by user &2.

    If you've defined your own config tables containing a value and a description these need to be defined as two linked tables, one with the value and one a language dependent description.  For example T003 and T003T.

    In terms of transports, the report mentioned by Kamesh in point 4 is useful if you plan to transport the languages separate from the development.  If I have an object locked in a transport all translations for it will get moved when the transport is released, irrespective of the developer's logon language.

    Regards,

    Nick

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 27, 2013 at 03:29 PM

    Hi .

    I can give the list which i have faced during my developements.

    1. When you have common text messages use &&&& in the message class and use text symbols .

    2. Don't use 'This is text'(001) also because even though this will not give error in Extended syntax ,when we change text again again we have overwrite existing. always use text-001.

    3. And text elements can have translations when we are using multiple languages ex: french and spain

    4. Make sure that translations are included in Transport to move it to further systems .

    you can use program .‘RS_LXE_RECORD_TORDER’ for this .

    Add comment
    10|10000 characters needed characters exceeded

    • I always insisted on using

      'this is text'(001)

      since it is self-documenting, and allows for translation. If you use the text comparison tool (in the place where you can edit texts), then changes to the text are not onerous.

      text-001 is to me a magic number and therefore BAD programming.

  • avatar image
    Former Member
    Jun 27, 2013 at 03:49 PM

    Hi Colm,

    This may fall out of place but

    Whenever maintaining selection texts etc give the length almost one and a half times more because the character sets of various languages(scripts) are different.

    BR.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 27, 2013 at 04:22 PM

    I actually prefer to use 'This is a text'(001).

    Reason for this is that it is much easier for developers to 'see' what message will be displayed.

    Texts will not change often.

    But in the end it is a matter of preference.

    Anyway, what definitely should NOT happen is that there are hard-coded texts, relevant for translation, used without the (nnn) or not defined as TEXT-001. These will not be translated.

    You should only use this if the text is NOT relevant for translation. In any other case, use TEXT-001, or 'SomeText'(nnn).

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 27, 2013 at 03:45 PM

    Hi,

    I would also recommend adding all objects to be translated in a separated package. This will allow you to use the translation workbench from SAP where you can select all objects by package. That is, the system will generate a list of things to translate so you don't have to go object by object.

    For example, if you have package ZMYNEWAPP, create ZMYNEWAPP_TL.

      

    What to add in this package? Reports, Data elements, Message class, etc.

    What not to add? Structure, Tables, etc.   

    Regards,

    David.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 27, 2013 at 05:00 PM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 02, 2013 at 07:27 AM

    Many thanks to all of you for your responses. Feel free to continue the discussion if any of you would find it useful.

    Add comment
    10|10000 characters needed characters exceeded