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

field move

Former Member
0 Likes
1,018

Hi,

i have fields type char10 and i wont to move it to field type P dec2 i wont that the last to numbers be residue.

e.g.

char10

123456

p dec2

1234.56

i don't wont to use concatenate what is the best way to do that?

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
993

hi,

I guess you got to use the conctenate statement to achieve the same ..

i.e,


data : v_char(6) value '123456',
         v_char_o(10),
         v_p type p decimals 2.

concatenate v_char+0(4) v_char+4(2) into v_char_o separated by '.'.

move v_char_o to v_p.

write : v_p. 

9 REPLIES 9
Read only

Former Member
0 Likes
994

hi,

I guess you got to use the conctenate statement to achieve the same ..

i.e,


data : v_char(6) value '123456',
         v_char_o(10),
         v_p type p decimals 2.

concatenate v_char+0(4) v_char+4(2) into v_char_o separated by '.'.

move v_char_o to v_p.

write : v_p. 

Read only

0 Likes
993

Hi Santosh Kumar Patha,

thanks but i don't wont to use concatenate maybe i can use MASK for this?

Regards

Read only

0 Likes
993

hi,

But what is the problem that you are facing using concatenate statement ???

Regards,

Santosh

Read only

0 Likes
993

Hi Santosh Kumar P... ,

i don't have any problem with concatenate but i wont to now if there is another way to do that and How?

Regards

Read only

0 Likes
993

hi,

Try Peter's answer to achieve the same ...

Regards,

Santosh

Read only

0 Likes
993

Hi,

there is no way to do it with mask?

Regards

Read only

peter_ruiz2
Active Contributor
0 Likes
993

hi cosmo,

try this


report test.

data:
  v_char(10) type c,
  v_dec type p decimals 2.

start-of-selection.
v_char = '123456'.

move v_char to v_dec.

divide v_dec by 100.

message i999(z0) with v_dec.

regards,

Peter

Read only

Former Member
0 Likes
993

Hi friends,

any idea if i can do it with musk ?

Regards

Read only

0 Likes
993

hi,

you can use this code

write v_char using edit mask '____.__'.

Note: This code has limitations. On this sample code, it is assumed that your string only contains 6 characters for display. If you have 7 characters, the last character is disregarded.

regards,

Peter