HI,
I'm trying to set up an eventing between standard MSS teamviewer and a BSP application in EP .6.0 SP2. The applications run on different servers but the two servers are on the same top level domain.
The standard MSS teamviewer is placed in the Dynamic navigation part of the page and the iView based on the BSP application is placed in the normal Page content and has isolation method "url"
The standard MSS teamviewer raises an event when clicking on an employee in the list (handleObjectChange). Here is an extract of the code
<script>
EPCM.relaxDocumentDomain();
function handleObjectChange(otype, concatenatedKey) {
HCMEP_setCookie("urn:com.sap.pct.hcm.orgmanagement:CurrentObject", concatenatedKey, null, "/");
setDataBags(otype, concatenatedKey);
raiseEvent(concatenatedKey);
}
function setDataBags(otype, concatenatedKey) {
EPCM.storeClientData( "urn:com.sap.pct.hcm.HCMCKey:CurrentObject", otype, concatenatedKey);
EPCM.storeClientData( "urn:com.sap.pct.hcm.HCMCKey:CurrentObject", 'A_ALL', concatenatedKey);
EPCM.storeClientData( "urn:com.sap.pct.hcm.HCMPlvar:CurrentObject", 'A_ALL', '01');
EPCM.storeClientData( "urn:com.sap.pct.hcm.HCMSystIdent:CurrentObject", 'A_ALL','SAP_R3_HumanResources');
}
function raiseEvent(concatenatedKey) {
<b>EPCM.raiseEvent( "urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "objectChanged", concatenatedKey);
}</b>
function handleComponentEvent(eventObj) {
var cKey = window.HCMCKey;
if ((cKey != null) && (cKey != ""))
{ EPCM.raiseEvent( "urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "objectFor" + eventObj.sourceId, cKey,"A_ALL" ); }
}
</SCRIPT>
So in my BSP iView that receives the event I wrote:
<html><head>
<SCRIPT src="/sap/public/bsp/sap/public/bc/htmlb/airbus/epcfproxy.js"></SCRIPT>
<script language=javascript>
// EPCM.relaxDocumentDomain();
function myreceiveEvent( eventObj ) {
alert(eventObj.dataObject);
}
<b>EPCMPROXY.subscribeEvent( 'urn:com.sap.pct.hcm.orgmanagement:CurrentObject', 'objectChanged', myreceiveEvent );</b></script>
</head>
<body>
</body>
</html>
When I put the two codes on the same server (WAS) and use EPCM instead of EPCMPROXY, everything works fine.
Do you know what is missing ? Is it something related to domain relaxing?
Thanks for your support,
Silvia.
Did you see in the source code of the BSP iView, the
presence of src link to EPCMPROXY object or to any
file which contains that object ?
What did you selected as the load method of the two
iviews ? I believe it should be "Bybass the iView server".
If it is the case of domain relaxation problem, you can
figure it out by looking at the browser status bar (right
hand side, lower). If it is any thing like 'unknown zone(
mixed)', it is the problem. You may try to include the
address of both the servers in the trusted sites list
of the 'intranet' or 'internet' zone. Tools --> internet
options --> security --> internet/intranet
Hope this helps,
--Prasad Nutalapati
Hi.
I solve your problem.
you hava problem at method name.
you need to replace myreceiveEvent to <b>"myreceiveEvent";</b>
when you subscribeEvent. I mean you need to add " to make correct methoname.
EPCMPROXY.subscribeEvent( 'urn:com.sap.pct.hcm.orgmanagement:CurrentObject', 'objectChanged', <u><b><b>myreceiveEvent</b></b></u> );
Best regards,
Joonpyo Park
Hi,
I have the same problem. I always get the error "permission denied" when I try to call the EPCMPROXY method, which just puts "parent." in front of the method called. Anyway, my BSP is on a different host than the portal, but within the same top level domain. Domain Relaxation is done and I tested that with 2 BSPs on different hosts.
I created a page including the MSS teamviewer and my BSP. Can do what I want, I just can't fix it - alway "permission denied".
Here is my code of the BSP:
if ( document.domain.indexOf(".") > 0 ) document.domain = document.domain.substr(document.domain.indexOf(".")+1);
function run() {
EPCMPROXY.subscribeEvent( "urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "objectChanged", window, "handleEvent");
}
function handleEvent( evt ) {
alert(evt);
}
</script>
<body onLoad="run();">
</body>
Hope anybody can help!
Message was edited by: Sebastian Grabherr
Hi,
I have also encountered the error (EPCMPROXY is undefined) when I have two different iViews on the same page subscribing to the MSS teamviewer. If I remove either one of the subscribing iView, then there will not be any runtime error.
Anyone knows what is causing this problem?
Part of my codes as followed:
...
<SCRIPT src="epcfproxy.js"></SCRIPT>
<script language=javascript>
var lnDotPos = document.domain.indexOf( "." );
if (lnDotPos >= 0) document.domain = document.domain.substr( lnDotPos + 1 );
EPCMPROXY.subscribeEvent( 'urn:com.sap.pct.hcm.orgmanagement:CurrentObject', 'objectChanged', window, 'myreceiveEvent' );
function myreceiveEvent( eventObj )
{
var dataKey=eventObj.dataObject;
Emp1.EmpID.value = dataKey.substr(6,8);
Emp1.submit();
}
</script>
...
Regards,
Seow Ting
Add a comment