Application Development and Automation 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: 
Read only

EDIT MASK

Former Member
0 Likes
22,010

USING { {NO EDIT MASK}|{EDIT MASK mask} }

Explanation to the statement: This addition overrides a conversion routine defined through reference to the ABAP Dictionary. The addition NO EDIT MASK only switches off the execution of an assigned conversion routine. The addition EDIT MASK calls either another conversion routine or defines an edit mask. For mask, a data object of the same name is expected.

This statement is used as an addition to the WRITE command..

But i can't understand what exactly this EDIT MASK does... i came across this EDITMASK in ALV also...

Please explain this..

thanku...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
7,963

Hi,

Edit_mask is To apply the report output formatting options same as in the WRITE statement in report writing.

wa_fcat-edit_mask = '__:__:__'.

wa_fcat-edit_mask = 'DD/MM/YYYY'.

The following example that uses editing template EDIT MASK for the WRITE command shows you how these lengths are specified:

DATA TIME TYPE T VALUE '093017'.

WRITE (8) TIME USING EDIT MASK '__:__:__'. "Output: 09:30:17

In this example, the internal length (of type T) is six characters, while the output length is eight.

The column width (which can be set using the current layout) does not depend on these values and needs not be adjusted accordingly.

Reward If Helpfull,

Naresh

3 REPLIES 3
Read only

Former Member
0 Likes
7,963

Output of a UTC time stamp in Tasmanian time. In daylight-saving time, the output is "28.06.2002 04:00:00".

DATA: time_stamp TYPE timestamp,

tzone TYPE timezone.

time_stamp = 20020627180000.

tzone = 'AUSTAS'.

WRITE / time_stamp TIME ZONE tzone.

... USING { {NO EDIT MASK}|{EDIT MASK mask} }

Edited output of time duration. In the first output, the function module CONVERSION_EXIT_DURA_OUTPUT is executed. This converts the duration specified in seconds into minutes. In the second output, the edit mask is output according to the above rules. However, the underscore characters "_" are replaced by the characters from time.

DATA: dura TYPE i,

time TYPE t VALUE '080000'.

dura = sy-uzeit - time.

time = dura.

WRITE /(30) dura USING EDIT MASK '==SDURA'.

WRITE /(30) time USING EDIT MASK

'RRThe duration is __:__:__'.

This addition overrides a conversion routine defined through reference to the ABAP Dictionary. The addition NO EDIT MASK only switches off the execution of an assigned conversion routine. The addition EDIT MASK calls either another conversion routine or defines an edit mask. For mask, a data object of the same name is expected.

In order to call an arbitrary conversion routine CONV, mask must contain two equals signs, followed directly by the name of the conversion routine: "==CONV". During output, the content of dobj is passed to the function module CONVERSION_EXIT_CONV_OUTPUT, converted there, and then the result is displayed. If the function module is not found, an exception that can be handled is triggered (as of Release 6.10). The statement DESCRIBE FIELD contains an addition in order to fill mask accordingly.

If the output length is specified explicitly with len, the conversion routine is executed for the specified length; otherwise for the implicit output length. If * or ** is specified for the output length, the appropriate rules are used for the converted result.

If the first two characters in mask are not equals signs, the content is interpreted as an edit mask in which some characters have a particular meaning. The WRITE statement does not then output the content of dobj directly, but the character string in mask as follows:

If the first two characters in mask are "LL" or "RR ", these are not output, They control whether the edit mask is left-justified or right-justified. If the first two characters are other characters, the edit mask is left-justified.

All "_" characters are replaced from the left (in the case of "LL") or from the right (in the case of "RR") with characters for character-type types or numbers for the types p or i from dobj. In the case of fields of type c, closing blanks are ignored. Data objects of type f or x are converted into type c before editing. Superfluous characters "_" in mask are replaced by blanks. Characters from dobj for which there are no characters "_" in mask are not displayed.

If dobj is of type i or p, the first character from the left "V" in mask is replaced with "-" in the case of a negative number and by blank in the case of a positive number.

All the other characters of the edit mask are displayed unchanged.

If no output length is specified, the implicit output length of dobj is used. If len is specified for the output length, the value of len is used. If * is specified for the output length, exactly that length that is required for the list display is set. If, in Unicode systems, characters of the edit mask are replaced by characters that take up more than one column on the list, the output length is increased accordingly and the output is filled with blanks in the list buffer. If ** is specified for the output length, double the length of the edit mask mask is used.

If other formatting options are specified concurrently for an edit mask, these are used first and then the special characters in the edit mask are replaced by the interim result. The date masks date_mask are an exception to this. If these are specified, the edit mask is ignored.

Notes

In Unicode systems, you must remember that a character "_"in the edit mask does not necessarily correspond to a column in the list display since the space required in the display depends on the character to be replaced.

The minus sign for a negative number is not displayed if no edit character "V" is specified. The decimal separator of a packed number with decimal places must be specified at the required position in the edit mask.

Regards,

Jagadish

Read only

Read only

Former Member
0 Likes
7,964

Hi,

Edit_mask is To apply the report output formatting options same as in the WRITE statement in report writing.

wa_fcat-edit_mask = '__:__:__'.

wa_fcat-edit_mask = 'DD/MM/YYYY'.

The following example that uses editing template EDIT MASK for the WRITE command shows you how these lengths are specified:

DATA TIME TYPE T VALUE '093017'.

WRITE (8) TIME USING EDIT MASK '__:__:__'. "Output: 09:30:17

In this example, the internal length (of type T) is six characters, while the output length is eight.

The column width (which can be set using the current layout) does not depend on these values and needs not be adjusted accordingly.

Reward If Helpfull,

Naresh