Professional Documents
Culture Documents
Calling An Interface View of Another Abap Web Dynpro Application
Calling An Interface View of Another Abap Web Dynpro Application
Calling An Interface View of Another Abap Web Dynpro Application
Attachments:9
Added by Ravi Aswani, last edited by Craig Cmehil on Dec 28, 2009 (view change)
Senario: get the personnal number in one view of web dynpro application and call the view of another web dynpro application to display
employee details w.r.t the pernr enered intially in first application.
1.) Create a web dynpro application in SE80 say YHPERSON_COMPONENT and create a view FIRST_VIEW *with UI elements to display
the employee details and Window as *MAIN_WINDOW as shown :
2.) Create Global Context in component controller to store employee address, mail and name and map it to the context of First_View. ( drap
& drop to left context)
3.) In the context tab of the MAIN_WINDOW create the same context as shown above..
4.) Create an Inbound Plug (IN) for the MAIN_WINDOW as shown ....
5.) IN the HANDLEIN method of the MAIN_WINDOW create an import parameter PERNR type PERSNO and give the following code :
method HANDLEIN .
data:
ls_pa0006 type pa0006,
ls_pa0105 type pa0105,
ls_pa0002 type pa0002.
DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).
lo_componentcontroller->display(
EXPORTING
persno
= pernr
importing
persaddress = ls_pa0006
persemail
= ls_pa0105
persname
= ls_pa0002
).
DATA lo_nd_persname TYPE REF TO if_wd_context_node.
DATA lo_el_persname TYPE REF TO if_wd_context_element.
DATA ls_persname TYPE wd_this->element_persname.
*
=
=
=
=
ls_pa0006-stras
ls_pa0006-ort01
ls_pa0006-pstlz
ls_pa0006-land1
.
.
.
.
= ls_pa0105-usrid_long.
8.) Create an attribute in Context tab of MAIN view called PERNR type PERSNO .
9.) Create used components in the Properties tab of the Component
Controller
10.) Create an outbound plug (OUTPLUG) and pass the parameter PERNR of type PERSNO as shown
...
11.) For the button on the layout of the view MAIN create an event GETDETAILS with the outbound plug and give the following code in it ...
method ONACTIONONGETDETAILS .
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->Element_context.
DATA lv_pernr TYPE wd_this->Element_context-pernr.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `PERNR`
IMPORTING
value = lv_pernr ).
wd_this->fire_outplug_plg(
pernr = lv_pernr
).
endmethod.
12.) in the window provide embed the MAIN_WINDOW and MAIN view also provide the navigation link for the OUTPLUG to the IN plug of the
MAIN_WINDOW as
shown:
13.) Save and activate your application , make sure that the used component is also active ....and execute the application
YHTEST_COMPONENT.