Page tree
Skip to end of metadata
Go to start of metadata

The Online Text Repository (OTR) is used extensively within BSP to handle language dependent texts.

OTR Longtexts in Web Interface Builder

How to use OTR Longtexts in Web Interface Builder

OTR Trimming

Question: While using OTR with HTML with say OTR text's maximum length is 20 (<input type=submit name="back" value="<%=otr(SOTR_VOCABULARY/BACK)%>">), the actual text in the logged on language is 7, the button still has the length of 20 characters and looks really ugly. Is there a kind of workaround for this?

Answer: Use BSP page directive - otrTrim (or older functgion OTR_TRIM()). If this attribute is set to {{'true'}}all OTR texts on the page are condensed (all spaces are removed from beginning and end of the string). For Example:

<%@ page language="abap" '''otrTrim = "true"''' %>
 <% DATA: s TYPE STRING VALUE 'parm'. %>
 [<otr> test line </otr>]                                --> [test line]
 [<otr> before <%=s%> middle <%=s%> end. </otr>]         --> [before parm middle parm end.]
 [<%= otr(sbsp_test/it00_otr_1) %>]                      --> [Das ist ein Test fuer einen Alias-Text]

OTR Text not Displayed

Question: To make the OTR perform at runtime, all texts are cached. Sometimes it happens that texts in a specific language is updated, but this is not reflected in the cache. What will then happen is that the BSP application will still show the text in the wrong langauge or just as a series of cryptic numbers, although correct language texts are available.

Answer: Reset the OTR buffer with /$OTR sequence.

SAP Notes