cancel
Showing results for 
Search instead for 
Did you mean: 

String operations

Former Member
0 Kudos

Hi friends,

I have a small requirement,

I have a string length of 30 char. i should split that string in such a way that first 18 char should be stored in one variable and remaining 12 char in another variable.

Plz help me out.

bye.

Accepted Solutions (0)

Answers (4)

Answers (4)

harimanjesh_an
Active Participant
0 Kudos

hi kamal....

try this program.....

DATA : str(30) TYPE c VALUE 'HARIMANJESH.ASHWATHM',

str1(18) TYPE c,

str2(12) TYPE c.

START-OF-SELECTION.

str1 = str+0(18). " Instead of this statement, u can also use <b>MOVE</b> Command.

str2 = str+18(2).

WRITE : / str1 ,

/ str2.

Reward me if useful.

Harimanjesh AN

Former Member
0 Kudos

Thanks it worked.

Former Member
0 Kudos

Hi,

data : char(18) typec ,

char1(12) type c,

variable(30) type c. " in which you have the value

now

char = variable+0(18).

char1 = variable+18(12).

regards,

Venkatesh

Former Member
0 Kudos

move string+0(18) to str1.

move strinf+18(12) to str2.