cancel
Showing results for 
Search instead for 
Did you mean: 

How to get PERNR from employee search(teamviewer) iView in to a WD-4-ABAP.

Former Member
0 Kudos

Hello All,

I had developed a new Web Dynpro for ABAP (WD4A) component for updating a custom Infotype. This application is meant for the manager to maintain some specific data through portal for his employees in the team.

WD4A application is built based on the employee number it receives from the portal.

 How could I get PERNR from employee search(teamviewer) iView in to my WD4A component?

In portal I had developed a test page by copying the standard page from MSS com.sap.pct.erp.mss.general_information, and added my WD4A application through an iView into this page.

Then I hided all the other iVews in the page except (1) employee search and (2)my WD4A iVew. On the preview everything appears fine.

During the preview of this page it triggers the WDDOINIT of WD4A component main view and then the WDDOMODIFYVIEW. When I select an employee from the employee search, then it triggers only WDDOMODIFYVIEW in the WD4A application and not the WDDOINIT anymore.

In my WDDOMODIFYVIEW I had inserted the 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 = 'GET_SELECTED_PERNR'.

And in the action: 'GET_SELECTED_PERNR'

METHOD onactionget_selected_pernr .

DATA lv_str_pernr TYPE string.

DATA lv_strlen TYPE i.

DATA lv_pernr TYPE pernr_d.

DATA lv_offset TYPE i.

wdevent->get_string(

EXPORTING

name = 'PORTAL_EVENT_PARAMETER'

RECEIVING

value = lv_str_pernr ).

lv_strlen = STRLEN( lv_str_pernr ).

lv_offset = lv_strlen - 8.

lv_pernr = lv_str_pernr+lv_offset(8).

ENDMETHOD.

This is not functioning form me. The action is not getting trigged with the code in WDDOMODIFYVIEW.

I had gone through several threads in u2018SDN say:

 SAP Note: 1112733.

Most of the threads are answered but incomplete. In some threads people shared document personally which had been helpful.

I am stuck with this scenario of handling the employee number from employee search iView. Helpful suggestions will be rewarded for sure.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Do i understand you correctly that you are not getting the portal event ?

This can be several reasons ?

Both portal system and WDA server has to be in same domain and same proptocol to communicate with Portal event.

Please check in that direction and search posts on this topic.