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: 

change from '0002' to '02'

Former Member
0 Kudos
200

Hi,

How to change the value from '0002' to '02'. Can anybody plz give sample code.

Regards,

bindazme

1 ACCEPTED SOLUTION

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Kudos
155

Hi,

Just assign it as follows.

DATA: char4(4) type n value '0002',

char2(2) type n.

char2 = char4+2(2).

Regards

Sesh

6 REPLIES 6

Former Member
0 Kudos
155

Hi bin,

1. newvariable = oldvariable+2(2).

regards,

amit m.

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Kudos
156

Hi,

Just assign it as follows.

DATA: char4(4) type n value '0002',

char2(2) type n.

char2 = char4+2(2).

Regards

Sesh

Former Member
0 Kudos
155

Hi, you can use type N data :

data : data2(2) type n,
         data4(4) type n.


data4 = '0002'.
move data4 TO data2.

write data2.

Mathieu

Former Member
0 Kudos
155

data2 = data1+2(2).

Former Member
0 Kudos
155

Hi,

var1 = '0002'.

var2 = var1+2(2).

writre var2.

o/p will be 02.

rgds

harris

Former Member
0 Kudos
155

Thanks,

bindazme