Application Development 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: 

field move

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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. 

0 Kudos

Hi Santosh Kumar Patha,

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

Regards

0 Kudos

hi,

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

Regards,

Santosh

0 Kudos

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

0 Kudos

hi,

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

Regards,

Santosh

0 Kudos

Hi,

there is no way to do it with mask?

Regards

peter_ruiz2
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi friends,

any idea if i can do it with musk ?

Regards

0 Kudos

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