Ensure Your Custom SAP Objects can be Used Globally

For most organizations and companies that expand into other countries, it may become necessary to ensure that your SAP system is user friendly towards the new country’s users.  This means that the screens and reports that the new international users will see need to be displayed in their own language.  With standard delivered SAP, this functionality is included in the system.  However, for any custom reports, screens, and Web Dynpro screens, this will need to be remembered and accounted for.

The following are some tips to remember when developing with a global perspective in mind.

  1. When coding ABAP programs, text should never be hard coded in the program.  Any texts that should appear on the Selection Screen or on reports should be put in the Text Elements and translated.  The text can be hard coded in the program and a Text Element Number can be included.  When this is done and if the text is not found in the text elements in the language the user happens to be logged in as, the hard coded text in the program will be displayed.

As an example, the following shows a hard coded text with Text Element numbers associated with them:

figure1

To add these texts to the Text Elements, either double click on the number in the parentheses, or select the menu option Goto -> Text Elements.  Once the item has been entered in the Text Elements, it can be translated into any language by selecting the menu option Goto -> Translation and selecting the language to translate to and pressing Enter.  Then the translation for the text can be entered and saved in the language(s) that you need as shown below:

figure2

  1. When creating error messages, the message table should be used instead of hard coding the message in the program.  Messages can be created using transaction SE91.  These messages can then be translated into the desired language using the same method described above for the Text Elements.
  2. Web Dynpro components should use the On-Line Text Repository (OTR).  Instead of hard coding the texts on the screen, these text values can be stored in the OTR and then translated to the desired language.

To create entries in the OTR, use transaction SOTR_EDIT.  Then select the language to create the entry in and enter an Alias name to store it under and click on the Create button.

On the next screen, enter the package to store it under, the object type (usually WDYV for Web Dynpro View) and the text and save it.

Once the text has been entered, it can be translated into another language by selecting Edit->Context->Change.  Then press Enter to bypass the popup window that asks for Country and Industry. Then change the language to the desired language, change the text to the desired language and save again.

To assign this text to an object in Web Dynpro, select the drop down box in the text property as shown below.

figure3Then select the OTR element to use and from the popup window.

figure4The form in Web Dynpro will then show the text of the element in the language the user is logged in.

figure5

This entry was posted in Talk Techie to Me. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s