‎2006 Nov 01 10:10 PM
Hello all,
I have a string like
<b>It is followed on monthly basis. | Ag and Ba not analysed | because they do not appear in the normal process</b>.Now I have to parse this string and look for the special symbol '|'. The symbol '|' means a new line. So in the above string case whenever I come across '|', I have to take the string left to it into a separate string. So in this case I should split the above string as
String1 = It is followed on monthly basis.
String2 = Ag and Ba not analysed
String3 = because they do not appear in the normal process
Experts please help me in this case. Waiting..........
‎2006 Nov 01 10:41 PM
Hi,
Check the internal table in the debugging mode..It is working fine..
IN the report I didn't give to display blank lines..That is the reason why it is not showing..
DATA: T_DATA TYPE STANDARD TABLE OF STRING WITH HEADER LINE.
DATA: V_STRING TYPE STRING.
V_STRING = 'ABC||DEF|'.
SET BLANK LINES ON.
SPLIT V_STRING AT '|' INTO TABLE T_DATA.
LOOP AT T_DATA.
WRITE: / T_DATA.
ENDLOOP.
Thanks,
Naren
‎2006 Nov 01 10:19 PM
Hi,
Try this..
DATA: T_DATA TYPE STANDARD TABLE OF STRING WITH HEADER LINE.
DATA: V_STRING TYPE STRING.
V_STRING = 'ABC|DEF|'.
SPLIT V_STRING AT '|' INTO TABLE T_DATA.
LOOP AT T_DATA.
WRITE: / T_DATA.
ENDLOOP.
Thanks,
Naren
‎2006 Nov 01 10:37 PM
HI Naren,
THanks for the reply. I got only one final issue in this.
I may have consecutive '|' symbols. In which case, the output should come as follows
DATA: T_DATA TYPE STANDARD TABLE OF STRING WITH HEADER LINE.
DATA: V_STRING TYPE STRING.
V_STRING = 'ABC<b>||</b>DEF|'.
SPLIT V_STRING AT '|' INTO TABLE T_DATA.
LOOP AT T_DATA.
WRITE: / T_DATA.
ENDLOOP.
The output should be like;
ABC
DEF
Right now with your code I am getting like
ABC
DEF
Please help
‎2006 Nov 01 10:41 PM
Hi,
Check the internal table in the debugging mode..It is working fine..
IN the report I didn't give to display blank lines..That is the reason why it is not showing..
DATA: T_DATA TYPE STANDARD TABLE OF STRING WITH HEADER LINE.
DATA: V_STRING TYPE STRING.
V_STRING = 'ABC||DEF|'.
SET BLANK LINES ON.
SPLIT V_STRING AT '|' INTO TABLE T_DATA.
LOOP AT T_DATA.
WRITE: / T_DATA.
ENDLOOP.
Thanks,
Naren
‎2006 Nov 01 10:53 PM