cancel
Showing results for 
Search instead for 
Did you mean: 

Help with VC to WAD EPCM events

Former Member
0 Kudos

Greetings Everyone -

I'm attempting to set up sending events from VC to WAD via the EPCM events and not having any success. I've set up my VC app according to this document (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ad182ac7-0a01-0010-4fb8-8a4d217b19c1).

An iview has been created that contains the WAD template (v3.5) and a page has been created with the VC app and the WAD iview.

The VC app has an output signal named "out1" and the following JS code is included in the WAD template:

<SCRIPT src="/sap/bw/Mime/BEx/JavaScript/epcfproxy.js">

EPCMPROXY.subscribeEvent( "urn:com.sap.vc:epcm", "out1", "myreceiveEvent");

function myreceiveEvent(eventObj) {

alert("hello");

}

With this code I'm simplying trying to create an alert when the webtemplate receives the out1 event but it's not even firing the function.

Is the subscribeEvent method a listener or must this be initiated with an event, onclick, onload, etc? I've researched the library and reviewed the forum and from what I can find this should work.

Any advice would be very helpful.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks to both for your advice. I used httpwatch to verify the js is included. I also removed this reference, changed the signal out and port names, re-compiled and it is working. Thanks again.

arun_ev
Participant
0 Kudos

Hi Todd,

Try to include the src statement in a separate java script file ir separate the statements as below.

<SCRIPT src="/sap/bw/Mime/BEx/JavaScript/epcfproxy.js">

</script>

<script>

EPCMPROXY.subscribeEvent( "urn:com.sap.vc:epcm", "out1", "myreceiveEvent");

function myreceiveEvent(eventObj) {

alert("hello");

}

</script>

See if this helps. Also you can use the HTTP watcher(Prakash gave this wonderful suggestion) to see the actions on the page. So you can see if the scripts are loading or not.

Arun E V

Former Member
0 Kudos

You shouldn't have to have the js include manually. This should be added by the portal framework. Remove this and then test this using httpwatch or any other http sniffer to see that the epcfproxy.js is added when calling the iView. Also, to alert the value out, you need this:


alert(eventObj.dataObject);

This alerts out the xml string received from VC. To make it more intelligble, you may want to unescape it as follows:


alert(unescape(eventObj.dataObject));

If you're not alerting out the "hello" string in your page, test this:

1. Make sure VC and WAD are using the same fully qualified domain name.

2. Make sure you don't have the javascript error in the bottom left of your IE browser.

Cheers,

Prakash