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

how to split a string

Former Member
0 Likes
580

Hi all,

I know the length of the string i.e. 28 characters. i want to place first 10 charecters ,next 12 charecters ,next 4 charecters in the fields of an internal table respectively. how to do this? pls help me.

Thanks,

Praveena

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
555

itab-fld1 = string+0(10).

itab-fld2 = string+11(12).

itab-fld3 = string+24(4).

append itab.

3 REPLIES 3
Read only

Former Member
0 Likes
556

itab-fld1 = string+0(10).

itab-fld2 = string+11(12).

itab-fld3 = string+24(4).

append itab.

Read only

Former Member
0 Likes
555

You can split the string with use of

String+offset(length).

here offset is the starting position and length is no. of characters starting from offset.

For example string is X and other 3 fields are a1, a2, a3.

a1 = X+0(10).

a2 = X+10(12).

a3 = X+22(4)

Read only

Former Member
0 Likes
555

Hi

Do Like tHis..

Data: string(28) .

itab-field1 = string+0(10).

itab-field2 = string+10(12).

itab-field3 = string+22(4).

append itab.

clear itab.

Otherwise if any seperaters are there in the string u can do like this...

split string at '/' itab-f1 itab-f2 itab-f3.

Reward All Helpfull Answers..........