Show TOC Start of Content Area

Procedure documentation Defining Currencies  Locate the document in its SAP Library structure

Use

In the package com.sap.dictionary.predefined in the DtDictionary, two simple types are available: currency and currencyNormalized.

The currency type provides different currencies with standard IDs and descriptions. You can also reference a numeric field of the type Decimal to the currency. The selected currency is then displayed in the correct currency format with the relevant number of decimal places. The setting of separators is not taken into account since this results from the country settings of the Web browser.

Choose the currencyNormalized type if the formatting is to correspond to that of the currency specifications in the ERP system.

Prerequisites

You have created a Web Dynpro project and a Web Dynpro component in Developer Studio.

Procedure

...

       1.      In the Dictionary, create a new Simple Type AMOUNT and specify decimal as the Built-in Type.

       2.      Enter 10 for Total Digits and 2 for Fraction Digits.

       3.      Create a structure in the Dictionary and insert the following elements:

       AMOUNT for the amount. Bind this element to the simple type for amount.

       CURRENCY for the currency. For this element, select the type currency from the Simple Type Package com.sap.dictionary.predefined.currency.

This graphic is explained in the accompanying text

Note

If you choose Open Simple from the context menu for this element, you can see the list of available currencies in the Enumeration tab.

       4.      Open the context menu for the AMOUNT element and choose Edit Element.

       5.      Choose CURRENCY as the Reference Element. This enables you to display a UI element bound to AMOUNT in the correct formatting for a selected currency.

Result

You have created the necessary simple types and structures in the Dictionary to be able to use different currency formats.

Once you have bound the context of your view to the structure and the desired UI elements to this context, you can display the different currencies with standard IDs and descriptions and output amounts in the format defined for each currency.

 

End of Content Area