cancel
Showing results for 
Search instead for 
Did you mean: 

Emailing problems - images / table interface

Former Member
0 Kudos

Hi there

Part of our BW / Portal implementation consists of a toolbar which is displayed at the top of each web template.

One of the buttons in that template is an email button, which invokes the standard BW command LAUNCH_BROADCASTER with EMAIL as the distribution type.

The landing pages consist of a template with many different queries involved, each being used to display a particular part of the page. We have graphs, a data table, and a number of traffic lights.

The traffic lights are built by creating a query (and view) and then changing the display of the view using a table interface class. What I do is check the value of the column ( for columns > 1) and then insert an image along with the number, as well wrapping the data in anchor tags to allow the user to click-through to the underlying report. In the first column, I replace the text with text specified by an attribute when the table interface is called.

The table interface works beautifully, and the traffic lights are all displayed as required.

When I email the template however, the images don't come through ... which is possibly due to relative URL's being used. Now, I can update the table interface class to use complete URL's, but this is not really desirable as each different BW system (DEV, QA, PROD) will have different URL, so how do I carry that through with transports. It means, once we are ready for production, that DEV and QA will then be pointing to images on PROD. This is not a huge problem, but one I would like to steer away from if possible.

One option is to put the complete URL in using JAVAScript in the templates themselves, and I would settle for this, but I was wondering if there isn't a neater way of doing this?

The 2nd problem I have is that the text in the first column doesn't come through in the email. If the template is viewed through a browser, it displays correctly, together with its anchor tags to link through to the underlying report, but the resulting email just has blank inserted where I expect text.

Any ideas why this would happen ... its almost like the table interface gets called again when the emailing button is pressed, and the text is not specified.

I appreciate any assistance.

Cheers,

Andrew

Accepted Solutions (0)

Answers (2)

Answers (2)

athavanraja
Active Contributor
0 Kudos

you can use function module

TH_GET_VIRT_HOST_DATA to dynamically determin the host port details of your server (QA or DEV or PRD) and using that you can build the url.

CALL FUNCTION 'TH_GET_VIRT_HOST_DATA'

EXPORTING

protocol = 1

virt_idx = 0

  • LOCAL = 1

IMPORTING

hostname = server

port = port

EXCEPTIONS

not_found = 1

internal_error = 2

OTHERS = 3 .

CONCATENATE 'http://' server ':' port '/sap/bw/Bex' INTO tmp_str .

alternatively i have posted a code sample which takes template id or query id along with the varialbe values and can execute the query and email the same. you can check out the same at

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b7658119-0a01-0010-39a9-b60...

Regards

Raja

Former Member
0 Kudos

Thanks Raja ... your function module worked a treat !!!

Now all I need to determine is howcome the text inserted into the first column from the table interface class does not appear in the resulting email

athavanraja
Active Contributor
0 Kudos

Glad to hear that.

<i>howcome the text inserted into the first column from the table interface class does not appear in the resulting email</i>

is this only happenning in email? what happens when you normally call the template in browser?

Regards

Raja

Former Member
0 Kudos

The normal display (in browser) works fine. It is <i>only</i> when emailing that the result is not as required.

From what I can see, none of the attributes as specified for the table interface get pulled through when the emailing is performed.

The way I come up with this statement is:

1. There is no data in the first column, which is specified purely as a custom attribute in the table interface class.

2. If I view the source of the email message, I can see my images (which were inserted in the table interface), but the code that wraps these images should have values populated as derived from other custom attributes, and these aren't populated either.

So, from what I can gather, custom attributes (attributes created by me during the table interface modification) are not interpreted/saved/used when the email is generated.

I really appreciate the feedback to date

The table interface that I use does quite a few things to the data, and one of those is to wrap the data in anchor tags, which calls a custom function. The input to the custom function is a string which is built up in table interface method

athavanraja
Active Contributor
0 Kudos

can you place a break point in the table interface class method and run the email function to see whether it stops there and check whether the code is getting executed?

Regards

Raja

former_member184494
Active Contributor
0 Kudos

Raja,

Not too sure if this thread is valid now , however we used the function module you had given to send query results as HTML and the icons as part of the table interface were received fine...

Arun

Former Member
0 Kudos

Hi andrew,

Can you please tell me which support pack level are you using at the moment?

Check your suport pack level and search for SAP OSS notes in support portal.

Hope this helps.

Praveen

Former Member
0 Kudos

SPS 14 as far as I know