I am using GET_TEXT_AS_R3TABLE from cl_gui_textedit class, and i obtein some lines in a table with ## marking the line jump, but i don´t know how to do it, because if i try to split at '##' it doesn´t do it, have i to convert one by one characters to ascii code or is there any way to do it?,
Thanks in advance.
example:
xxxxxxxx##ccc##vv####
i want:
xxxxxxxx##
ccc##
vv####
Hi carl,
1. when we use this method,
we don't get any ##,
we stragith away get the 3 lines
2.
CALL METHOD editor->get_text_as_r3table
EXPORTING
ONLY_WHEN_MODIFIED = FALSE
IMPORTING
table = a
IS_MODIFIED =
EXCEPTIONS
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2
ERROR_DP_CREATE = 3
POTENTIAL_DATA_LOSS = 4
OTHERS = 5
regards,
amit m.
Hi again,
1. Carriage and LINE FEED.
2. those two characters ##
actually must be
Carriage, and Line Feed.
3. To split them use like this.
data : a(100) type c.
data: BEGIN OF ITAB occurs 0,
WORD(20),
END OF ITAB.
split a at <b>CL_ABAP_CHAR_UTILITIES=>CR_LF</b> into table itab.
regards,
amit m.
try this .. i had assumed that ur text consists of only characters(lower case) and no numericals REPORT ychatest. DATA : str(45) VALUE 'xxxxxxxx##ccc##vv####', strlength TYPE i, i1 TYPE i VALUE 0, j1 TYPE i VALUE 1, char(1). DATA: BEGIN OF itab OCCURS 0, word(20), END OF itab. TRANSLATE str TO UPPER CASE. strlength = STRLEN( str ). DO strlength TIMES. char = str+i1(j1). SEARCH sy-abcde FOR char. IF sy-subrc NE 0. EXIT. ENDIF. i1 = i1 + 1. ENDDO. TRANSLATE str TO LOWER CASE. SPLIT str AT char INTO TABLE itab. LOOP AT itab. WRITE : / itab-word. ENDLOOP.
Add a comment