cancel
Showing results for 
Search instead for 
Did you mean: 

Including hyperlink in ABAP Email in SAP BW 7.3

Former Member
0 Kudos

Hello Experts,

We are working on SAP BW 7.3. We need some guidance on including hyperlinks in email body, the email being set via an ABAP routine.

We have an ABAP routine to send out certain emails after the BW data-load is complete. This ABAP routine is included in the process chain. The routine uses function module ‘SO_NEW_DOCUMENT_SEND_API1‘ to send out emails.

We want to include a static link (that navigates to a Webi Report) in the body of the email. The two issues we are facing are-

  1. The link appears as plain text, and not as a clickable link (hyper-link)
  2. The link being too long, we have split it into two parts.

Sample Code:

DATA t_mail_content LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.

..

..

..

CONCATENATE 

      'Link: '

      ‘http://XXXXXXXX:1111/BOE/OpenDocument/opendoc/openDocument.jsp?'

      'sIDType=CUID&iDocID=ATAhFFwzWwBKobXkRYIYmFY'

INTO t_mail_content .

APPEND t_mail_content.

CLEAR t_mail_content.

..

..

Please guide us through this.

Regards,

Chetana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chetana,

Try wrapping your text/address into some html code:

<a href="http://XXXXXXXX:1111/yourLink">

Did that help?

Br,

Christian

Former Member
0 Kudos

Hi Christian,

Thanks for your response. I tried putting the HTML tag as follows -

 

CONCATENATE 

'Link: '
'<a href="http://XXXXXXX:1111/BOE/OpenDocument/opendoc/openDocument.jsp?'
'sIDType=CUID&iDocID=ATAhFFwzWwBKobXkRYIYmFY">'
INTO t_mail_content .
APPEND t_mail_content.
CLEAR t_mail_content.

But the output is -

Link:<a href="http://XXXXXXX:1111/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=ATAhFFwzWwBKobXkRY...">

The link is now a hyperlink, but the HTM tags '<a href=" ">' are also displayed in the email body.

Tried a number of options with display, but nothing seems to work.

Was wondering if it is something to do with the setting. The settings for output format in t-code SCOT -> SMTP are -

Business Object/Link - HTM

RAW Text - TXT.

I hope these setting are right.

Kindly guide me through this.

former_member209728
Active Participant
0 Kudos

Hi,

Can you please check that you are passing doc_type = HTM in the packing_list table. This differentiates a text based email from an HTML one.

Also check this wiki link for sending HTML emails from SAP.

http://wiki.scn.sap.com/wiki/display/Snippets/Mails+from+SAP+to+external+mail+id+with+HTML+formattin...

Thanks,

Kush Kashyap

Message was edited by: Kush Kashyap

Former Member
0 Kudos

Hi Chetana,

This happens most likely because the </a> tag is missing in the end.

Take a look at that:

CONCATENATE '<a href="http://www.sdn.sap.com" " target="_blank" >'

            'SAP Developer Network (SDN) </a>'

            ' '

            INTO XXXXX SEPARATED BY ''.

The code snippet was taken from: http://wiki.scn.sap.com/wiki/display/Snippets/ABAP+-+Mail+with+link+to+outlook

This guide explains the use of the function module ‘SO_NEW_DOCUMENT_SEND_API1‘.

That should fix your problem.

By the way. Why are you using the function module 'SO_NEW_DOCUMENT_SEND_API1' ?

'CL_BCS' is way easier to use for sending mails through ABAP.

Here is some useful information regarding the topic:

http://wiki.scn.sap.com/wiki/display/ABAP/Sending+Mails+-+Home+Page

Br,

Christian

Answers (0)