‎2009 Aug 04 9:03 PM
Hello,
I have a long string of characters (plain HTML codes in one long line) and would like to obtain a substring after a pattern. For example, part of the long string looks like this:
...abcdefg123456789...
I would like to obtain "123456789" from this long line. And I am certain the previous substring, i.e. abcdefg, is unique in this long string line.
How do I go about achieving this with ABAP code?
Thanks!
Edited by: Jay Yang on Aug 4, 2009 1:06 PM
‎2009 Aug 04 9:07 PM
Try to use class CL_CRM_HTML_PARSER and use method PARSE_HTML_STRING
a®
‎2009 Aug 04 9:07 PM
Try to use class CL_CRM_HTML_PARSER and use method PARSE_HTML_STRING
a®
‎2009 Aug 04 9:25 PM
Thanks a@s. That's a great hint! However, when I tried with method parse_html_string by passing in the long html string I have, it didn't get me the result properly. I located the part/tag I wanted from the returned part table (a SPAN tag), but the attribute simply listed the SPAN id, instead of the value between SPAN and /SPAN. Could you provide me with further hint?
Thanks again!
‎2009 Aug 04 9:45 PM
As per earlier reply you mentioned abcdefg is unique
then try something simple
report zars
no standard page heading line-size 255.
data : ser type string value 'testing1234abcdefg123456789'.
data : pos type i.
search ser for 'abcdefg'.
pos = sy-fdpos + 7.
write ser+pos(9).
Will it do ?
a®
‎2009 Aug 04 9:51 PM