cancel
Showing results for 
Search instead for 
Did you mean: 

Display attribute of Mail Form as HTML hyperlink

tobias_hainke
Employee
Employee
0 Kudos

Hi Experts,

i want to display the direct URL of a ticket as a html hyperlink. Such like "<a href="<<url of ticket>>">Open HR Request</a>"

The ticket url will be sotred in attribute SAP_/EIC/SSC_OR_PLACEHOLDER_MAIL-TICKET_SELF_SRV_URL".

This attribute is defined in the mail form html-code as follows:

<DIV><INPUT dir=ltr id=%SAP_/EIC/SSC_OR_PLACEHOLDER_MAIL-TICKET_SELF_SRV_URL value="SSC: Ticket URL"> </DIV>

I tried several things:

1.      i wanted to add the input-tag into a a-href tag

         <DIV><A href=%SAP_/EIC/SSC_OR_PLACEHOLDER_MAIL-TICKET_SELF_SRV_URL>My little testlink</A></DIV>

2.      I wanted to edit the function module which will determine the URL of the ticket

         ZSSF_OR_VARIABLE_ESS_URL. But if i concatenate "<a href="" and ">Open HR Request</a>" to the attributes TICKET_SELF_SRV_URL.

          it wont be interpreted as HTML. The html tags will be display as normal text in the email.

3.    I wanted to assign the attributes value of TICKET_SELF_SRV_URL into a java-script value. Then i wanted to create a HTML statement:

       <script type="text/javascript">

          function dynLink () {

          var link = SAP_/EIC/SSC_OR_PLACEHOLDER_MAIL-TICKET_SELF_SRV_URL

          document.write('<a href="' + link + '">Open HR Request</a>');

          }

          dynLink();

     </script>

     Problem here is that java script will be remove after saving the mail form.

Any ideas how to display the link of the attribute SAP_/EIC/SSC_OR_PLACEHOLDER_MAIL-TICKET_SELF_SRV_URL only as "Open HR Request"?

Thanks a lot!

Accepted Solutions (0)

Answers (2)

Answers (2)

sascha_roehm
Explorer
0 Kudos

Hello Tobias,

I am also looking for a solution for this problem. Were you able to solve this?

Best regards

Sascha

sascha_roehm
Explorer
0 Kudos

Has been solved with the help of the following post:

gregorw
Active Contributor
0 Kudos

Hi sascha.roehm unfortunately the post isn't linked. Can you post it again?

sascha_roehm
Explorer
0 Kudos

Hi Gregor,

good news is - i am sitll around. Bad news is i don't remember which post I used to solve this.

However, here is my solution:

  • in mail form add an attribute from attribute category 'Additional fields'
  • will generate something like this for you in your mail form
<input id="%SAP_YPLACEHOLDER" dir="ltr" type="text" value="Marketing Permission Link" />
  • change it to
<a href="%SAP_YPLACEHOLDER">Some text</a>
  • create an action in SPRO -> CRM -> Basic Functions -> Actions -> Actions in Transaction
  • use 'Method Call' for this action
  • implementing this, use class CL_CRM_PML_MAIL_FORM_EXEC and method GET_VARIABLES to get all variables of your mailform
  • GET_VARIABLES will give you key value tab where you have to fill KEY with 'YPLACEHOLDER' and VALUE with 'https://sap.com'
  • use function module CRM_ERMS_MAIL_COMPOSE and pass key value tab to TABLES parameter ADD_KEY_VALUE_PAIRS
BGarcia
Active Contributor
0 Kudos

Hi Tobias,

I did before something like that, in my interaction center scenario. I've implemented method CRM_IM_BPSELE of CRM_IM_ADD_DATA_BADI badi.

There, the attributes used in your mailform can be modified (They are at ct_att_values variable).

Try to explore it if it suits your scenario, and if yes, try to change your url attribute, doing something like this there:

CONCATENATE '<a href="' lv_your_url_attr '">' 'Open HR Request' '</a>' INTO lv_your_url_attr.

Kind regards,

Garcia

tobias_hainke
Employee
Employee
0 Kudos

Hi Bruno,

thanks for your answer.

I also tried this. I have got a Function Module ZSSF_OR_VARIABLE_ESS_URL.

Here the url will be created.

CONCATENATE lv_url lc_client sy-mandt lc_url lv_guid INTO ls_mail_placeholder-value.

Now the complete URL will be stored in

ls_mail_placeholder-value: https://sfa.wdf.sap.corp:443/sap/bc/bsp/sap/crm_ui_start/default.htm?sap-client=001&saprole=ZSSF-SRV...

What i have tried is do add "<a href="" in the fron and ">Open HR Request</a>" in the back:

CONCATENATE '<a href="' lv_url lc_client sy-mandt lc_url lv_guid '">Open HR Request</a>' INTO ls_mail_placeholder-value.

But in the e-Mail the link will be displayed as follows:

I also tried to replace "<" with "&lt;" and to replace ">" with "&gt;". Same problem:

Any ideas? Thanks a lot.

Regards,

Tobias

0 Kudos

Hello Tobias,

Have you finally found a solution?

If so - please share it with the community

Regards

Lukasz