cancel
Showing results for 
Search instead for 
Did you mean: 

Web template broadcasting and variables assignment

Former Member
0 Kudos

Hello,

I have built a web template with a table & a chart. The related data provider (an infocube) is populated everyday.

I would like to put in place the following broadcasting scenario : on a regular basis, users would receive a mail

with the web report displaying the data related to the period.

Eg :

- every day, they would receive the web report with data from the day before

- every week, they would receive the web report with data from the week before

- every month, they would receive the web report with data from the month before ...

Unfortunately, I did not find any way to schedule a generic job by period (one job for the daily processing, one job for weekly processing and so on ...). Indeed, into broadcasting settings of a web template, the variable assignment is static : there is no obvious way to assign a variant instead of fixed values. Therefore, this would mean that I have to build as many broadcast settings & jobs as periods. This is not really convenient.

I would like to use variants to be able to change dynamically web template variables values.

I have found out that there is the possibility to assign variant for query unlike web template. But I don't want to use query for our broadcasting needs.

Do you know if there is a way to handle variant for web template ?

Thank you very much for you help.

Regards.

Fabrice

Accepted Solutions (1)

Accepted Solutions (1)

athavanraja
Active Contributor
0 Kudos

you can use the code sample to achieve this.

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

call this FM explained in the code sample in a abap report and you can schedule this based on your requirement.

Regards

Raja

Former Member
0 Kudos

Hello Raja,

thank you for this document.

But, the FM works with queries only. I have tried to replace QUERY by TEMPLATE_ID into query_params internal table and I didn't get any result (the mail is empty).

The requirement I have is to send web template results by mail.

On the other hand, for queries, opening the mail requires a user authentication on the SAP system. This means that the recipients need to have a user account defined into the SAP system. But I would like to send mail to people who are not defined into the SAP system.

Fabrice

athavanraja
Active Contributor
0 Kudos

this works for web template as well. let me know what values are passed in table QUERY_PARAMS.

receipiend doestn need a SAP account. the user who runs the abap program to send the mail requires necessary authorization and it can be sent to anybody. try sending it to your yahoo/hotmail/gmail ids it will still work.

Regards

Raja

Former Member
0 Kudos

For a web template, values from table QUERY_PARAMS are :

NAME = CMD & VALUE = LDOC

NAME = TEMPLATE_ID & VALUE = <my template name>

NAME = VAR_NAME_1 & VALUE = <my 1st variable name>

NAME = VAR_VALUE_EXT_1 & VALUE = <value>

NAME = VAR_NAME_2 & VALUE = <my 2nd variable name>

NAME = VAR_OPERATOR_2 & VALUE = BT

NAME = VAR_SIGN_2 & VALUE = I

NAME = VAR_VALUE_LOW_EXT_2 & VALUE = <value>

NAME = VAR_VALUE_HIGH_EXT_2 & VALUE = <value>

I have performed a test for a query whose results are to be sent to me :

- at my company internal address --> when I open the mail (through outlook), I have an authentication pop up requiring my SAP credentials

- at a private external address (gmail) : indeed, no authentication is required but the layout is not really nice.

athavanraja
Active Contributor
0 Kudos

your variable declaration looks fine. can you go into debuggin and check whats the value in

result_content = e_r_page->n_sx_output-string.

note: if you are using hierarchy node variable you also need to use VAR_NODE_IOBJNM_1 = 0HIER_NODE

about the authentication popup.

Sorry i realize the issue now. outlook is trying to access the MIME objects from the SAP server. this is a known issue and there is a OSS note for this. ( IDONT REMEMBER THE NOTE NO. NOW just search this forum, i have in few posts provided the note no.) its basically about defaulting user id password in the bw/MIME SERVICE in SICF tree.

Regards

Raja

Former Member
0 Kudos

Here is the content of internal table TEXT (populated from RESULT_CONTENT) :

<html>

<head><title>BW Web Application</title>

<script language="Javascript">

function unload()

{

if (navigator.appName == "Microsoft Internet Explorer")

{

var pWin = window.open( "//?_function=WEBQUERY&~SESSION=&PAGENO=1&REQUEST_NO=1

&CMD=PAGE_FREE", "", "width=1,height=1,innerWidth=1,innerHeight=1,scrollbars=no,resizable=no");

while (pWin.document.readyState != "complete"){

}

if (pWin.document.readyState == "complete"){

pWin.close();

}

}

else {

var pWin = window.open( "//?_function=WEBQUERY&~SESSION=&PAGENO=1&REQUEST_NO=1&CMD=PAGE_FREE", "", "width=1,height=1,innerWidth=1,innerHeight=1,scrollbars=no,resizable=no");

pWin.close();

}

}

</script>

</head><frameset framespacing="0" bord

er="0" frameborder="no" onunload="unload()" cols="*">

<frame src="//?_function=WEBQUERY&~SESSION=&PAGENO=1&REQUEST_NO=1&CMD=GET_TEMPLATE" name="Content">

</frameset></html>

I do not use any hierarchy node variable.

Thank you for the tip about the issue.

athavanraja
Active Contributor
0 Kudos

here is the OSS note number i was talking about in the earlier post

oss note no. 653099

about the problem with query execution do the following to analyze the error.

go to transaction se37 and enter the following FM name

RRW3_WEBRFC, go into the source code and place a HTTP break point at the start of the code (if i_r_parameter is initial.)

now your your webtemplate normally from browser it should stop at the break point. analyze the values in the iternal table iwthing the fm (<b>l_t_query</b>) with the values you have passed when calling the Y function module.

Regards

Raja

Answers (0)