SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

Read Text Symbols in Specific Language using ABAP RS_TEXTPOOL_READ

This ABAP tutorial shows to read text symbols of an ABAP program or class code in specified target language translation using RS_TEXTPOOL_READ function module. SAP developers can use ABAP function module rs_textpool_read within their ABAP codes to read text symbols defined in any ABAP program or class in the required language translation.

ABAP RS_TEXTPOOL_READ Function Module

ABAP programmers can execute rs_textpool_read function module using SE37. After "rs_textpool_read" is entered in the function module name text, press F8 to execute the ABAP function module.

use ABAP function module RS_TEXTPOOL_READ to read text symbols

When the test function module initial screen is displayed, enter the following import parameters with corresponding values.

ObjectName is the name of the ABAP program or ABAP class where the text symbols and translations are defined.
Action should be changed from EDIT to DISPLAY
Language is the import parameter where the developer defines which translation of the text symbols is requested.

ABAP function module RS_TEXTPOOL_READ for reading text symbols

When you execute the function module using F8 after the import parameters are provided to read the desired language of text symbols translation of the target ABAP report, the TPOOL output table parameter will be populated with translated text symbol data.

ABAP TPOOL structure returning text symbol for specific language


Sample ABAP Program to Read Text Symbols in Specific Language

If as an ABAP programmer, you want to read text symbol translation in a specific language programmatically, below ABAP code block can be used as a starting code tutorial. Developers will realize that a table type variable of structure textpool is used for fetching text element translations into an internal table using RS_TEXTPOOL_READ ABAP function module.

Later text symbol translations are read into an internal table, ABAP READ command can be used to get the specific text using KEY for filter and ENTRY for the text itself.

DATA lt_text TYPE TABLE OF textpool.
DATA ls_text TYPE textpool.

CALL FUNCTION 'RS_TEXTPOOL_READ'
 EXPORTING
  objectname = 'ZEY_READ_TEXT'
  action = 'DISPLAY'
* AUTHORITY_CHECK = ' '
  language = 'T'
 TABLES
  tpool = lt_text
* EXCEPTIONS
* OBJECT_NOT_FOUND = 1
* PERMISSION_FAILURE = 2
* INVALID_PROGRAM_TYPE = 3
* ERROR_OCCURED = 4
* ACTION_CANCELLED = 5
* OTHERS = 6
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

READ TABLE lt_text INTO ls_text WITH KEY key = 'T02'.
IF sy-subrc = 0.
 WRITE ls_text-entry.
ENDIF.
Code


SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.