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 SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




CRM Companies List
Web Based CRM Software


Web Dynpro Text Translation using Assistance Class

One of the methods to translate text in Web Dynpro applications is using Assistance Class. In this Web Dynpro tutorial, I'll demonstrate a sample case where an assistance class is used for text translation on a Web Dynpro component.

Let's start by calling SE80 transaction in order to start ABAP Workbench. Then open the Web Dynpro component you have created before.
Double click on Web Dynpro component and chage to Edit mode in the ABAP editor.

Click on the Assistance Class text area.

Assistance Class for Web Dynpro translation

Enter a class name in the Assistance Class textbox. For example I used the name ZWD_BLCKORDERS_TXTCLS.

Click Save button. The ABAP Workbench will ask your permission to create the new assistance class.

create Assistance Class

The class ... does not exist
Create class?

Click Yes button in order to create assistance class for your Web Dynpro application.





After the Assistance Class is created within the Web Dynpro component double click on Assistance Class textbox where you have typed the name of the class.

if_wd_component_assistance~get_text method returns text for model class

Now we can use Assistance Class method IF_WD_COMPONENT_ASSISTANCE~GET_TEXT in order to read the translation of text elements within Web Dynpro ABAP codes.

In order to define text elements, follow the menu options : Goto > Text elements

Goto - Text elements menu options

When the text elements screen is displayed, change to Edit mode to define new text elements.

In this ABAP tutorial, I want to create text elements for radio buttons with Active, InActive and All options. Then we will translate these texts into different target languages.

You can create select options in WDDOINIT method of the MAIN view with following text elements: 011 Active, 012 Inactive, and 013 All

assistance class text symbols for text translation in Web Dynpro

After you have defined the text elements you need for your Web Dynpro component, click Save and then Activate

Below is the ABAP code that Web Dynpro developers can use within the Main View WDDOINIT method source code

DATA ld_text_assistance TYPE string. " read TEXT from assistance class

DATA lo_nd_customerstatus TYPE REF TO if_wd_context_node.
DATA lt_customerstatus TYPE wd_this->elements_customerstatus.
DATA ls_customerstatus LIKE LINE OF lt_customerstatus.

* navigate from <CONTEXT> to <CUSTOMERSTATUS> via lead selection
lo_nd_customerstatus = wd_context->get_child_node( name = wd_this->wdctx_customerstatus ).

*----- Create value key list of different text designs
ls_customerstatus-key = '1'.
ld_text_assistance = wd_assist->if_wd_component_assistance~get_text( '011' ).
ls_customerstatus-value = ld_text_assistance. "'Active'.
APPEND ls_customerstatus TO lt_customerstatus.

ls_customerstatus-key = '0'.
ld_text_assistance = wd_assist->if_wd_component_assistance~get_text( '012' ).
ls_customerstatus-value = ld_text_assistance. "'InActive'.
APPEND ls_customerstatus TO lt_customerstatus.

ls_customerstatus-key = 'A'.
ld_text_assistance = wd_assist->if_wd_component_assistance~get_text( '013' ).
ls_customerstatus-value = ld_text_assistance. "'All'.
APPEND ls_customerstatus TO lt_customerstatus.


*----- Fill context node TEXT_DESIGNS
lo_nd_customerstatus->bind_table( new_items = lt_customerstatus set_initial_elements = abap_true ).

Now ABAP developers are ready to translate text into different target languages using Text Elements Translation menu. When you're displaying Assistance Class choose Goto > Translation from menu options.

choose target language for translation text

Then press Enter to continue with next screen in SAP Text translation
As in text translations in ABAP reports, developers can maintain the translated text into the input text areas left empty for translation value. As you can see the SAP system suggests translation values in the target system below the input text area. You can choose the suggested text by double-click on the suggested translation text.

Web Dynpro assistance class text translation

When you are finished with translation for text defined in the Web Dynpro Assistance Class, save your work and exit application.

When you test your SAP Web Dynpro application on a web browser, you can see that the page title is not translated which is actually the translation of Web Dynpro application description. If this is the case you can also translate Web Dynpro application title on web browser as illustrated in the referenced ABAP tutorial.

As last step, you should create a transport request for text translations in the target system in order to release your changes on test and productive SAP system. Please refer to ABAP tutorial Create Transport Request for Text Translations using RS_LXE_RECORD_TORDER for step by step implementation of exporting text translations into a transport request.






SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table






Related Articles and Tutorials(http://www.kodyaz.com/sap-abap/text-translation-in-web-dynpro.aspx)
ABAP Shared Memory Objects Tutorial with Sample ABAP Code
Call Function Module using RFC Destination in ABAP
Display Data on Web DynPro Table Element
Find Web Dynpro Class Name to Search in ABAP Code
Remove ALV Buttons on SAP Web Dynpro Component
Web Dynpro Text Translation using Assistance Class
Translate Web Dynpro Header Title displayed on Web Browser
Export SAP Data to Fixed Length Text File
How to Clear Web Dynpro Cache
Main program for include RV61Bxxx not found
Export Table Contents into Text File and Download File
Set Page Title in Web Dynpro Application
How to Set Start Transaction in SAP GUI
Trigger ALV Events in Web Dynpro Component
SAP Web Dynpro ALV Tutorial
Read Checkbox Value in Web Dynpro Editable ALV
Add Value Help to Web Dynpro Select Options
SAP Web Dynpro Service Cannot be Reached Error
Function module is not released for the Internet
Convert Smartform to PDF in Print Preview Mode
Add Button to ALV Table Header on SAP Web Dynpro
Free Adobe LiveCycle Designer Download
Traffic Lights in SAP Web Dynpro ALV Table
Create Business Object in SAP
Delete All Data from SAP Database Table
Display Adobe Form in SAP Web Dynpro
Connect SAP from Eclipse using ABAP Project
Complete List of SAP Modules
Email Spool Request using SAPOffice - Spool to PDF
How to Upload Data to SAP from Excel File using alsm_excel_to_internal_table Function Module
Upload Data from Excel File in ABAP using TEXT_CONVERT_XLS_TO_SAP
How to Create SAPScript Text using SO10 Transaction Code
How to Display SAP Graphics using SE78 Transaction Code
SAP Tutorial - Convert Spool Request to PDF File using RSTXPDFT4 ABAP Report
ABAP Debugging using Log Point and Break Point
ABAP Runtime Error ST22 Transaction using Short Dump Analysis
Add Web Dynpro Applications to SAP Favorites Menu
ABAP Authority-Check Object For User Other Than Current
Change Fields for Selection in SE11 ABAP Data Browser
Compare Code in ABAP using SE39 SplitScreen Editor
Component Usage ALV Does Not Have an Active Component
Convert the table using the Database Utility (SE14)
Convert Sales Unit into Text using Function Module in Target Language
ABAP Code Inspector Check Variants for HANA Migration Optimization
Prevent DYNPRO_SEND_IN_BACKGROUND Error in Background Process
Enable Remote Debugging in ABAP using RSRDEBUG
How to Execute SAP Program in Background Task
Create SAP Dynamic Variant using Date Calculation
Create Scheduled Job using SAP SM36 Transaction
Create Search Help in ABAP for Web Dynpro Component
Create Transaction Code for Web Dynpro Application
Create SAP Transaction to Maintain ABAP Table using SM30
Create Transport Request for Text Translations using RS_LXE_RECORD_TORDER
List Locks in SAP system using SM12 Transaction Code
Display and Download Adobe Form as PDF File in SAP Web Dynpro
Export Graphics from SE78 SAP Form Graphics Administration using ABAP program
How to Export IDOC as Excel and Save as Local File from WE02 Transaction
Export SAP Spool Requests as PDF using SP01 Transaction
How to Find SAP Role Users Assigned for Transaction Code
Web DynPro Tutorial - How to create Web Dynpro Application (Web Dynpro Component)
How to Delete Standard Text using SO10 SAP Transaction
How to Find User Exits in ABAP Codes of SAP Transaction
Test Web Dynpro ABAP Component by Creating Web Dynpro Application
How to Transport SAP Graphics using SE78 Transaction
Import and Export SO10 Standard Text using RSTXSCRP ABAP Program
Business Document Service Error: Error when accessing graphic (BDS), RC = 5
Get SAP Document Flow using SD_DOCUMENT_FLOW_GET ABAP Function Module
SAP Purchase Order Tables, Transaction Codes and Output
Graphics White Background Displayed Grey on SAP Smartform Output
SE63 Smartform Translation and Export using SLXT Program
Search and Find SAP Transaction Code using SE93 or SEARCH_SAP_MENU
Unicode Character Problem in IFS File Interface
Transport Variants of an ABAP Program into Workbench Request
TVAP Item Category and SAP Table TVAPT for Text Translations
Unlock Objects Locked in Request or Task using Transport Organizer Tools
Update Database Table Data using ABAP SE16N_INTERFACE
VF31 SAP Transaction to Reprocess Billing Output Messages
SAP Web Dynpro File Upload using GOS cl_fitv_gos Class
Web Dynpro Component Service Syntax Error in Program /1BCWDY/O3EC1AX6A3OVKK9L5FXO==CP
Web DynPro Tutorial - Display Spool Requests using Web DynPro Table


Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems