cancel
Showing results for 
Search instead for 
Did you mean: 

Formatted-Text-View: Link isn't working (<a href="http://www.google.com"...

Former Member
0 Kudos

Hello,

I use a Formatted-Text-View to display a hyperlink. Unfortunately the link doesn't work.

I bound the Formatted-Text-View to a string in my context, which is filled like this:

lv_dummy_text = '<a href="http://www.google.com">google</a>'.

When I test the application, the text "google" is displayed in grey and isn't clickable.

Can anybody help me?

Regards

Kert

Accepted Solutions (0)

Answers (1)

Answers (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

you need to use method MAKE_A_TAG of class CL_WD_FORMATTED_TEXT.

Refer SAP Help http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3b/219141c1d0ae5fe10000000a1550b0/content.htm

There you will find example on Dynamic creation of Formatted text. On Simmilar lines you need to built hyperlink.

you can do whereuse list for method MAKE_A_TAG and see how it is done.

I hope this will solve your problem.

Thanks,

Chandra

Former Member
0 Kudos

Hello Chandra,

thank you very much for your answer. I tried to solve the problem as you suggested and wrote this code:

    DATA lo_form_text TYPE REF TO cl_wd_formatted_text.

    lo_form_text = cl_wd_formatted_text=>make_a_tag(
      href = 'http://www.google.com'
      inner_text = 'Google' ).

    lo_el_context->set_attribute(
      name =  `BOTTOM_TEXT`
      value = lo_form_text->m_xml_text ).

Unfortunately the result is the same. The text "google" is displayed grey and not clickable.

Maybe my sap system is buggy and needs a sap support note.

Regards,

Kert

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Not sure if this is issue with support pack. you can also give try with using sapscrip text into formatted text.

As per the SAP Help, you can conver sapscrip text into formatted text and also it is mentioned about parameter URL_BEGIN - URL (<a>).

I am not sure if by building sapscript text like this will help you achive the result but you can give a try.

Thanks,

Chandra

Former Member
0 Kudos

Hello Chandra,

thanks again for your help. I think I will try to report an error to SAP.

Regards

Kert