10-30-2007 3:43 PM
Hi,
I'm creating a data element and I want it to have a default mask when I use a write statement. eg. sy-datum, when you use write it is printed like 30.10.2007. I know I could use "mask" addition but I'd like to do it automatically.
Thanks in advance,
10-30-2007 3:58 PM
Hello ...
you can create a conversion routine at the domain level.
Try to cretae one for you data element's domain.
Regards,
Naimesh Patel
10-30-2007 3:58 PM
Hello ...
you can create a conversion routine at the domain level.
Try to cretae one for you data element's domain.
Regards,
Naimesh Patel
10-31-2007 5:35 AM
Hi Josie,
I think this will be helpfull to you...
see this
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.