Skip to Content

HTML Mashup error while launching

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..

http://scn.sap.com/community/business-bydesign/studio/blog/2014/02/24/html-script-mashup--launched-from-an-embedded-component

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Dec 11, 2014 at 03:24 AM

    I am able to view the mashup using firefox browser but not in Google Chrome.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.