May 19, 2010

Split text to be words

DATA: str1 TYPE string,
str2 TYPE string,
str3 TYPE string,
itab TYPE TABLE OF string with header Line,
text TYPE string.

text = 'What a drag it is getting old'.

*SPLIT text AT space INTO: str1 str2 str3,
* TABLE itab.

SPLIT text AT space INTO TABLE itab.
break hcl_kamal1.

LOOP AT itab.
case SY-TABIX.
WHEN 1.
str1 = itab.
WHEN 2.
ENDCASE.

ENDLOOP.

No comments:

Post a Comment