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

HTML file data to Internal table (without tags)

Former Member
0 Likes
2,122

Hi Friends,

I can able to read a HTML file data to internal table. but it has data with HTML Tags.

Now to capture the data alone.. is there any class or function module exist or do i need to capture data alone based tags?

Please provide your suggestion.

Thanks,

Munvar.

Hi Friends,

I can able to read a HTML file data to internal table. but it has data with HTML Tags.

Now to capture the data alone.. is there any class or function module exist or do i need to capture data alone based tags?

Please provide your suggestion.

Thanks,

Munvar.

6 REPLIES 6
Read only

former_member392866
Active Participant
0 Likes
1,178

Hi Basha,

Capture based on Tags itself.... Thank you .

Regards,

Balaji.

Read only

Former Member
0 Likes
1,178

Hi Munvar Bahsa,

you can do this by using regular expression:

....

REPLACE ALL OCCURRENCES OF REGEX '<[a-zA-Z\/][^>]*>' IN TABLE GT_HTML WITH SPACE.

....

Regards,

Stefan

Read only

0 Likes
1,178

Hi Stefan,

Thanks for your sugesstion...

i tried with your suggestion... got an syntax error as "The word "REGEX" is reserved."

Is regular expressions will work in 4.7 Version?

is there any other solution.... 

Read only

0 Likes
1,178

In that case you can write your own code, something like this:

Loop at internal table.

Loop through characters of record using offset.

Concatenate character if it is not < or > and ignore flag is not set.

Set ignore flag if character is <.

Reset ignore flag if character is >.

Endloop.

Append.

Endloop.

Read only

0 Likes
1,178

Hi Munvar Basha,

that's right - regualar expressions are available in release 7.00.

As until suggested, you can do it  by your own code for e.g. the follow function modules:

  • SCMS_FTEXT_TO_STRING to convert your internal table to a string
  • SOTR_TAGS_REMOVE_FROM_STRING for remove the tags
  • SCMS_STRING_TO_FTEXT to convert the string to out internal table again.
Read only

Former Member
0 Likes
1,178

Same query has been answered before. You will find your answer here :

http://scn.sap.com/thread/1559562

regards,

Ashish Rawat