Skip to Content
avatar image
Former Member

Pass pernr to WebDynro

Hi,

I've developed an ABAP Web Dynpro for MSS, how can I pass it the pernr of an employee selected from the team viewer?

Regards,

Rob

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 09, 2010 at 04:55 AM

    Rob,

    It's certainly possible with the WDJ Team Viewer from the MSS ERP2005 Business Package , have a look at note 1112733 for details.

    The main limitation we have found with it is that your WebDynpro ABAP iView will only be passed the parameter once the user has clicked on an employee in the Team Viewer, whereas the equivalent WDJ iViews seem to get passed the parameter on initialisation.

    The best we could come up with was to put some text like "Select an employee from the team viewer list" in the start screen of the WDA applications.

    Cheers,

    John

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 11, 2010 at 11:32 AM

    Hi,

    you can do this by following: My assumption here is that in your portal page...you have two iviews: team viewer iview and your custom wda iview....so you want to get the selected employee...i mean when manager clicks on an employee you want to get their pernr.....you can achieve this by doing this:

    1) go to your custom developed component and the first view...which will be shown the moment manager's click on an employee.....in the WDDOINITmethod of that view....write following code....

    ***********************************************************************************************************************************************

    DATA lo_api_component type ref to if_wd_component.

    DATA lo_portal_manager type ref to if_wd_portal_integration.

    lo_api_component = wd_comp_controller->wd_get_api( ).

    lo_portal_manager = lo_api_component->get_portal_manager( ).

    DATA lo_api_controller type ref to if_wd_view_controller.

    lo_api_controller ?= wd_this->wd_get_api( ).

    CALL method lo_portal_manager->subscribe_event

    exporting

    portal_event_namespace = 'urn:com.sap.mss.employeesearch'

    portal_event_name = 'selection_changed'

    view = lo_api_controller

    action = 'SET_MSS_FLAG'

    ***********************************************************************************************************************************************

    as you can see we are subscribing to the event "selection_changed" this is the event get raised once manager click on an employee in team viewer.....make sure you type the "portal_event_namespace" and "portal_event_name" same as shown....with the smaller case.....

    2) my action parameter in the above code...is an action...which i want to get trigger as soon as this event gets raised....I am just setting a flag here that....we are coming from MSS service....you can give any name you want to this action....for example..."GET_PERNR" or something on that line...but it does not matter what you call this action....

    3)now for this action method....put the following code to extract the pernr......in my case what i did is extracted this pernr and store it in my node attribute....to share it with other views in my component....of course you need to create this node at component level so all the views in your wda component can see that....

    **********************************************************************************************************************************************************

    DATA lpernr TYPE string.

    data len type i.

    data local_pernr type pernr_d.

    data l_offset type i.

    wdevent->get_string(

    EXPORTING

    name = 'PORTAL_EVENT_PARAMETER'

    receiving

    value = lpernr ).

    len = strlen( lpernr ).

    l_offset = len - 8.

    local_pernr = lpernr+l_offset(8).

    data lo_nd_importing type ref to if_wd_context_node.

    data lo_el_importing type ref to if_wd_context_element.

    data ls_importing type wd_this->element_importing.

    data lv_p_num like ls_importing-p_num.

    lo_nd_importing = wd_context->get_child_node( name = wd_this->wdctx_importing ).

    lo_el_importing = lo_nd_importing->get_element( ).

    lo_el_importing->set_attribute(

    exporting

    value = local_pernr

    name = `P_NUM`

    ).

    ***********************************************************************************************************************************************

    this is how you extract pernr from teamviewer to your custom wda component....

    Thanks...

    AS....

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      When you de-bug is it pulling anything back?

      The user must be set up in the Org Structure as a manager or they wont pick up any value in 'MSS01'.

      Rob

  • avatar image
    Former Member
    Feb 08, 2010 at 04:41 PM

    Hi,

    you can make use of the parameters tab of the web dynpro application to pass parameters to a WD application when it is called from portal.

    Thanks,

    Abhishek

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      when you embed your wd application in portal you can set it up to receive parameters. define a parameter in the parametes tab in wd appliction and use the same name in the portal to pass value to ur application.

      to test: double click on the wd application in se80. on the right hand side you will see two tab. one of these are parameters. click on it and define a parameter pernr provide it a default value.

      now go to the default inbound plug of your window and again define pernr as the importing parameter. put a break point here and excute ur application.

      in debug check the value of pernr. it should be the default value defined by you.

      now when this application will be embeded in portal the parameter passed from portal will override the default value.

      please talk to the portal guy to get more idea on how the wd apps are embeded and how we define exporting parameter for any application.

      Thanks,

      Abhishek