cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform with text containing html tags

Former Member
0 Kudos

I am reading from a table that contains html tags like


<br>
<menu>
<LI type="disc">This is a line which contains html tags
that goes over to 2nd line
<LI type="disc"> This is also another line which contains html
tags.

and each line is stored in a different row. The customer has agreed to use only 3 of the above html tags (

<br>, <menu> and <LI type="disc">

).

When the output is previewed in smartforms, the html tags needs to be formatted and not print in raw format as follows:

<LI type="disc">This is a line which contains html tags

that goes over to 2nd line

<LI type="disc"> This is also another line which contains html

tags.

How can this be done ?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Pratik for your response. The client has decided not to use smartforms. If we revert back to smartforms, I will try your solution.

Former Member
0 Kudos

Thanks for your input.

I don't want to remove the tags but want the format specifically this tag (

<LI type="disc">

which is a bullet point) to format as is.

Former Member
0 Kudos

ok understood...

you can try this

Loop at i_html into wa_html.

tmp = strlen( wa_html-line).

do tmp times.

if wa_html-line+0(1) = <

l_start = 1.

__elseif wa_html-line+0(1) = >

l_start = 0.

concatenate l_char wa_html-line+0(1) into l_char.

endif.

if l_start = 1.

concatenate l_char wa_html-line+0(1) into l_char.

wa_html-line = wa_html-line+1(l_tmp - sy-index) OR use the keyword SHIFT LEFT...plz chk the syntax

elseif l_start = 0 and l_char = <LItype=disc>

concatenate <BULLET> wa_html-line into wa_html-line separated by space.

endif.

enddo.

modify i_html form wa_html.

endloop.

now u define two text element one with bullet and another without bullet. this is how u insert bullet:

goto to the texteditor of a text element in smartform. Its a small button on the left hand side of.

Then goto insert>characters>sap symbols.

for ur requirement u can use the symbol SYM_FILLED_CIRCLE.

Remember these icons or symbols whatever u will not be able to see in print preview....u have to take a print

and see

Now at the time of display check if the line contains the

tag <BULLET> ( if wa_html-line+0(8) = '<BULLET>')

if the line has the tag then display ur text in the text element with bullet

otherwise

display it in the non bullet text element..

remeber to remove the tag before dispalying

hope this solves ur prob...

Former Member
0 Kudos

Loop at i_html into wa_html.

tmp = strlen( wa_html-line).

do tmp times.

if wa_html-line+0(1) = '<'.

l_start = 1.

elseif wa_html-line+0(1) = '>'.

l_start = o.

endif.

if l_start = 1.

wa_html-line = wa_html-line+1(l_tmp - sy-index) OR use the keyword SHIFT LEFT...plz chk the syntax

endif.

enddo.

modify i_html form wa_html.

endloop.

this will remove the html tags from table i_html leavi8ng behind only ur required data...modify the logic if required as per ur requirement