Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

String Manipulation

Former Member
0 Likes
851

Hi

I am importing data from a file and the string data has HTML tags in the description example

<FT><H><N>Line Clearance</></></>, Any idea's

how I can programmatically strip the tags away and just leave the text?

1 ACCEPTED SOLUTION
Read only

Peter_Inotai
Active Contributor
0 Likes
820

FM SOTR_TAGS_REMOVE_FROM_STRING works fine for your requirements.

Peter

7 REPLIES 7
Read only

roland_spindler
Participant
0 Likes
820

SHIFT string LEFT DELETING LEADING '<FT><H><N>'.

SHIFT string RIGHT DELETING TRAILING '</></></>'.

Roland

Message was edited by: Roland Spindler

Read only

Peter_Inotai
Active Contributor
0 Likes
820

With regular expression it's possible to implement this, I jsut saw in Eddy's tutorial, however I'm almost sure you don't have ABAP 7.00.

Probable there is an easy solution, I'd ask this in the BSP forum.

Peter

Read only

Former Member
0 Likes
820

replace all occurances of '<FT><H><N>' in v_str with ''.

replace all occurances of '</>' in v_str with ''.

REgards,

Ravi

Read only

Former Member
0 Likes
820

hi

Try like this

replace all occurance of '<F>' in text with SPACE .

condence text.

use this command for all the possible tag.

otherwise search last possible TAG i.e <F> etc

take the text till u encounter onaother tag.

regards

manoj

Read only

0 Likes
820

hi,

try that:

SPLIT text AT '>' INTO TABLE sptab.

LOOP AT sptab.
  CHECK sptab-line(1) <> '<'.
  REPLACE '</' WITH space INTO sptab-line.
  WRITE sptab.
ENDLOOP.

Andreas

Read only

0 Likes
820

Thanks all you have helped with the problem, I have assigned points and the issue is resolved.

Thanks again

Read only

Peter_Inotai
Active Contributor
0 Likes
821

FM SOTR_TAGS_REMOVE_FROM_STRING works fine for your requirements.

Peter