SQL Server administration and T-SQL development, Web Programming with ASP.NET and Javascript, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software Kodyaz SAP and ABAP Programming Resources
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Vista, etc.




Win FREE BOOK
from Kodyaz



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






Recent and Top SAP Tutorial and ABAP Tutorials

Free Adobe LiveCycle Designer Download
Create SAP Dynamic Variant using Date Calculation
Translate Web Dynpro Header Title displayed on Web Browser
ABAP RegEx for ABAP Regular Expression to fetch Date from String
Change Output Condition Records
Web Dynpro Text Translation using Assistance Class
Move Minus Sign from Right to Left of Negative Number in SAP Smartform
Read Address Data using FM ADDR_GET instead of Querying ADRC Table
Add Value Help to Web Dynpro Select Options
Add Web Dynpro Applications to SAP Favorites Menu
Component Usage ALV Does Not Have an Active Component
Web Dynpro Component Service Syntax Error in Program /1BCWDY/O3EC1AX6A3OVKK9L5FXO==CP
Web DynPro Tutorial - Display Spool Requests using Web DynPro Table
Web DynPro Tutorial - How to create Web Dynpro Application (Web Dynpro Component)
Display Data on Web DynPro Table Element
Test Web Dynpro ABAP Component by Creating Web Dynpro Application
Insert SAP Icons and Symbols on Smartform Documents
How to Display Text on Sap Smart Forms
Graphics White Background Displayed Grey on SAP Smartform Output
Get SAP Document Flow using SD_DOCUMENT_FLOW_GET ABAP Function Module
Convert Numeric Value or Currency into String Spell_Amount Function Module
How to Transport SAP Graphics using SE78 Transaction
How to Delete Standard Text using SO10 SAP Transaction
Dynamic Programming using Field Symbols in ABAP Reports
How to Disable Word Editor in SAP Smartform Text
How to Debug Popup Screen in ABAP
TVAP Item Category and SAP Table TVAPT for Text Translations
ABAP Runtime Error ST22 Transaction using Short Dump Analysis
Create Transport Request for Text Translations using RS_LXE_RECORD_TORDER
SAP Invoice Output Determination Analysis for Not Created Output Message
Set Default Single Values List for SAP Selection Screen Parameter
SAP Payment Terms Table and ZTERM Texts Table for ABAP Developers
How to Create SAPScript Text using SO10 Transaction Code
SAP Smartforms Tutorial - Table Calculations using Sum Total
SAP Smartforms Tutorial - Table Calculations using Count
SAP Smartforms Tutorial - How to Create Smartform
SAP NetWeaver Installation Guide using installshield wizard
SAP Smartforms Table for Sales Order and Invoice Outputs
Email Spool Request using SAPOffice - Spool to PDF
How to Display SAP Graphics using SE78 Transaction Code
SAPScript Transaction Codes
ABAP Tutorial - ABAP String Split Example Code
Sales Tables among ABAP Tables (SAP Sales and Distribution SD Tables)
How to Upload Data to SAP from Excel File using alsm_excel_to_internal_table Function Module
ALV Grid Color - Table Row Background Color in ALV List
Multi Color ALV Grid Color Alternate using ALV Layout info_fname Property
How to Debug SmartForms - Debugging SAP SmartForm in ABAP ?
ABAP - Create Hierarchy Tree List using rs_tree_construct, rs_tree_list_display and snodetext
Create CL_GUI_ALV_GRID ALV Grid Column Header using ABAP Data Element
ABAP Tutorial - SAP Split and ABAP Split String Function
Upload Data from Excel File in ABAP using TEXT_CONVERT_XLS_TO_SAP
SAP Tutorial - Convert Spool Request to PDF File using RSTXPDFT4 ABAP Report
SAP ABAP Tutorial - ALV Grid Example with cl_gui_alv_grid and Screen Painter
SAP Smartforms Tutorial - Create Smartforms Example
SAP Smartforms - How to Call Smartform within ABAP Program
Complete List of SAP Modules






Copyright © 2004 - 2012 Eralper Yilmaz. All rights reserved.
Community Server, by Telligent Systems