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: 

Regarding Split

Former Member
0 Kudos

Hi,

I have a material Description as some XXXX YYYY ZZZZ I have to split this by four characters that is the four space inbetween should also get loaded into the variable is there any way to do this without using loop ..

Kindly help urgent...

Thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If you know the material description is going to splitted after every 4 characters every time then use offset, it will solve your problem.

eg, Material descrption = 'XXXXYYYYZZZZ'.

var1 = material description+0(4).

var2 = material description+4(4).

var3 = material description+8(4).

Regards,

SD

4 REPLIES 4

Former Member
0 Kudos

Hi,

If you know the material description is going to splitted after every 4 characters every time then use offset, it will solve your problem.

eg, Material descrption = 'XXXXYYYYZZZZ'.

var1 = material description+0(4).

var2 = material description+4(4).

var3 = material description+8(4).

Regards,

SD

Former Member
0 Kudos

data: var1(8) type c,

var2(8) type c,

var2(8) type c,

var1 = field+0(4).

var2 = field+4(4).

var3 = field+8(4).

Former Member
0 Kudos

Hi ,

Try This.

eg, descrption = 'XXXX YYYY ZZZZ'.

Desc1= description+0(5). '' XXXX "

Desc2= description+5(5). "YYYY "

Desc3 = description+10(4). "ZZZZ"

This will allow to get the spaces also.

Reward If useful.

Regards,

Chitra

Former Member
0 Kudos

data: sym(15) type c value 'XXXX YYYY ZZZZ',

var1(5) type c,

var2(5) type c,

var3(5) type c.

var1 = sym+0(4).

var2 = sym+5(4).

var3 = sym+10(4).

write: var1,var2,var3.