分享

Creating ABAP Programs for Maintaining Language-Dependent Texts in Web Template

 聊斋恣意 2011-07-14

Creating ABAP Programs for Maintaining Language-Dependent Texts

Use

To make Web applications independent from static texts, you can maintain and translate the text in an ABAP table. The Web application is then filled with the corresponding texts according to the logon language.

Prerequisites

You are in the ABAP Editor (transaction SE38). The standard reporting is SAPLRRSV. The text element lists are the botton drops.

 

To make Web applications independent from static texts, you can maintain and translate the text in an ABAP table. The Web application is then filled with the corresponding texts according to the logon language.

Prerequisites

You are in the ABAP Editor (transaction SE38)

Procedure

  1. In the Program field enter the name of the program, for example ZHTML_TEXTS and in the subobject screen, select Source Code.
  2. Choose This graphic is explained in the accompanying text (Create). You reach the ABAP: Program Properties <Name of Program> Change screen.
  3. Enter the title of the program, for example Web Application Texts.
  4. Under Type in the Attributes field, choose Executable Program and then Save. You reach the Create Object Catalog Entry dialog box.
  5. In the Attributes field under Package enter $TMP and save the program as a Local Object.
  6. You have created an ABAP report called ZHTML_TEXTS

  7. In the menu bar choose Goto ® Text Elements ® Text Symbols. You reach the ABAP Text Elements: Display Text Symbols Language English screen. Choose This graphic is explained in the accompanying text (Create <-> Change).
  8. Enter your texts in the empty table.

    1. In the Sym field enter the numerical key of the new text element (0-999), for example, 001.
    2. In the Text field, enter the name of the text element, for example, Credit Memos.
    3. The dLen field is filled automatically with the actual length of the text you entered, for example, 12 in the case of Credit Memos.

    4. In the mLen field, enter the maximum length of the text field.
    5. Note

      If the maximum length of the text field (mLen) is smaller than the actual length of the text field (dLen), the system asks you whether you want the text to be shortened to the maximum length.

    6. When you have entered all your texts, choose This graphic is explained in the accompanying text (Activate). You reach the ABAP Text Elements: Change Text Symbols Language English screen.
  1. In the menu bar of the ABAP Text Elements: Change Text Symbols Language English, choose Goto ® Translation. You reach the Target Language for Translation screen.
    1. Select the target language, into which you want to translate the texts, for example, DE and choose This graphic is explained in the accompanying text (Continue). You reach the Translation: ABAP Text Pool: <Name of Program> ($) from Language <X> to <Y>, on which your texts and translation proposals from the ABAP text pool are displayed. For example, "Credit Memos" is translated as "Gutschriften". You can transfer the proposals or edit them as you wish.
    2. Background documentation

      The program generated the text translations from the ABAP text pool if corresponding entries are available there. For texts without proposals you have to enter the translation yourself.

    3. Choose Save.

Result

In the Web template, you can now insert the following tag for the example text used here ZHTML_TEXTS: <SAP_BW_TEXT PROGRAM=’ZHTML_TEXTE’ KEY=‘001’>.

The command inserts the text that you maintained with the key 001 in the table, in accordance with the logon language in the Web template, for example as the table title.

<th><SAP_BW_TEXT PROGRAM=‘ZHTML_TEXTE’ KEY=‘001‘></th>

Procedure

  1. In the Program field enter the name of the program, for example ZHTML_TEXTS and in the subobject screen, select Source Code.
  2. Choose This graphic is explained in the accompanying text (Create). You reach the ABAP: Program Properties <Name of Program> Change screen.
  3. Enter the title of the program, for example Web Application Texts.
  4. Under Type in the Attributes field, choose Executable Program and then Save. You reach the Create Object Catalog Entry dialog box.
  5. In the Attributes field under Package enter $TMP and save the program as a Local Object.
  6. You have created an ABAP report called ZHTML_TEXTS

  7. In the menu bar choose Goto ® Text Elements ® Text Symbols. You reach the ABAP Text Elements: Display Text Symbols Language English screen. Choose This graphic is explained in the accompanying text (Create <-> Change).
  8. Enter your texts in the empty table.

    1. In the Sym field enter the numerical key of the new text element (0-999), for example, 001.
    2. In the Text field, enter the name of the text element, for example, Credit Memos.
    3. The dLen field is filled automatically with the actual length of the text you entered, for example, 12 in the case of Credit Memos.

    4. In the mLen field, enter the maximum length of the text field.
    5. Note

      If the maximum length of the text field (mLen) is smaller than the actual length of the text field (dLen), the system asks you whether you want the text to be shortened to the maximum length.

    6. When you have entered all your texts, choose This graphic is explained in the accompanying text (Activate). You reach the ABAP Text Elements: Change Text Symbols Language English screen.
  1. In the menu bar of the ABAP Text Elements: Change Text Symbols Language English, choose Goto ® Translation. You reach the Target Language for Translation screen.
    1. Select the target language, into which you want to translate the texts, for example, DE and choose This graphic is explained in the accompanying text (Continue). You reach the Translation: ABAP Text Pool: <Name of Program> ($) from Language <X> to <Y>, on which your texts and translation proposals from the ABAP text pool are displayed. For example, "Credit Memos" is translated as "Gutschriften". You can transfer the proposals or edit them as you wish.
    2. Background documentation

      The program generated the text translations from the ABAP text pool if corresponding entries are available there. For texts without proposals you have to enter the translation yourself.

    3. Choose Save.

Result

In the Web template, you can now insert the following tag for the example text used here ZHTML_TEXTS: <SAP_BW_TEXT PROGRAM=’ZHTML_TEXTE’ KEY=‘001’>.

The command inserts the text that you maintained with the key 001 in the table, in accordance with the logon language in the Web template, for example as the table title.

<th><SAP_BW_TEXT PROGRAM=‘ZHTML_TEXTE’ KEY=‘001‘></th>.

 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多