SAP OTR Tcodes, Tables, Function and Translation

SAP OTR, Online Text Repository OTR Tcodes Tables Function and Translation

SAP OTR: “TheÂOnline Text Repository (OTR) is a central storage location for texts, and provides services for editing and managing these texts.

The main task of the OTR is to support the creation and translation of texts. The OTR makes translation of texts possible. Terminology is more uniform and texts can easily be reused.

What’s OTR in SAP ?

This means texts are of high quality right from the start. This also considerably reduces costs for text corrections, such as for spelling mistakes, inconsistent terminology, incorrect style, and so on. Terminology changes can be done from a central location.

The object itself is separated from the texts. Any changes to the object do not influence the texts, and the other way round. This means you can translate the texts independently of the object.” (1)

The OTR is currently supported by the following applications:

  • Web Dynpro for ABAP
  • Business Server Pages
  • Exception Builder
  • HTTP Services
  • Web Services
  • Enhancement Tools

Read also Easy Guide to Translating Task Description and Texts for any Workflow in SAP.

SAP OTR Tcodes

The main OTR Tcodes in SAP are:

  • SOTR_EDIT
  • SE63_OTR

SOTR_EDIT

The transaction code SOTR_EDIT is the Editor for OTR Texts. You can Display, Create and Change OTR Objects using this tcode.

To keep it simple, here a screenshot of what the SOTR_EDIT Transaction looks like:

SOTR_EDIT is the Editor for OTR Texts

SE63/ SE63_OTR

To just remember that the Standard SAP Transaction SE63 is the main transaction for Translation Editor.

To find OTR objects, navigate through
Other Texts > Object Type Selection (Object Groups) > A5 User Interface Texts > LOTR OTR Long Texts

The most Common SAP Function Modules

Here the list of the most useful SAP Function Modules for OTR:

  • SOTR_GET_TEXTS_WITH_KEYS
  • SOTR_GET_CONCEPT
  • SOTR_DELETE_CONCEPT
  • SOTR_OBJECT_GET_OBJECTS
  • SOTR_OBJECT_GET_OBJECTS
  • SOTR_CREATE_CONCEPT
  • OTR_TOOLS_GET_TEXT_VIA_ALIAS

SOTR_GET_TEXTS_WITH_KEYS

SOTR_GET_TEXTS_WITH_KEYS: Holen von Texten anhand der Concept ID und dem Kontext

function SOTR_GET_TEXTS_WITH_KEYS.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(LANGU) TYPE  SYLANGU
*"     VALUE(CONTEXT) TYPE  SOTR_CNTXT
*"     VALUE(REFILL_WITH_SECONDARY_LANGU) TYPE  BAPIFLAG DEFAULT 'X'
*"     VALUE(REFILL_WITH_MASTER_LANGU) TYPE  BAPIFLAG DEFAULT ' '
*"     VALUE(FLAG_CONTEXT) TYPE  AS4FLAG OPTIONAL
*"     VALUE(FLAG_WITH_ALIAS) TYPE  AS4FLAG DEFAULT 'X'
*"  TABLES
*"      SOTR_TERMS STRUCTURE  SOTR_TERM
*"  EXCEPTIONS
*"      NO_ENTRY_FOUND
*"      LANGUAGE_MISSING
*"----------------------------------------------------------------------

SOTR_GET_CONCEPT

The SAP Function module SOTR_GET_CONCEPT will Get all entries to an OTR concept.

Here the signature of SOTR_GET_CONCEPT:

function SOTR_GET_CONCEPT.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     REFERENCE(CONCEPT) LIKE  SOTR_HEAD-CONCEPT
*"  EXPORTING
*"     VALUE(HEADER) LIKE  SOTR_HEAD STRUCTURE  SOTR_HEAD
*"  TABLES
*"      ENTRIES STRUCTURE  SOTR_TEXT OPTIONAL
*"  EXCEPTIONS
*"      NO_ENTRY_FOUND
*"----------------------------------------------------------------------

SOTR_DELETE_CONCEPT

In order to Delete an OTR concept, you can use the standard Function SOTR_DELETE_CONCEPT.

The signature of SOTR_DELETE_CONCEPT is:

function SOTR_DELETE_CONCEPT.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(CONCEPT) LIKE  SOTR_HEAD-CONCEPT
*"     VALUE(IN_UPDATE_TASK) TYPE  AS4FLAG OPTIONAL
*"     VALUE(FLAG_CHECK_USAGE) TYPE  AS4FLAG OPTIONAL
*"     VALUE(FLAG_CHECK_AUTHORITY) TYPE  AS4FLAG OPTIONAL
*"     VALUE(FLAG_CHECK_MASTER) TYPE  AS4FLAG OPTIONAL
*"     VALUE(LANGU) TYPE  SYLANGU DEFAULT SY-LANGU
*"     VALUE(FLAG_CORRECTION_ENTRY) TYPE  AS4FLAG OPTIONAL
*"  EXPORTING
*"     REFERENCE(FLAG_CANCELLED) TYPE  AS4FLAG
*"  EXCEPTIONS
*"      NO_ENTRY_FOUND
*"      TEXT_NOT_FOUND
*"      INVALID_PACKAGE
*"      TEXT_NOT_CHANGEABLE
*"      TEXT_ENQUEUED
*"      NO_CORRECTION
*"      PARAMETER_ERROR
*"----------------------------------------------------------------------

SOTR_OBJECT_GET_OBJECTS

In order to determining the vector to a category of OTR Object, you should use SOTR_OBJECT_GET_OBJECTS.

Here the signature of SOTR_OBJECT_GET_OBJETS:

function SOTR_OBJECT_GET_OBJECTS .
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(OBJECT_VECTOR) TYPE  SOTR_OBJID
*"  EXPORTING
*"     REFERENCE(OBJECTS) TYPE  SOTR_OBJECTS
*"  EXCEPTIONS
*"      OBJECT_NOT_FOUND
*"----------------------------------------------------------------------

SOTR_CREATE_CONCEPT

The standatd function to create an OTR Concept is Creating an OTR concept.

Here the signature of SOTR_CREATE_CONCEPT:

function SOTR_CREATE_CONCEPT.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     REFERENCE(PAKET) TYPE  SOTR_PACK
*"     REFERENCE(CREA_LAN) TYPE  SY-LANGU
*"     REFERENCE(ALIAS_NAME) TYPE  SOTR_ALIAS OPTIONAL
*"     REFERENCE(CATEGORY) TYPE  SOTR_CATY OPTIONAL
*"     REFERENCE(OBJECT) TYPE  TROBJTYPE
*"     VALUE(ENTRIES) TYPE  SOTR_TEXT_TT
*"     REFERENCE(FLAG_CORRECTION_ENTRY) TYPE  AS4FLAG OPTIONAL
*"     REFERENCE(IN_UPDATE_TASK) TYPE  BAPIFLAG OPTIONAL
*"     VALUE(CONCEPT_DEFAULT) TYPE  SOTR_TEXT-CONCEPT OPTIONAL
*"     VALUE(FLAG_COPY_TEXT) TYPE  BTFR_FLAG OPTIONAL
*"  EXPORTING
*"     VALUE(CONCEPT) TYPE  SOTR_TEXT-CONCEPT
*"     VALUE(NEW_ENTRIES) TYPE  SOTR_TEXT_TT
*"----------------------------------------------------------------------

OTR_TOOLS_GET_TEXT_VIA_ALIAS

The Standard Function Module OTR_TOOLS_GET_TEXT_VIA_ALIAS will retrieve the text from Alias.

SAP OTR Tables Related

The main SAP OTR tables are:

  • SOTR_HEAD: Header Table for OTR Texts
  • SOTR_TEXT:Text Table in the OTR
  • OTR_COMM: OTR: Comment for Concept
  • OTR_VOTE: OTR: Voting Result
  • SOTR_ALIA: Global Alias Name Management in the OTR
  • SOTR_ALIAU: Global Alias Name Management in the OTR
  • SOTR_HEADU: Header Table for Strings in the OTR
  • SOTR_INDEX: Index of OTR Entries for Terminology
  • SOTR_LINK: Concaneted OTR Texts
  • SOTR_TEXTU: Text Table in the OTR with Strings
  • SOTR_USE: Where-Used List for OTR Texts
  • SOTR_USEU: Where-Used List for Strings in the OTR

Let’s focus on the main tables SOTR_HEAD and SOTR_TEXT.

SAP OTR Table: SOTR_HEAD

The table SOTR_HEAD is Header Table for OTR Texts.
Note that the key for SOTR_HEAD is the CONCEPT ( Key for Logical Object in OTR ).

The List of fields of SOTR_HEAD are:

  • CONCEPT : Key for Logical Object in OTR
  • PAKET : Package
  • CREA_LAN : Language Key
  • TRALA_TYPE : OTR Translation Class
  • ALIAS_NAME : Unique Alias Name for OTR Concept
  • CREA_NAME : User Name
  • CREA_TSTUT : Timestamp (date and time) related to UTC (GMT)
  • CHAN_NAME : User Name
  • CHAN_TSTUT : Timestamp (date and time) related to UTC (GMT)
  • LST_IMPORT : Date data element for SYST
  • SYSTEM_ID : Name of SAP System
  • TRALA_VEC : Language Vector for Translation Administration
  • CATGY_VEC : Vector of Assigned Categories
  • OBJID_VEC : Vector of Object Types
  • TEXT_TYPE : Type of Referenced Texts

SOTR_TEXT Table

The Text of OTR can be found in SOTR_TEXT table (Text Table in the OTR).

For each entry in SOTR_TEXT, there is 3 keys:

  • CONCEPT:Key for Logical Object in OTR
  • LANGU:Language Key
  • OBJECT:Key for Physical Object in OTR

SAP OTR Translation

As SAP OTR is finally a text, SAP offers a standard way to Internationalize the text. Find also a custom ABAP report useful to translate OTRs in an WebDynPro ABAP.

Check also

SAP OTR Translation via Standard SAP Tcode

It is possible to translate WDY text elements via standard SAP transaction.

  1. Open your Web Dynpro view you want to translate via SE80
  2. Menu: Goto >> Object directory entry. You’ll see object, notice it.
  3. Start transaction SE63
  4. Menu: Translation >> ABAP Objects >> Transport Object
  5. Type in your noticed object at field “Transport Entry of Object” and press Edit.
  6. You’ll see ever single text under your paket entry.

Custom ABAP Code for SAP OTR Translation for WDA (2)

Here the custom ABAP Code that can be used for SAP OTR Transactions ( only OTRs used in WDA).
The following ABAP code is originally posted on SDN.

References & Sources: