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: 

Union of the three variable values in fourth variable

Former Member
0 Kudos

Hi Experts,

I have three variables var1,var2 and var3 and in these the values are

V1 = a, b,c.

V2 = c,d, f,

V3 = e,g,a

so I am not understanding how do we get the union of these values in V4.

i.e I need V4 with the values a,b,c,d,e,f,g so can one please help over this

issue.

1 ACCEPTED SOLUTION

former_member189059
Active Contributor
0 Kudos

what exactly do the variables contain ?

for eg: does V1 contain the 5 character string 'a,b,c' ?

generally, you can use

concatenate v1 v2 v3 into v4.

4 REPLIES 4

former_member189059
Active Contributor
0 Kudos

what exactly do the variables contain ?

for eg: does V1 contain the 5 character string 'a,b,c' ?

generally, you can use

concatenate v1 v2 v3 into v4.

Former Member
0 Kudos

Hi,

Try like this:

data : a(10),b(10),c(10),d(40).

A = ‘Apple’. B = ‘Orange’. C = ‘Banana’.

Concatenate A B C into D.

Write:/ d.

Concatenate A B C into D separated by ‘/’.

Write:/ d.

Regards,

Bhaskar

former_member235056
Active Contributor
0 Kudos

Hi,

Use,

Concatenate V1 V2 V3 into V4.

Pls do reward points.

Regards,

Ameet

Former Member
0 Kudos

hi,

u have to code the logic for union of two variables.

u can use this logic in form statement..

data : itab type table of string with header line,

wa type string.

split v1 at ',' into table itab.

split v2 at ',' into table itab.

describe itab lines size. " determine no.of rec in itab.

while size > 0.

read itab index size .

read itab into wa index size-1.

" write the code for comparision of values n populating uniques values

endwhile.

hope this hepls u...

Regards,

viji