cancel
Showing results for 
Search instead for 
Did you mean: 

'EPCM' is undefined

cezar_manechini
Explorer
0 Kudos

Hi,

I´m trying to use the Client Data Bag API under EP 6.0 with this simple code in a BW Web Report, but I'm getting the error: 'EPCM' is undefined. What can be wrong?







TEMPLATE PROPERTIES







function fn_AnimalSelect(){
var IsAnimal = document.forms["FrmAnimalSelector"].AnimalSelect.value;
EPCM.storeClientData("urn:com.sapportals.portal.epcmdemo.animals","animalstored",IsAnimal);
}




select animal:


bison

fox




Thanks,

Cezar

Accepted Solutions (1)

Accepted Solutions (1)

darrell_merryweather
Active Contributor
0 Kudos

You may need to change the 'Load' option of the iView to get the EPCM stuff to appear. Try playing with the three load settings of the iView

I hope this helps

D

nol_hendrikx
Active Contributor
0 Kudos

Hi Cezar,

You did not include the EPCM javascript file. Here is some usefull information:

<b>EPCM Proxy</b>

The EPCM proxy allows the EPCF functionality in Portal applications that are rendered in their own IFrame (for example, ITS-based applications and BSP).

<b>“Reload” Function and Event-Subscription</b>The EPCF event methods are used by function reference. Since the references are kept across the IFrame borders, the references become invalid whenever the IFrame content is reloaded. To solve this problem, you have to use the second signature of the EPCM.subscribeEvent method that references to the current window object. EPCM.subscribeEvent(nameSpace, name, window_reference, method_name) External applications (for example, BSP, BW-Reports) are rendered in their own IFrame. The EPCM Object therefore can convert the event handler registration from [window_reference,method_name] to [iframe_name,method_name]. With this conversion the method keeps the name and not the object/method reference. When the IFrame content is reloaded now, the iframe_name and method_name are still valid and the event handler, that is located inside the IFrame, can be called from the EPCM event manager outside the IFrame using the following call: window.frames[iframe_name][method_name]( event_data )

<b>IncludeProxy</b> To simplify the implementation, the EPCMPROXY object is provided that serves as the proxy. The EPCF calls within the IFrame are delegated by the proxy layer to the upper EPCF layer. So instead of EPCM calls you use EPCMPROXY. THE EPCMPROXY object is in the JavaScript file epcfproxy.js that comes with the Portal and has to be included into your Portal application.

<b>Usage</b> Usage of the JavaScript file epcfproxy.js in a HTML page:

<HTML> <HEAD> <TITLE>EPCMProxy test example</TITLE>

<!-- This is a general proxy to delegate all EPCM method calls to the upper frame -->

<u><i><b><SCRIPT src="epcfproxy.js"></SCRIPT></b></i></u>

You only need the above line (epcfproxy.js).

Source: http://help.sap.com/saphelp_nw04/helpdata/en/ce/3e98408d953154e10000000a1550b0/frameset.htm

Kind regards,

Noel

cezar_manechini
Explorer
0 Kudos

Hi Noel,

I included the EPCM javascript file and used the EPCM Proxy, according yo the help.

It worked perfectly!

Thanks, and Best Regards.

Cezar

Answers (0)