Multilanguage Records in the Database SAP ABAP Web Dynpro

In this case,we make Multilanguage the records we store in a database table.We create a very simple example to show how we can store data in a database table,not only in the log-on language,and then we create the User Interface in Web Dynpro to see how we can process these data.

We copy the table YEU_COUNTRIES and rename it YEU_I18N. Our target is to be able to store the political system for each EU Country not only in English,but in German,too.

Study an Example Created in the System

Before creating our own example,we shall briefly explain the table structure we are going to build.In this respect,we study a simple example presented in the system,starting with the search of a text table.A text table usually has the suffix T and contains an explanatory text in several languages,for each key.With the transaction SE11 ,we display all the tables that end in “_T”.

Searching to find a text table

From the list that appears,we choose to see the structure of the text table for Text Table for Release/Lock object Handling.As we can see,we have a Field named SPRAS of SPRAS type that represents the Language Key and two fields BEZ(description)and KURZBEZ(short description) that contain an explanatory text in several languages,for each FSOBJANL key.In this case,we have support for German and English, so we have the translation in two languages(E – English,D –German) for each key. Let’s look at the foreign key relationship:As we can see, this table is a text table for the table /BEV3/CHCTFSOS The structure of this table is presented.The table /BEV3/CHCFSOS_T is a text table for /BEV3/CHCTFSOS.If we study both tables,we see that the text table additionally contains a language key.

Text table structure

The content of a text table

Foreign key relationship

Table /BEV3/CHCFSOS

field and two extra Fields that contain an explanatory text in English and in German,for each key entry of /BEV3/CHCTFSOS.Let’s look at the structure of the table /BEV3/CHCFSOBJS.

Structure of the table /BEV3/CHCFSOBJS

For our purpose,in this case it is interesting the Field FSOBJANL.As we can see,this field has an foreign key defined to /BEV3/CHCTFSOS.

Creating Table Structures and Internationalization of the Records

For our example,we create the same structure as the one presented above,but with only one explanatory text for the political system per each EU Country. The table YEU_I18N has the structure presented.

YEU_I18N table

The Field POLITICALSYSTEM has defined an foreign key to the table YKEY that holds only the ID of the politicalsystem.

Key table

Text table

To link the politicalsystem key with the descriptions included in the text table, we have to link the table YKEY_T with the tableYKEY by using a foreign key.

Foreign key

Now,we have to maintain the data that refer to an object and are technically distributed between the tables YKEY and YKEY_T.

Maintaining data in the tables YKEY and YKEY_T

To realize this,we create a Maintenance View.Call transaction SE11,enter the name of the new maintenance view in the field VIEW and press CREATE.At the next popup window choose the kind of view we want to create.In our case “Maintenance View”. Enter the tablenames as shown below and pres button“Relationships”.In our case we can accept the suggestion. The View Fields are presented.After this,we choose from the menu Utilities --> Table Maintenance Generator ,to generate table maintenance.

Maintenance view

View fields

Generating maintenance view

We go back to the Maintenance View and we choose from the menu Utilities --> Contents.

Insert content

New entries

We insert three political systems and then we translate them in German.To do this,we select the entry we want to translate and we choose from the menu Goto --> Translation.

Translating records

Using the Internationalized Records in WebDynpro

Through a Web Dynpro application,we create a mini-administration User Interface for our table YEU_I18N.The view layout and the context node are presented.

View layout and context node

The context node has the dictionary structure YEU_I18N.The runtime result is presented.

Internationalization – database records

To select the values from the database according to the log-on language,we create a database view in the ABAP Dictionary and perform a selection,where spras sy-langu: SELECT * FROM y_i18nv INTO TABLE lt_i18nv WHERE spras = sy-langu.

We create a context node named I18NSELECT that has,as dictionary structure the view “Y_I18NV”that we have created in the ABAP Dictionary.

Database view and context node

Runtime



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SAP ABAP Web Dynpro Topics