SAP Online Text Repository (OTR): SAP OTR Tcodes, Tables, Function and Translation
What’s OTR in SAP ?
“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.
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
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:

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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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:
1 2 3 4 5 6 7 8 9 10 11 12 | 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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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:
1 2 3 4 5 6 7 8 9 10 | 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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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.
SOTR_HEAD Table
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 OTR is finally a text, SAP offers a standard way to Internatinalize the text. Find also a custom ABAP report usefull to translate OTRs in an WebDynPro ABAP.
Check also
- Step by Step tutorials How to translate SAP Smartforms ?
- How to Translate Task Description and Texts for any Workflow in SAP ?
OTR Translation via Standard SAP Tcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 | *&---------------------------------------------------------------------* *& Report ZGGAR_WDA_OTR_TRANSLATE *& *& Inspired from: https://wiki.sdn.sap.com/wiki/display/WDABAP/OTR+Text+Translation+Tool+for+Web+Dynpro+ABAP *& *& Transaction: SOTR_EDIT -> use it at your own (psycho) risks *& *& WDCA Web Dynpro Application Configuration *& WDCC Web Dynpro Component Configuration *& WDYA Web Dynpro Application *& WDYC Controller (Web Dynpro) *& WDYD Definition (Web Dynpro) *& WDYV View (Web Dynpro) *&---------------------------------------------------------------------* REPORT zggar_wda_otr_translate. INCLUDE: <color>. TABLES: wdy_component. CONSTANTS: g_display_mode TYPE bapiflag VALUE 'D', g_translate_mode TYPE bapiflag VALUE 'T'. ********************************************************************** * Global Types Declaration * ********************************************************************** TYPES: BEGIN OF gsty_wd_out_tab, btn_01 TYPE c LENGTH 10, " Translate hyperlink btn_02 TYPE c LENGTH 10, " Concept hyperlink component_name TYPE wdy_component_name, view_name TYPE wdy_view_name, src_language TYPE i, tgt_language TYPE i, not_translated TYPE i, row_color_tab TYPE lvc_t_scol, END OF gsty_wd_out_tab. TYPES: gtty_wd_out_tab TYPE TABLE OF gsty_wd_out_tab. TYPES: BEGIN OF gsty_wdy_cname_f4, component_name TYPE wdy_component_name, description TYPE wdy_md_description, END OF gsty_wdy_cname_f4. TYPES: ty_t_langu TYPE TABLE OF sy-langu. ********************************************************************** * CLASS lcl_handle_events DEFINITION ********************************************************************** * ********************************************************************** CLASS lcl_handle_events DEFINITION. PUBLIC SECTION. METHODS: on_link_click FOR EVENT link_click OF cl_salv_events_table IMPORTING row column, on_double_click FOR EVENT double_click OF cl_salv_events_table IMPORTING row column. METHODS: open_worklist IMPORTING i_row TYPE salv_de_row i_column TYPE salv_de_column, open_concepts IMPORTING i_row TYPE salv_de_row i_column TYPE salv_de_column, check_translations IMPORTING i_langu TYPE sy-langu it_langus TYPE ty_t_langu i_column TYPE salv_de_column RETURNING value(r_continue) TYPE xfeld. ENDCLASS. "lcl_handle_events DEFINITION ********************************************************************** * Global Data Declaration * ********************************************************************** DATA: gt_wd_otr TYPE gtty_wd_out_tab. DATA: go_event_handler TYPE REF TO lcl_handle_events. DATA: g_object_name TYPE trobj_name, gt_sotr_usage TYPE sotr_use_tt, gt_worklist TYPE sotr_wrkls_tt, gt_texts TYPE sotr_strings, g_context TYPE sotr_cntxt. DATA: gt_celltab TYPE lvc_t_styl. DATA: go_otr_class TYPE REF TO cl_sotr_string_maintain. FIELD-SYMBOLS: <fs_sotr_usage> LIKE LINE OF gt_sotr_usage, <fs_worklist> LIKE LINE OF gt_worklist, <fs_row_color> TYPE lvc_s_scol. ********************************************************************** * SELECTION SCREEN * ********************************************************************** SELECTION-SCREEN: BEGIN OF BLOCK b1. SELECT-OPTIONS: pcname FOR wdy_component-component_name OBLIGATORY. PARAMETERS: p_srclan TYPE sy-langu MATCHCODE OBJECT h_t002 OBLIGATORY DEFAULT 'E'. PARAMETERS: p_tgtlan TYPE sy-langu MATCHCODE OBJECT h_t002 OBLIGATORY DEFAULT 'F'. *PARAMETERS: p_all RADIOBUTTON GROUP trad DEFAULT 'X', * p_not_t RADIOBUTTON GROUP trad, * p_trad RADIOBUTTON GROUP trad. SELECTION-SCREEN SKIP. PARAMETERS: p_count AS CHECKBOX DEFAULT 'X'. *PARAMETERS: p_devcls TYPE sotr_pack DEFAULT 'ZMMO'. SELECTION-SCREEN: END OF BLOCK b1. ********************************************************************** * SEARCH HELP * ********************************************************************** AT SELECTION-SCREEN ON VALUE-REQUEST FOR pcname-low. * Create Search Help DATA: lt_wdy_component TYPE TABLE OF gsty_wdy_cname_f4. FIELD-SYMBOLS:<lw_wdy_component> TYPE gsty_wdy_cname_f4. SELECT * FROM wdy_component INTO CORRESPONDING FIELDS OF TABLE lt_wdy_component WHERE component_name IN pcname. LOOP AT lt_wdy_component ASSIGNING <lw_wdy_component>. SELECT SINGLE * FROM wdy_componentt INTO CORRESPONDING FIELDS OF <lw_wdy_component> WHERE component_name = <lw_wdy_component>-component_name AND langu = sy-langu. ENDLOOP. CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' EXPORTING retfield = 'COMPONENT_NAME' dynprofield = 'PCNAME' dynpprog = sy-cprog dynpnr = sy-dynnr value_org = 'S' TABLES value_tab = lt_wdy_component. ********************************************************************** * Text Initialization * ********************************************************************** INITIALIZATION. %_pcname_%_app_%-text = 'WD Component Name'. %_p_srclan_%_app_% = 'Source Language'. %_p_tgtlan_%_app_% = 'Destination Language'. %_p_count_%_app_% = 'Count entries'. * %_p_all_%_app_% = 'All texts'. * %_p_not_t_%_app_% = 'Not translated'. * %_p_trad_%_app_% = 'Translated'. * %_p_devcls_%_app_% = 'Development class'. ********************************************************************** * START of SELECTION * ********************************************************************** START-OF-SELECTION. DATA: gr_table TYPE REF TO cl_salv_table, gr_display TYPE REF TO cl_salv_display_settings, gr_functions TYPE REF TO cl_salv_functions, gr_events TYPE REF TO cl_salv_events_table, gr_columns TYPE REF TO cl_salv_columns_table, gr_column TYPE REF TO cl_salv_column_table, l_color TYPE lvc_s_colo. FIELD-SYMBOLS:<lw_wd_otr> TYPE gsty_wd_out_tab. ** Initialisation g_context-last_rel = sy-saprl. ** Récupération SELECT * FROM wdy_view INTO CORRESPONDING FIELDS OF TABLE gt_wd_otr WHERE component_name IN pcname AND version = 'A' AND type = 'CL_WDY_MD_VIEW'. LOOP AT gt_wd_otr ASSIGNING <lw_wd_otr>. <lw_wd_otr>-btn_01 = 'Translate'. <lw_wd_otr>-btn_02 = 'Concepts'. IF p_count IS NOT INITIAL. CONCATENATE <lw_wd_otr>-component_name '%' <lw_wd_otr>-view_name INTO g_object_name RESPECTING BLANKS. * CONDENSE g_object_name NO-GAPS. CALL FUNCTION 'SOTR_USAGE_READ' EXPORTING pgmid = 'LIMU' object = 'WDYV' obj_name = g_object_name IMPORTING sotr_usage = gt_sotr_usage EXCEPTIONS no_entry_found = 1 error_in_pgmid = 2 OTHERS = 3. IF gt_sotr_usage[] IS NOT INITIAL. SELECT COUNT( * ) FROM sotr_text INTO <lw_wd_otr>-src_language FOR ALL ENTRIES IN gt_sotr_usage WHERE concept = gt_sotr_usage-concept AND langu = p_srclan * AND object = . SELECT COUNT( * ) FROM sotr_text INTO <lw_wd_otr>-tgt_language FOR ALL ENTRIES IN gt_sotr_usage WHERE concept = gt_sotr_usage-concept AND langu = p_tgtlan * AND object = . <lw_wd_otr>-not_translated = <lw_wd_otr>-src_language - <lw_wd_otr>-tgt_language. IF <lw_wd_otr>-not_translated <> 0. APPEND INITIAL LINE TO <lw_wd_otr>-row_color_tab ASSIGNING <fs_row_color>. IF <lw_wd_otr>-src_language > <lw_wd_otr>-tgt_language. <fs_row_color>-fname = 'TGT_LANGUAGE'. ELSE. <fs_row_color>-fname = 'SRC_LANGUAGE'. ENDIF. <fs_row_color>-color-col = col_negative. <fs_row_color>-color-int = 0. <fs_row_color>-color-inv = 0. ENDIF. ENDIF. *** Source language: comptage des entrées * CREATE OBJECT go_otr_class * EXPORTING * i_langu = p_srclan * i_context = g_context * i_paket = g_devclass * i_pgmid = 'LIMU' * i_object = 'WDYV' * i_objname = g_object_name. * * REFRESH: gt_texts. * CALL METHOD go_otr_class->get_strings_for_object * IMPORTING * e_texts = gt_texts. * * <lw_wd_otr>-src_language = LINES( gt_texts ). ENDIF. ENDLOOP. * Create ALV table cl_salv_table=>factory( IMPORTING r_salv_table = gr_table CHANGING t_table = gt_wd_otr ). * Set zebra layout gr_display = gr_table->get_display_settings( ). gr_display->set_striped_pattern( cl_salv_display_settings=>true ). * Display all standard function gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). * Set the column BTN_01 as a link to tranlate gr_columns = gr_table->get_columns( ). gr_column ?= gr_columns->get_column( 'BTN_01' ). l_color-col = '4'. l_color-int = '1'. l_color-inv = '0'. gr_column->set_color( l_color ). gr_column->set_cell_type( 5 ). gr_column ?= gr_columns->get_column( 'BTN_02' ). l_color-col = '4'. l_color-int = '1'. l_color-inv = '0'. gr_column->set_color( l_color ). gr_column->set_cell_type( 5 ). * Source and target count gr_column ?= gr_columns->get_column( 'BTN_01' ). gr_column->set_short_text( 'Translate' ). gr_column ?= gr_columns->get_column( 'BTN_02' ). gr_column->set_short_text( 'Concepts' ). gr_column ?= gr_columns->get_column( 'SRC_LANGUAGE' ). gr_column->set_short_text( 'Src lang.' ). gr_column ?= gr_columns->get_column( 'TGT_LANGUAGE' ). gr_column->set_short_text( 'Trgt lang.' ). gr_column ?= gr_columns->get_column( 'NOT_TRANSLATED' ). gr_column->set_short_text( 'Not transl' ). gr_column->set_medium_text( 'Not translated' ). * Color gr_columns->set_color_column( 'ROW_COLOR_TAB' ). * Set event hadler gr_events = gr_table->get_event( ). CREATE OBJECT go_event_handler. SET HANDLER go_event_handler->on_link_click FOR gr_events. SET HANDLER go_event_handler->on_double_click FOR gr_events. * Set event hadler gr_table->display( ). ********************************************************************** * CLASS lcl_handle_events IMPLEMENTATION ********************************************************************** * ********************************************************************** CLASS lcl_handle_events IMPLEMENTATION. METHOD on_link_click. CASE column. WHEN 'BTN_01'. CALL METHOD me->open_worklist( i_row = row i_column = column ). WHEN 'BTN_02'. CALL METHOD me->open_concepts( i_row = row i_column = column ). ENDCASE. ENDMETHOD. "on_link_click METHOD on_double_click. DATA: l_object_name TYPE trobj_name. DATA: lw_wd_compview TYPE gsty_wd_out_tab. DATA: lt_langus TYPE TABLE OF sy-langu. CASE column. WHEN 'SRC_LANGUAGE'. CALL METHOD me->open_worklist( i_row = row i_column = column ). WHEN 'TGT_LANGUAGE' OR 'NOT_TRANSLATED'. REFRESH: gt_worklist. LOOP AT gt_sotr_usage ASSIGNING <fs_sotr_usage>. ** Vérification du texte traduit dans la langue cible REFRESH: lt_langus. SELECT langu FROM sotr_text INTO TABLE lt_langus WHERE concept = <fs_sotr_usage>-concept AND ( langu = p_srclan OR langu = p_tgtlan ). IF me->check_translations( i_langu = p_tgtlan it_langus = lt_langus[] i_column = column ) IS NOT INITIAL. CONTINUE. ENDIF. APPEND INITIAL LINE TO gt_worklist ASSIGNING <fs_worklist>. MOVE <fs_sotr_usage>-concept TO <fs_worklist>-concept. IF <fs_sotr_usage>-lfd_num IS INITIAL. <fs_sotr_usage>-lfd_num = 1. ENDIF. MOVE <fs_sotr_usage>-lfd_num TO <fs_worklist>-lfd_num. ENDLOOP. * CHECK gt_worklist[] IS NOT INITIAL. CALL FUNCTION 'SOTR_EDITOR_WORKLIST' EXPORTING edit_mode = g_translate_mode source_langu = p_srclan target_langu = p_tgtlan CHANGING worklist = gt_worklist[] EXCEPTIONS no_entry_found = 1 error_in_context = 2 error_in_replacement_term = 3 edit_mode_not_supported = 4 no_authorization = 5 internal_error = 6 error_in_transport_request = 7 OTHERS = 8. ENDCASE. ENDMETHOD. "on_double_click METHOD open_worklist. DATA: l_object_name TYPE trobj_name. DATA: lw_wd_compview TYPE gsty_wd_out_tab. READ TABLE gt_wd_otr INTO lw_wd_compview INDEX i_row. CONCATENATE lw_wd_compview-component_name '%' lw_wd_compview-view_name INTO l_object_name RESPECTING BLANKS. * CONDENSE l_object_name NO-GAPS. CALL FUNCTION 'SOTR_API_WB_TRANSLATE' EXPORTING source_langu = p_srclan target_langu = p_tgtlan pgmid = 'LIMU' object = 'WDYV' obj_name = l_object_name EXCEPTIONS no_entry_found = 1 internal_error = 2 no_authorization = 3 error_in_context = 4 user_cancelled = 5 error_in_transport_request = 6 OTHERS = 7. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDMETHOD. "open_worklist METHOD open_concepts. DATA: l_object_name TYPE trobj_name. DATA: lw_wd_compview TYPE gsty_wd_out_tab. DATA: ls_entry TYPE sotr_entry, ls_entry_key TYPE SOTR_KEY, ls_extry_text TYPE sotr_textu, ls_object TYPE sotr_objec, lv_subrc TYPE sy-subrc. DATA: lt_sotr_trees TYPE sotr_trees, ls_sotr_tree LIKE LINE OF lt_sotr_trees. FIELD-SYMBOLS: <l_field> TYPE ANY. READ TABLE gt_wd_otr INTO lw_wd_compview INDEX i_row. CONCATENATE lw_wd_compview-component_name '%' lw_wd_compview-view_name INTO l_object_name RESPECTING BLANKS. * CONDENSE l_object_name NO-GAPS. REFRESH: lt_sotr_trees. SELECT * FROM sotr_use AS u JOIN sotr_text AS t ON ( u~concept = t~concept ) JOIN sotr_head AS f ON ( f~concept = t~concept ) INTO CORRESPONDING FIELDS OF TABLE lt_sotr_trees WHERE u~object = 'WDYV' AND u~obj_name LIKE l_object_name AND u~lfd_num = '0001' AND t~langu = p_srclan AND t~flag_com = space. CHECK lt_sotr_trees[] IS NOT INITIAL. CLEAR: ls_sotr_tree. CALL FUNCTION 'SOTR_F4_HELP' EXPORTING sotr_trees = lt_sotr_trees display_mode = 'PAKET' IMPORTING * entry_selected = l_entry_key tree = ls_sotr_tree EXCEPTIONS no_entry_found = 1 OTHERS = 2. *-- just call an insignificant routine to load the SAPLSOTR_EDIT PERFORM check_string IN PROGRAM saplsotr_edit USING ls_extry_text " dummy ls_object " dummy CHANGING lv_subrc " dummy IF FOUND. " version 7.40? PERform send_db_message IN PROGRAM saplsotr_edit using lv_subrc " dummy sy-langu IF FOUND. * l_entry-concept = '4F320C0245EF00EBE1008000C0A8BFA3'. * l_entry-langu = 'E'. * l_entry-object = 'WDYV'. * l_entry-lfd_num = '0001'. * l_entry-paket = 'ZHROM'. * l_entry-crea_name = 'FRX30520'. * l_entry-crea_tstut = '20120208103729'. * l_entry-chan_name = 'FRX30520'. * l_entry-chan_tstut = '20120208103839'. * l_entry-length = '032'. * l_entry-text = 'Age Structure Diagram'. ** Now program SAPLSOTR_EDIT has been loaded into memory, let's hack into its global variables !! ASSIGN ('(SAPLSOTR_EDIT)G_DYNP_0100-RAD_T') TO <l_field>. IF <l_field> IS ASSIGNED. <l_field> = 'X'. " required to set the SUBDYNPRO to '0205' (short text) ENDIF. ASSIGN ('(SAPLSOTR_EDIT)GL_MODE') TO <l_field>. IF <l_field> IS ASSIGNED. <l_field> = 'M'. " required to access MAINTAIN mode ENDIF. ASSIGN ('(SAPLSOTR_EDIT)G_LANGU') TO <l_field>. IF <l_field> IS ASSIGNED. <l_field> = p_srclan. " required to avoid CHECK messages ENDIF. CLEAR: ls_entry. MOVE-CORRESPONDING ls_sotr_tree to ls_entry. PERFORM call_screen_200 IN PROGRAM saplsotr_edit USING ls_entry 'E' '*' '*'. ENDMETHOD. "open_worklist METHOD check_translations. CASE i_column. WHEN 'NOT_TRANSLATED'. READ TABLE it_langus TRANSPORTING NO FIELDS WITH KEY table_line = i_langu. IF sy-subrc = 0. " traduit r_continue = 'X'. " pas d'ajout à la liste de travail ENDIF. WHEN 'TGT_LANGUAGE'. READ TABLE it_langus TRANSPORTING NO FIELDS WITH KEY table_line = i_langu. IF sy-subrc <> 0. " pas traduit r_continue = 'X'. " pas d'ajout à la liste de travail ENDIF. ENDCASE. ENDMETHOD. "check_translations ENDCLASS. "lcl_handle_events IMPLEMENTATION |
References & Sources:
- (1) Online Text Repository (OTR)
- (2) Translate OTR in WDA 1 & 2
- (*) Transporting OTR Objects in SAP
It is possible to translate WDY text elements via standard SAP transaction.
Custom ABAP Code for OTR Translation for WDA (2)
Here the custom ABAP Code that can be used for OTR Transactions ( only OTRs used in WDA).
The following ABAP code is originally posted on SDN.