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

reports

Former Member
0 Likes
402

hi to all,

wat is the use of edit mask in reports?

thanx and regards

lokanadhan.k

2 REPLIES 2
Read only

S0025444845
Active Participant
0 Likes
373

Hi,

edit mask is used to write in a particular format.

eg. copy paste n run.

parameters: p_date TYPE sy-datum .

WRITE p_date USING EDIT MASK '__/__/____'.

regards,

sudha

Read only

Former Member
0 Likes
373

Hello,

Check this


Option 
... USING EDIT MASK mask 


Effect 
Outputs f according to the formatting template mask. 
Without this addition, f is output in the standard format for that particular type or with a format defined in the ABAP Dictionary. The addition allows you to define a different format. 



You can specify the formatting template as follows: 



'_'represents one character of the field f 
or one digit with type P or I 


'V'only with fields of type P or I: 
output of leading sign 


'LL'at beginning of template: 

left justify (standard) 


'RR'at beginning of template: 

right justify 


'==conv'perform output conversion conv 


':', ...separator 


(all other characters) 



When formatting, the characters '_' in the template are replaced from the left ( 'LL') or from the right ('RR') by the characters or digits (type P or I) of the field f. 



Notes 
When using a template, you must specify the an explicit output length because otherwise the implicit output length of the field f is used. Usually, the template is longer than the implicit output length. 



If the leading sign is to be output with a field of type P or I, you must specify the wildcard character V at the desired place. If this character does not appear in the template, no leading sign will be output if the value of f is negative. 



When formatting a field of type P with decimal places, the value is not aligned with a character in the template representing the decimal point (either a period or a comma). If you want to have this character in the output, you must insert it in the correct position in the template and define the formatting from the right. If there is no character for the decimal point in the template, no such character is output. 



Fields of type F are first converted to the standard format and the resulting sequence is then copied to the template in the case of a field of type C. 



You implement the user-specific conversion conv with a function module called CONVERSION_EXIT_conv_OUTPUT, e.g. CONVERSION_EXIT_ALPHA_OUTPUT for the conversion of numeric values with leading zeros to a format without leading zeros for type C fields. If a Dictionary field is output and the domain of that field defines a conversion routine, this is executed automatically. For a description of the conversion, refer to the documentation of the appropriate function module. 



Example 
Formatted output of the time: 



DATA TIME TYPE T VALUE '154633'. 

WRITE (8) TIME USING EDIT MASK '__:__:__'.  "Output: 15:46:33 



If the output length "(8)" was not specified here, the output would be "15:46:" because the implicit output length for the type T is 6. 



Option 
... USING NO EDIT MASK 


Effect 
Switches off a conversion routine specified in the ABAP Dictionary. 



Option 
... UNDER g 



Effect 
Output of the field f begins at the column from which the field g was output. If this happens in the same output line, the output of the field g is overwritten. 



Note 
After UNDER, the field g must be written exactly as the reference field in the previous WRITE statement, i.e. with an offset and length if necessary. The exception to this rule is if g is a text symbol. In this case, the reference field is determined by the number of the text symbol (not by the text stored there). 



Example 
Align output to the reference fields: 



FIELD-SYMBOLS <FNAME>. 
ASSIGN 'First Name' TO <FNAME>. 

WRITE: /3 'Name'(001), 15 <FNAME>, 30 'RoomNo', 40 'Age'(002). 
... 
WRITE: /   'Peterson' UNDER 'Name'(001), 
           'Ron'      UNDER <FNAME>, 
           '5.1'      UNDER 'RoomNo', 
       (5) 24         UNDER TEXT-002. 



This produces the following output (numbers appear right-justified in their output fields!): 

   Name          First Name     RoomNo    Age 
   Peterson      Ron            5.1         24 


Regards,

Vasanth