Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

urgent

Former Member
0 Kudos

Edit Masking,Currency Field

2 REPLIES 2

prasanth_kasturi
Active Contributor
0 Kudos

hi,

Edit masks enable you to:

Insert characters into the output

Move the sign to the beginning of a numeric field

Artificially insert or move a decimal point

Display a floating-point number without using scientific notation

For example, the statement write (6) 'ABCD' using edit mask '_:__:_' writes A:BC:D. Characters are taken from the source field one at a time, and characters from the edit mask are inserted at the points indicated by the mask. The statement write 'ABCD' using edit mask '_:__:_' only writes A:BC because the default output length is equal to the length of the source field (4).

Currency

Assume you go to the bank and ask for 1000. The teller would probably ask you "1000 what?". You might reply "1000 dollars." Or you might be even more specific and ask for "1000 U.S. dollars." Monetary amounts in R/3 are stored in two fields: one to hold the actual numeric amount (1000) and one to hold the currency (USD). The numeric amount field is called the currency field and the other field is called the currency key field.

Currency fields have these requirements:

The data type in the domain must be CURR.

It must be linked to a field of type CUKY containing the currency key, such as USD (US dollars), CAD (Canadian dollars), ITL (Italian lira), and so on.

The currency key is known as the reference field. It is another field in the same or another table. It must have the type CUKY (currency key) in the domain. It indicates the currency key for the currency field that it references.

For example, assume you create a table containing a list of payments made to vendors. You would need a payment amount field (field name wrbtr) and a currency key field (usually waers) to completely indicate the amount and currency key used for that payment. To link the two fields together, you would double-click on the currency field name in the table and then enter the currency key table and field name in the fields Reference Table and Reference Field

reward if helpful

prasanth

former_member208856
Active Contributor
0 Kudos

... EDIT MASK mask

Effect

If a conversion routine is assigned to the data object dobj by refering to a domain in the ABAP Dictionary, two equals signs "==" precede the name of the conversion routine and the result is assigned to the data object mask. If no conversion routine is assigned to the data object, mask is initialized. A character-type data object is expected for mask.

Note

If a data object mask meets these requirements, you can use it in the addition USING EDIT MASK of the statement WRITE to call the conversion routine.

Example

Since the data element S_FLTIME in the ABAP Dictionary is associated with the conversion routine SDURA due to the domain S_DURA, msk contains the value "==SDURA" after DESCRIBE FIELD and the statement WRITE returns the value "5:33" after the conversion from seconds into minutes.

DATA: time TYPE s_fltime,

seconds TYPE i,

msk TYPE string.

DESCRIBE FIELD time EDIT MASK msk.

seconds = 333.

WRITE seconds USING EDIT MASK msk.