‎2006 Jun 23 9:12 AM
Hi group,
I have one field with long text,I need to split this field after 20th position till ',' occurs.
can any body suggest how to procedd.
‎2006 Jun 23 9:15 AM
‎2006 Jun 23 9:17 AM
HAi
Check the following Code
Data : a(20),
b(20),
c(20),
d(80).
d = 'aaaaaaaaaaaaaaaaaaaa,baaaaaaaaaaaaaaaaaaa,
caaaaaaaaaaaaaaaaaaa'.
split d at ',' into a b c.
write 😕 a,
/ b,
/ c.
Thanks & regards
Sreenivasulu P
Thanks & regards
Sreeni
‎2006 Jun 23 9:24 AM
DATA:
longtext TYPE STRING,
reqfield type string,
p TYPE C,
off TYPE I,
len type I.
longtext = 'Everyone knows this Everyone knows this Everyone, knows this'.
p = ','.
FIND p IN c MATCH OFFSET off.
if off > 20.
len = off - 20.
reqfield = longext+20(len).
endif.
‎2006 Jun 23 9:24 AM
hi
DATA: ws_char type char1000.
DATA: ws_split type char1000
suppose ws_char is your long text
ws_split = ws_char+20(100).
split ws_split at ',' into text1 text2.
text1 should contain your required text
award points for useful answers
‎2006 Jun 23 9:38 AM
Hi,
First find the string length . if it is more than 20 then use offset and move the text from 20 to strlength. and now split that string.
data: text(100),
text1(80).
text = 'ABCDEDFFGGGGGGGGGGGGdddd,test'.
text1 = text+20(80).
now use this..
TYPES: BEGIN OF ITAB_type,
WORD(20),
END OF ITAB_type.
DATA: ITAB TYPE STANDARD TABLE OF ITAB_TYPE.
SPLIT text1 AT ',' INTO TABLE ITAB.
regards
vijay
‎2006 Jun 23 10:57 AM
Hi group,
I am having text like this
'ands,werew,asdsd,adsdddffff,asdsdsdd,asdsds,'
not its single comma.
‎2006 Jun 23 9:55 AM
hi,
As you want to split your long text after 20th position, first move the text from 20th position till end to another variable and then split the text at ','.
data: v_char type char1000. "this is your long text
DATA: v_split type char1000 "store your text from 20th position till end in this.
v_split = ws_char+20(100).
*Now Spliet it at ','.
split v_split at ',' into v_split1 v_split2 v_split3.
Regards,
Richa
‎2006 Jun 23 9:56 AM
data : a(100) value
'aaaaaaaaaa,bbbbbbbbbb,cccccccccc,dddddddddd'.
data : begin of b occurs 0,
word(100),
end of b.
split a+20 at ',' into table b.
regards
ibrahim
‎2006 Jun 23 11:12 AM
Hi use this ,
*
W_FTEXT = <Your Long Text>.
W_TEXTLINE = W_FTEXT.
W_DELIMITER = ','. "Your Seperator
W_OUTPUTLEN = 20.
*
*
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
TEXTLINE = W_TEXTLINE
DELIMITER = W_DELIMITER
OUTPUTLEN = W_OUTPUTLEN
IMPORTING
OUT_LINE1 = W_LINE1
OUT_LINE2 = W_LINE2
OUT_LINE3 = W_LINE3.
if helpful this, mark me