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

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

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

Similar Messages

  • How to fire an event dynamically in JSF Page

    Hi All
    How to fire an event dynamically in JSF Page?
    Thanks
    Sudhakar

    Hi,
    Thanks for the response. I mean to say, if I create the components dynamically then how can I fire events for those components.
    In otherwords,
    If I create the Button dynamically with particular ID being set to that component, then how can I call button action event when the button is clicked??
    Hope you understand
    What is the role of MethodBinding mechanism here??
    Thanks
    Sudhakar Chavali

  • Portal eventing in WD ABAP

    Hello ,
    We have an requirment to pass values from one WD ABAP application iView to another in the Enterprise portal.Is there any configuration that needs be done in WD ABAP or is there any setting in EP that we need to do ??
    Rahul

    Rahul,
    Though most of this stuff is of web dynpro for java. You can just replace java Code with ABAP.
    You need to use eventing functionality.In the SAP Enterprise Portal, different application types in specific iViews can be arranged on one page. To communicate between the different iView types the portal provides the Enterprise Portal Client Framework (EPCF), also known as client-side eventing. This document describes how Web Dynpro applications can use EPCF.
    http://help.sap.com/saphelp_nw04/helpdata/en/24/243ca46e1c334f8a6f8b0792656bc7/content.htm
    The following code shows the signature of the subscribe method:
    WDPortalEventing.subscribe(java.lang.String nameSpace, java.lang.String event, IWDAction action);
    for example
    WDPortalEventing.subscribe (“urn:com.sap.tc.webdynpro.test.portal”,
        “TestEvent”,
        wdThis.wdGetTestEventAction());
    You have to define the event’s name and its namespace. The combination of these two names must be unique.
    The third parameter is the Web Dynpro action, which should be mapped to the portal event. The action event handler is called if the Web Dynpro application receives the specified portal event on the client side. The mapping between a portal event and a Web Dynpro action is done automatically and it is completely transparent for the Web Dynpro application developer.
    You can reuse a Web Dynpro action for several portal events. If you want to receive the portal event’s data you have to define the following parameters for your Web Dynpro action:
    ·        dataObject
    The dataObject parameter contains the portal event parameter.
    ·        nameSpace
    The namespace parameter contains the portal event’s namespace.
    ·        name
    The name parameter contains the portal event’s name.
    It is useful to add the nameSpace and nameparameters to the Web Dynpro action if the action is reused for several portal events because you can use this information to differentiate between the portal events.
    Note: In the current version a portal event subscription is valid for a Web Dynpro view. Therefore you should add the required Java coding, for example in the wdDoInit() method of the generated view class. If you navigate between different views, you have to subscribe to every view for the portal event required.
    Unsubscribe from a portal event
    Unsubscribing from a portal event is very similar to subscribing. The following code shows the signature of the unsubscribemethod:
    WDPortalEventing.unsubscribe(java.lang.String nameSpace, java.lang.String event, IWDAction action);
    for example
    WDPortalEventing.unsubscribe (“urn:com.sap.tc.webdynpro.test.portal”,
        “TestEvent”,
        wdThis.wdGetTestEventAction());
    Note: You must unsubscribe every Web Dynpro view, because subscription and unsubscription is valid only for the current view.
    Raise a portal event
    The following example shows how to raise a portal event. The signature is:
    WDPortalEventing.fire(java.lang.String nameSpace, java.lang.String event, java.lang.String parameter);
    for example
    WDPortalEventing.fire (“urn:com.sap.tc.webdynpro.test.portal”,
         “TestEvent”,
        “AParameter”);
    You can fire a portal event anywhere in your Web Dynpro application. The event is sent to the client  with the next response. You can also raise more than one portal event in a request-response cycle. Typically, you will fire a portal event in a Web Dynpro action event handler (for example, as a response to pressing a button).
    The following step-by-step example shows how to carry out portal eventing within two simple Web Dynpro example applications.
    Example Description
    The user can enter an arbitrary string in an input field. If the user presses the pushbutton Click here in the sender view, the input string will be displayed in a TextView UI element of the listener application.
    Prerequisites
    You have built two Web Dynpro applications. How to build Web Dynpro applications is described in Creating a Simple Web Dynpro Application. In each application you have created a Web Component with a view that uses the portal eventing.
    You can find the detailed procedure describing how to insert UI elements into a view in Creating a Simple Web Dynpro Application.
    Further information about the integration of a Web Dynpro application into the SAP Enterprise Portal can you find under Running a Web Dynpro Application in SAP Enterprise Portal.
    Procedure
    Creating the Web Dynpro applications
           1.      Create the Web Dypro project. Call it webdynproexample_portal_eventing.
           2.      Create two Web Dynpro components. Call them:
                                a.      EventSenderComponent
                                b.      EventListenerComponent
           3.      Create two Web Dynpro applications. Call them:
                                a.      EventSenderApplication
                                b.      EventListenerApplication
    Creating the necessary views:
    Create the layout of the EventSenderView in the EventSenderComponent as follows:
    Create the context structure of the EventingSender View:
    The context value attribute Name must be of type String.
    Create an action “Show”
    Define the data binding of corresponding UI element properties:
    The appropriate properties of the UI elements must be bound to the context that contains and displays the data.
           4.      Define a text, for instance, “Enter a text:” for the label UI element (ID: NameLabel) using the property text.
           5.      Bind the property value of the input field (ID: NameInputField) to the context attribute Name.
           6.      Bind onAction of the button (ID:ShowButton) to the corresponding action Show.
    Implementation of the view controller
           7.      If you create an action declaratively within the SAP NetWeaver Developer Studio, the Web Dynpro framework automatically generates an onAction method in the controller’s implementation. The generated method enables you to write code to fetch the input string and to fire the portal event. The fire method of WDPortalEventing passes the data and the name of the event that should be handled by the second application as parameters. The following code shows the implementation of onActionShow method:
    public void onActionShow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionShow(ServerEvent)
       String name = wdContext.currentContextElement().getName();
        WDPortalEventing.fire("urn:com.sap.tc.webdynpro.example.portaleventing",
                           "Show",
                           name);
        //@@end
    Create the layout of the EventListenerView in the EventListenerComponent as follows:
    Create the context structure of the EventingListenerView:
    The context attribute Name must be of type String.
    Create an action, for example, ReactPortalEventing which should be mapped to the portal event.
           8.      Create an action ReactPortalEventing.
           9.      Add the parameter dataObject. It should have the type java.lang.String.
    Define the data binding of the corresponding UI element properties:
    The corresponding properties of the UI elements must be bound to the context that contains and displays the data.
    10.      Define a text for the NameLabel for example, The entry is displayed in a TextView UI element:
       11.      Bind the property text of the TextView UI element (ID: TextViewShow) to the context attribute Name.
    Implementation of the view’s controller
       12.      You have to subscribe to the event within the wdDoInit method. You have to define the namespaceof the event and the name of the event, for example Show. The third parameter is the Web Dynpro action, which should be mapped to the portal event.
       13.      You have to implement the action (ReactPortalEventing) that passes the dataObjectand fills the context with data. The following code shows the implementation of the wdDoInit and the reactPortalEventing methods:
    public void wdDoInit()
        //@@begin wdDoInit()
        WDPortalEventing.subscribe("urn:com.sap.tc.webdynpro.example.portaleventing", "Show",
        wdThis.wdGetReactPortalEventingAction() );
        //@@end
    public void onActionReactPortalEventing(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String dataObject )
        //@@begin onActionReactPortalEventing(ServerEvent)
        wdContext.currentContextElement().setName(dataObject);
        //@@end
    Deploying the Web Dynpro Application
    Before you can call the Web Dynpro application, you have to build the Web Dynpro project and deploy the application on the J2EE Engine.
    Simple Testing of the Portal Eventing and Calling the Web Application
       14.      Create two iViews in the newly-created example folder as described in Running a Web Dynpro Application in SAP Enterprise Portal.
       15.      Create a page and add the two iViews to the newly-created page.
    To preview the Web Dynpro applications, choose the button Preview in the Portal Content Studio.
       16.      Enter your input and choose button Click here.
    Result
    A page preview will demonstrate portal eventing.
    Also, Please refer to these links,
    http://help.sap.com/saphelp_nw04/helpdata/en/c6/21fc3f82c2e469e10000000a155106/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/portal integration of web dynpro applications.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cfb80249-0801-0010-3eaa-829afeac170f
    Please let me know whether its useful.
    Thanks,
    Raj.

  • Settings Portal eventing - WebDynpro for Abap iView communication

    To connect two WD4A's using portal eventing; what work is to be done inside the portal environment.
    All manuals on SDN provide information action to be done within WD4A, Do we need to configure/set values in the Portal environment at al...

    Hi Marco,
    Check the url:
    [help.sap.com - Client-Side Eventing|http://help.sap.com/saphelp_nw70/helpdata/EN/ce/3e98408d953154e10000000a1550b0/frameset.htm]
    Best regards,
    G. Leurs

  • Portal Eventing in Webdynpro ABAP

    Hello,
    I am trying to implement Eventing in Webdynpro ABAP using 2 components ,Com1 serving as the source component and Com2 serving as Target. In Com1 I created a Inputfield and a button ,and then tied an action to the button and called the FIRE method of the IF_WD_PORTAL_INTEGRATION and sent the value in the Inputfield as the eventing parameter.
    In Com2, i subscribed to the event in the wddoinit() method and then defined an action for the same and got the parameter value sent in the Com1 and set the value in the context attribute in the Com2 which is bound to the inputfield.
    But still the value sent in Com1 is not displayed in the Com2 Inputfield.
    Any help would be highly appreciated.
    Thanks.

    >
    SAPEPDeveloper wrote:
    > Hello,
    >
    > I am trying to implement Eventing in Webdynpro ABAP using 2 components ,Com1 serving as the source component and Com2 serving as Target. In Com1 I created a Inputfield and a button ,and then tied an action to the button and called the FIRE method of the IF_WD_PORTAL_INTEGRATION and sent the value in the Inputfield as the eventing parameter.
    >
    > In Com2, i subscribed to the event in the wddoinit() method and then defined an action for the same and got the parameter value sent in the Com1 and set the value in the context attribute in the Com2 which is bound to the inputfield.
    >
    > But still the value sent in Com1 is not displayed in the Com2 Inputfield.
    >
    > Any help would be highly appreciated.
    >
    > Thanks.
    Hi I assume the following, please correct me if my understanding is not correct.
    1.First of all you try this in Portal.
    2.The moment you fire the event, the comp-2 view is active and subscribed to the portal event.
    If the above are true then tell me if the portal eventing enter into the action ?Have you checked in bebug that your action is triggerred on portal_event ?
    If portal event is action handler is called then if you have a importing parameter portal_event_parameter then your input value should be there.

  • How to pass background event parameters to ABAP program in SM36

    Hi team,
         I want to pass background event parameters to ABAP program on job scheduling in SM36. For example, Background jobs will trigger, once background event triggered from Non-SAP system using SAPEVT command with parameters.
         I want to pass the event parameter values to the ABAP program . Can you please help me on this.
    Regards,
    Anand Krishnan

    Hi,
    Which ABAP program - the one that will be executed as a job step? If yes, I don't believe you can "pass" something to it because it will be started by "job starter" of SAP background processing run-time system. The ABAP program executed in background can, however, get the job run-time information using FM GET_JOB_RUNTIME_INFO, which also returns EVENTID and EVENTPARM. Is that the event parameters you were looking for?
    cheers
    Jānis

  • How to receive an event in the client bean from the server bean?

    when i click the button1 in the server bean,the textfield1 in client bean should set to 1.how to do that in java application?
    thx

    can you give me an example code about how to add this action listener?
    i uses the following code,but it doesn't work.
    the client bean can't capture the sendMyEventObject method!!
    help!!!!
    private void jSendInterestRate_actionPerformed(ActionEvent e)
    if (ChcekDoubleValue(jInterestRate) && ChcekDoubleValue(jPrincipal) && ChcekDoubleValue(jYear))
    interestRate = Double.parseDouble(jInterestRate.getText());
    principal = Double.parseDouble(jPrincipal.getText());
    year = Integer.parseInt(jYear.getText());
    sendMyEventObject(interestRate,principal,year);
    }

  • Portal Eventing: communication betn BSP - WD iView

    Hi All,
    i am doing portal eventing between WD Abap iView and BSP iView with the help of blog <a href="/people/thomas.jung3/blog/2005/12/15/portal-eventing-a-solution-for-global-peace-and-harmony:///people/thomas.jung3/blog/2005/12/15/portal-eventing-a-solution-for-global-peace-and-harmony.
    i have created page which has both iViews.
    but i am not able to trigger the event from BSP to WD.
    please suggest me some direction regarding this.
    Regards,
    Chandra

    Hi,
    the domain is the first part in your URL, for example www.sdn.sap.com.
    In your case it will probably the hostname of your computer.
    The reason for this is security. The portal eventing is build in Javascript and in Javascript it is not allowed to access other frames that are not in the same domain.
    Best regards
    Renald

  • How to create a event to display records depend on selection ofdropdownlist

    BSP
    how to create a event to display records depend on selection of dropdownlist box,
    Using BHTML,
    thank you,
    regards,
    jagrut bharatkumar shukla

    1) Copy this script to the code
    <script type="text/javascript">
    function displayVacationDates() {   
        for (var i=0; i < document.forms[0].Status.length; i++) {
            if (document.forms[0].Status[i].checked && document.forms[0].Status[i].value=='Vacation'){
              document.getElementById('startDateRow').style.visibility='visible';
              document.getElementById('endDateRow').style.visibility='visible';
             if (document.forms[0].Status[i].checked && !(document.forms[0].Status[i].value=='Vacation')){
             document.getElementById('startDateRow').style.visibility='hidden';
              document.getElementById('endDateRow').style.visibility='hidden';
    </script>
    2) Set initial style to 'hidden'
    <tr id="startDateRow" style="visibility:hidden">
    <td align="left"><blockquote>
      <p><span class="style16 style8"><strong>Start date:
      </strong></span></p>
    </blockquote>                 </td>
    <td align="left"><script>DateInput('VacStart', true, 'DD-MON-YYYY')</script></td>
    </tr>
    <tr id="endDateRow" style="visibility:hidden">
    <td align="left"><blockquote>
      <p><span class="style16 style8"><strong>End date:
      </strong></span></p>
    </blockquote>                      </td>
    <td align="left"><script>DateInput('VacEnd', true, 'DD-MON-YYYY')</script></td>
    </tr>
    3) Call the display script
    <input name="Status" type="radio" value="In the Field" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="Vacation" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="Sick day" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="Admin Day" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="DSR Ride Along" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="ServiceCall" onclick="displayVacationDates()">

  • How to handle events in webdynpro abap

    Hi,
    can any body explain how to handle the events in webdynpro abap.
    i want to know some concepts in general.
    Thanks,

    Hi Mahesh,
    you can create event handlers under the actions tab in you view. evry event handler has an importing parameter wdevent of type ref to cl_wd_custom_event.
    you can also create events in your component controller and they can be handled within your views
    check cl_wd_custom_event class for details about what all information you get when an event occurs.
    for further details you can check out the following links
    http://help.sap.com/saphelp_nw04s/helpdata/en/eb/ed6f4169e25858e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/a9/c751415e3b6532e10000000a1550b0/frameset.htm
    also you can try the tutorial at the following link for further clarity
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2eb11b59-0a01-0010-dfa3-8292abdf9c4f
    Regards,
    Shweta
    Message was edited by:
            Shweta R Shanbhag

  • What is portal eventing?

    Hi Gurus,
    If anybody has good documentation on portal eventing please send it to shakthigin @yahoo.co.in
    or please give me the links to the document.
    Thanks in Advance,
    Dharani

    Hi,
    Here are those
    a good blog Portal Eventing; A Solution for Global Peace and Harmony?
    http://help.sap.com/saphelp_nw04/helpdata/en/37/8ca9409ecd1314e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/f6/7d6f4151dc5758e10000000a1550b0/frameset.htm
    portal Eventing
    a very good pdf... but dont know why its not working now https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/how%20to%20use%20the%20portal%20eventing%20for%20web%20dynpro%20iviews.pdf
    this is also
    https://media.sdn.sap.com/html/submitted_docs/Best_Practices/EP/documentation/How-to_Guides/32_HowTo_Use_portal_eventing.pdf
    how to use portal eventing a good pdf   https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60d7d690-0201-0010-e581-9c4fc69cec0e
    PradeeP

  • Javascript server events in webdynpro ABAP

    I am migrating an existing BSP application to webdynpro abap. Few of sections, in existing BSP application, uses java script coding to trigger few server events. For example it uses a flash charts on click of which some filtering logic is written on table. Similar logic needs to be placed for webdynpro. I used Iframe to display this charts. Charts are rendered properly but I am not able to raise the actions or trigger events on server as I don’t have access to parent.document object of my parent view.
    I get access denied/ permission denied error.
    Can’t we trigger server action or event using JavaScript from child IFrame.
    With Regards,
    Nitesh Shelar.

    Hi Nitesh,
    Integrating custom java script is not supported. There are still a few benefits BSP has over WDA. Well, you could put the flash object inside of a BSP application and use portal eventing to communicate with WDA.
    Best regards,
    Thomas

  • Jnet events in Webdynpro ABAP

    Hi ,
    I am urgently looking for the demo WD project in Webdynpro ABAP which demonstrate use of the different events for JNet for example :: CELLS_SELECTED , ROW_SELECTED , NODE_SELECTED .

    Hi Nitesh,
    Integrating custom java script is not supported. There are still a few benefits BSP has over WDA. Well, you could put the flash object inside of a BSP application and use portal eventing to communicate with WDA.
    Best regards,
    Thomas

  • How to use Portal SSO with existing BSP application

    Hi all,
    we run SAP EP 6.0 here and have a single start BSP page of
    an application integrated with the SAP appintegrator for BSP. The rest of the existing BSP application still uses
    the login functionality based on CL_BSP_LOGIN_APPLICATION
    and is not integrated in the portal.
    Problem: If a user directly accesses one of the "old" BSP pages, he should be redirected to the portal to auth. him via SSO and afterwards the original BSP page with all its parameters should be processed.
    How to deal with that? Is there a similar mechanism like with the BSP_LOGIN_APP in between for the SAP EP?
    Thanks for your help!
    -RAINER-

    I think that doesnt solve the problem.
    I have 2 systems: SAP ECC with all BSPs and the portal on another system. So I have to entry points: Via portal using the appIntegrator BSP or directly to the ECC.
    As-is: If the auth. for the BSP appl. fails, the user is re-directed via the error page given in the service (SICF)
    to a BSP login app. and from there to the requested page.
    No portal in this concept.
    Must-be: A user is still able to directly access a BSP on the SAP ECC by entering the URL in the browser. It's not a must entering via the portal first.
    So when the login failed on the ECC (no SSO ticket), he should be redirected to the portal for getting his SSO.
    After he signed in successfully the user will be forwarded to the BSP page he entered in the browser the first place.
    I can't see a way to use the URL iView. I am thinking of simply changing the login mechanism of the BSP using the portal login functionality.
    The link you gave me offers an implementation of CL_ICF_SYSTEM_LOGIN. Any ideas?
    Regards,
    -RAINER-

  • How to determine portal user in a BSP

    Hi,
    is it possible to determine the current logged in portal user in a BSP iView? If it's possible, how?
    regards

    it is possible.
    1. if spalogon ticket based SSO, then with BSP application, sy-uname will hold the user id.
    2. if the sso is based on user mapping (different logged on user in EP and different user id for logging on to ABAP system)
    check this link where i have explained on how to do this
    Re: EP user credentials as attributes of BSP
    in the bsp application iview application parameter
    pass
    you need to use
    epuser=<User.UserID>
    you can also use
    epuser=<User.LogonUid>
    then in the corresponding bsp page have page attirbute with auto check with the name epuser. now epuser will  hold the ep logged on user
    Regards
    Raja

Maybe you are looking for

  • Can't see the installed icc profiles for my paper in print module

    I have downloaded and installed the icc profiles for my favourite Canson and Crane Museo papers on my new Macbook Pro but they don't show up in the options box in the LR 4 print module. Is there another step I have missed? Thanks in advance.

  • ITunes 10.2.2 - Why have all of my mp3 files have been duplicated in the filesystem?

    Nearly every single "Song.mp3" has a corresponding "Song 1.mp3". It's going to take forever to clean up manually. This isn't just an issue with "recently added" music, it looks like every item in the filesystem has been duplicated. I didn't, to my kn

  • Font in svg file

    I create a svg file with php which includes a dynamic text. Therefore I have embedded the used font with <font><font-face><glyph>.... This works fine with Chrome, but Firefox uses the standard font. How can I use an embedded font in the svg file? Tha

  • Sent e-mails do not deliver in th same format

    Using windows 7 with aol, I recently have been sending e-mails that do not arrive in the same format that I sent. Spacing is out of line, columns are out of order and the page is almost unreadable.

  • Sending messages in order to a DB

    Hi everyone I´m sending messages from an R/3 system to a Database without a BPM. Do someone know how can I simulate the Exactly Once in Order in a JDBC Receiever Communication Channel Cause I need the messages to arrive in nthe order that they gor ou