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

Merging the variable values having in different data type

Former Member
0 Likes
562

Having to different type of data type(C & P) variable & want to merge together .

how can be done ?

4 REPLIES 4
Read only

Former Member
0 Likes
502

Hi,

Use CONCATENATE

Regards,

Naveen

Read only

Former Member
0 Likes
502

hi,

concatenate statement will not work for

data type p

so convert the variable type of p

into char and then concatenate

have this code below

data: c TYPE char1.

data: p type p.

data: s TYPE char20.

data: m type char20.

c = 'A'.

p = '23.4'.

move p to s.

CONCATENATE c s into m SEPARATED BY space.

write m.

thanks

venkatesh

Read only

Former Member
0 Likes
502

Hi,

try this:

DATA: T(100).

DATA: T0(20).

DATA: T1(20) VALUE 'First'.

DATA: T2 TYPE P DECIMALS 2 VALUE 100.

*

t0 = t2.

WRITE: / t0, t1, t2.

concatenate t0 t1 into t.

write: / t.

regards, Dieter

Read only

anversha_s
Active Contributor
0 Likes
502

hi,

try this.

* Converting type p to type c
DATA: p1(4) TYPE P VALUE 124,
          c1(4) TYPE c,
          c2(4) TYPE c value 'anve',
          final(8) TYPE c.

MOVE: p1 TO c1.

concatenate c1 c2 into final.

write final.

Rgds

Anversha