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

using edit mask

Former Member
0 Likes
2,991

Hi All ,

         Firstly my question is can we use  USING EDIT MASK statement only in write statement . My requirement is i need to display 9291651500 as (92)9165-1500 . i achieved this by following code

DATA  w_celular(20) TYPE c VALUE '9291651500'.

WRITE w_celular USING EDIT MASK '(__)____-____'.

Issue is i dont want to display the number . Please help if  there is any other way to do this .

regards

Kishore

12 REPLIES 12
Read only

matt
Active Contributor
0 Likes
1,813

You don't want to display the number? Do you mean that you want to get the formatted value into another variable? Perhaps WRITE... INTO is what you need.

Read only

Former Member
0 Likes
1,813

Hi Matthew ,

                 I dont want to print the value as i am moving it to another variable here is the code

move w_celular to TI_DADOS-celular .

Regards,

Kishore

Read only

matt
Active Contributor
0 Likes
1,813

And does WRITE INTO not do the job?

Read only

Former Member
0 Likes
1,813

USE

CONCATENATE '(' w_celular+0(2) ')' w_celular+2(4) '-' w_celular+6(4) INTO TI_DADOS-celular.

Read only

Former Member
0 Likes
1,813

Yeahh that works , thank you Matthew .

Read only

matt
Active Contributor
0 Likes
1,813

Which would have been easily discovered by reading the documentation on the keyword WRITE...

Read only

Former Member
0 Likes
1,813

Yes i could have done it before posting the question  but I did not want to display any variable  so was not intrested in the keyword WRITE  as i didnt know write to earlier .

Read only

matt
Active Contributor
0 Likes
1,813

It can be tricky when you don't know what you don't know!

Read only

Former Member
0 Likes
1,813

Hi,

There is no need to give number.U can give character fields.

DATA  w_celular(20) TYPE c VALUE 'abcdefghij'.

WRITE w_celular USING EDIT MASK '(__)____-____'.

will give o/p (ab)cdef-ghij

Read only

0 Likes
1,813

Can we do it without using write statement . I need to move the output to other variable without displaying the result . 

Read only

0 Likes
1,813

Hi Sriramula,

As Sai krishna suggested u can use the concatenate syntax if  value fixed and expected value is also fixed.

Declare one variable with same declaration value and  move concatenate variable into another one

Read only

kabil_g
Active Participant
0 Likes
1,813

.....Do you want to display as a character.......or what