Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

String Functions

Hi,

I have a string that contain/s &text&, text can be anything.

I want to extract all such text in the string.

How can i achieve this, please help

Regards,

piyush

Tags:
replied

Hello,

Example

: Search for all occurrences of the string "now" in a string literal. The offsets 11 and 24 of both found locations are displayed as output.

DATA: patt TYPE string VALUE `now`,

text TYPE string,

result_tab TYPE match_result_tab.

FIELD-SYMBOLS <match> LIKE LINE OF result_tab.

FIND ALL OCCURRENCES OF patt IN

`Everybody knows this is nowhere`

RESULTS result_tab.

LOOP AT result_tab ASSIGNING <match>.

WRITE: / <match>-offset, <match>-length.

ENDLOOP.

Regards.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question