Hi,
While trying to launch HTML Mashup in custom BO TI screen, i am getting an error in console log..
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://mashup-de.sapbydesignmashups.com') does not match the recipient window's origin.
Not sure why is it causing. I have followed the steps from the following blog but could not able to display a HTML mashup..
I tried my HTML code as sample HTML page and it worked.
here is my HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<script type="text/javascript">
function dateConversion(sdate) {
dArr = sdate.split("-");// ex input "2010-01-18"
return dArr[0]+dArr[1]+dArr[2];
}
function init()
{
var Agreement = sap.byd.ui.mashup.context.inport.AgreementID;
var Participant = sap.byd.ui.mashup.context.inport.EmployeeID;
var DateFrom = sap.byd.ui.mashup.context.inport.DateFrom;
var DateTo = sap.byd.ui.mashup.context.inport.DateTo;
DateTo = dateConversion(DateTo);
DateFrom = dateConversion(DateFrom);
// var Agreement = '0000000532';
// var Participant = '0000070001';
// var DateFrom = '20140201';
// var DateTo = '20140201';
var Application = 'COMP_QUOTA_PLAN';
if (Agreement == '0000' ) {
Application = 'COMP_QUOTA_PLAN';
}elseif (Agreement == '0010') {
Application = 'COMP_MBO_PLAN';
}
var url = 'https://XXXX.vistex.net/avenger/clouddemo/sfdc/';
url = url + Application+'/? eventName=SEARCH&PRTTP=SR&AGCTG=A1&AGRMT='+Agreement+'&PRTCT='+Participant+'&EVFDT='+DateFrom+'&ETDAT='+DateTo+'&DFDAT='+DateFrom+'1&sap-user=XXXX&sap-password=XXXXX';
var iframe = document.createElement('iframe');
// var ORIGIN = sap.byd.ui.mashup.context.inport.URL;
iframe.src = url;
iframe.height="1000px";
iframe.width = "100%";
document.body.appendChild(iframe);
}
</script>
</head>
<body onload="init()">
</body>
</html>
Regards,
Kishore