‎2008 Feb 14 9:39 AM
Hi all,
I want to find substring from main string .
Separator exists in my substring.
eg: 'AA$BB$cc$DD'
I want AA BB CC DD sepatared.
‎2008 Feb 14 9:42 AM
‎2008 Feb 14 9:42 AM
Hi,
split mainstring at '$' into it_tab.
concatenate it_tab1 it_tab2 into substring separated by space.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:18 PM
‎2008 Feb 14 9:42 AM
Syntax
SPLIT dobj AT sep INTO
{ {result1 result2 ...} | {TABLE result_tab} }
[IN {BYTE|CHARACTER} MODE].
You can write as
SPLIT total_string AT '$' INTO temp1 temp2 temp3 temp4 IN CHARECTER MODE.
SPLIT total_string AT '$' INTO TABLE result-tab IN CHARECTER MODE.
Edited by: Minal Nampalliwar on Feb 14, 2008 10:45 AM
‎2008 Feb 14 9:46 AM
Hi,
You can use the SPLIT command, like
SPLIT v_str AT v_separator INTO p1 p2 p3 ....
or ... INTO TABLE t_str.
Best regards,
Ivson
‎2008 Feb 14 9:46 AM
SPLIT
Splits a string.
Syntax
SPLIT <c> AT <del> INTO <c1>... <cn> INTO TABLE <itab>
[IN BYTE MODE|IN CHARACTER MODE].
This statement searches the character field <c> for delimiter strings <del> and the parts before and after the delimiters are placed in the target fields <c1> ...> <cn>, or into a new line of the internal table <itab>. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.
<REMOVED BY MODERATOR>
REGARDS
PRIYA.
Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:19 PM
‎2008 Feb 14 11:47 AM
Use,
data: str1 type string,
s1 type sring,
s2 type string,
s3 type sring,
s4 type string.
str1 = 'AA$BB$CC$DD'.
split str1 at '$' into s1 s2 s3 s4.
now s1 = AA,s2 = BB,s3 = CC,s4 = DD
‎2008 Feb 14 8:40 PM
Split <str_name> at <delemeter($$)> into <var1> <var2> <var3> ...... (based on our source string)
‎2008 Aug 30 8:25 AM
Hi,
try this code as i had similar requirement
data : itab type string occurs 0 with header line.
split v_spell_string at space into table itab.
clear v_spell_string.
loop at itab .
if itab <> 'Rupees'.
concatenate v_spell_string itab into v_spell_string separated by ' '.
endif.
endloop.
else you can also use kewords : REPLACE ALL OCCURANCE OF ......
FOR EXAMPLE if u jst want to remove the seperator or replace with something then
: REPLACE ALL OCCURRENCES OF 'Rupees' in v_spell_string with 'and'.
else you can use SPLIT AT Cammand.
example : split str1 at <seperator> into str2........strn
(this can be used if u are sure that there are going to be fix number of words in a string, else use first option
Edited by: Naseer uddin on Aug 30, 2008 9:35 AM
‎2008 Aug 30 8:55 AM
hi,
U can use SPLIT.
For Eg-
split str at $ into str1,str2, str3.
hope this helps u.
Regards,
Aleem