cancel
Showing results for 
Search instead for 
Did you mean: 

BSP: How copy received portal event string to ABAP-Page-Attribute variable?

Former Member
0 Kudos

Hi,

I am able to receive and display portal events (EPCF API) with the following code:


<SCRIPT src="epcfproxy.js"></SCRIPT>
<script language="javascript">
if(window.document.domain == window.location.hostname){
document.domain = document.domain.substring(document.domain.indexOf('.')+1);
}
    EPCMPROXY.subscribeEvent("urn:com.sap:BWEvents","BWiViewevent", window, "myreceiveEvent");

function myreceiveEvent( eventObj ) {
   alert("event received:" + eventObj.dataObject );
}

But now the received data is only stored in Javascript-"variables".

How can I copy the received string to ABAP variables? These variables will be declared as Page Attribute (e.g. rec_event_data TYPE STRING)

Is my Javascript-solution a good way to handle portal events or are there better solutions?

Thanks a lot.

Regards,

Henning

Accepted Solutions (0)

Answers (1)

Answers (1)

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Did you make any progress ?

Thanks.

Best regards,

Guillaume

Former Member
0 Kudos

Hi,

yes I was able to do it.

The code should be something like this. I can not test it at the moment.


function myreceiveEvent( eventObj )
{
        document.form1.rec_event.value = eventObj.dataObject;
        document.form1.submit();
}


 <htmlb:form id="form1">
      <input type="hidden" name="rec_event" value="">
</htmlb:form>

Event Handler: OnInputProcessing


rec_event_data = request->get_form_field('rec_event').

Regrads,

Henning