‎2007 Oct 29 3:28 PM
I have a string that I want to break into several lines.
The line length in my case shall be 72 characters.
Of course, I only want to break at the word borders (so only at a blank between two words).
Technically, I want to convert the string into a string table, and each string in the table shall only be longer that 72 characters, if there is no space in that part of the string.
Is there any function module or something like this for that?
‎2007 Oct 29 3:30 PM
Hi,
Please check these FM.
STRING_SPLIT_AT_POSITION
SWA_STRING_SPLIT
Regards,
Ferry Lianto
‎2007 Oct 29 3:30 PM
Hi,
Please check these FM.
STRING_SPLIT_AT_POSITION
SWA_STRING_SPLIT
Regards,
Ferry Lianto
‎2007 Oct 29 3:31 PM
‎2007 Oct 29 3:32 PM
Hi,
Use SPLIT command -
SPLIT f AT g INTO TABLE itab.
Effect
Similar to variant 1
The sections of f are placed in the internal table itab. The sytsem creates a table row for each section of f.
Note: If f ends with the separator string g, the system does not create an empty table row at the end. This is in contrast to what happens when g occurs at the beginning of f.
Example
TYPES: BEGIN OF ITAB_TYPE,
WORD(20),
END OF ITAB_TYPE.
DATA: ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH
NON-UNIQUE DEFAULT KEY INITIAL SIZE 5.
SPLIT 'STOP Two STOP Three STOP ' AT 'STOP' INTO TABLE ITAB.
ITAB now has three rows. The first is empty, the second contains ' Two', and the third ' Three'.
Hope this helps.
ashish
‎2007 Oct 30 2:33 PM
FM SWA_STRING_SPLIT really solves the problem.
If I would work with character fields instead of strings, then 'RKD_WORD_WRAP' would also work.
Thx you all!