cancel
Showing results for 
Search instead for 
Did you mean: 

get data from one view to another

Former Member
0 Kudos

i got value assigned data(initialized) in table of 2nd  view wddoinit this is popup view and on lead selection of the values of table the same value should fetch in input field of first view(main),how to get the initialized data into the input field on lead selection 

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

The most effective way to handle data in different views is by centralization of the same.

I would suggest this:

1. Create the context nodes in component controller

2. Map them to both the views

Now on lead select,

DATA : lrcl_node TYPE REF TO if_wd_context_node, 

           ls_table TYPE ig_componentcontroller=>element_table,

           lrcl_element TYPE REF TO if_wd_context_element.


* Get the lead selection form the table

   lrcl_node = wd_context->get_child_node('TABLE').

   lrcl_element = lrcl_node->get_element( ).

   lrcl_element->get_static_attributes( IMPORTING static_attributes = ls_table ).

* Set the data back to the context

   lrcl_node = wd_context->get_child_node('DATA').

   lrcl_node->set_static_attributes(

*      index             = USE_LEAD_SELECTION

       static_attributes = ls_table

          ).

good luck,

Kiron

Former Member
0 Kudos

This is fine in case i am getting the values directly from the elements declared in component controller but i did the initialization in 2 nd view i am getting the values from 2nd view not from component controller so as per my understanding the above code might not work

please suggest

Former Member
0 Kudos

You can have the context node in the component controller and bind the table in 2nd view to this node. Then it will be just similar to your current initialization. This will definitely work. The framework will be much simpler this way. Component controller context is designed for this purpose (Centralization of context).

Well If you are particular about using the node in individual views, then you may also do :

Create a global object of type if_wd_view_controller.

And in the 2nd view initialise it. eg : GO_WD_VIEW_CONTROLLER =  wd_this->wd_get_api( ).

Then you can use this object in view 1 to access the context node in view 2.

Good luck

Former Member
0 Kudos

its done anyways thanx for ur valuable inputs

Former Member
0 Kudos

i have opened in window in view1 and on lead selection it has to close automatically with fetching data into the input field of first view i have done it another way could u  please give sample code using api methods.

former_member222068
Active Participant
0 Kudos

Hi,

  Here is the logic for closing the pop up window.

DATA: lo_api          TYPE REF TO if_wd_view_controller,

  lo_window_ctlr  TYPE REF TO if_wd_window_controller,

  lo_popup        TYPE REF TO if_wd_window.

*GET embedding WINDOW

lo_api = wd_this->wd_get_api( ).

lo_window_ctlr = lo_api->get_embedding_window_ctlr( ).

*  CLOSE the popup

IF lo_window_ctlr IS BOUND.

  lo_popup = lo_window_ctlr->get_window( ).

  lo_popup->close( ).

  ENDIF.

Regards,

Sankar Gelivi

Answers (1)

Answers (1)

Former Member
0 Kudos

The scenario you explained here is like using Search help like OVS help.

To pass values from one view to other we use Outbound plug parameters.

In second view you pass the value and in first view you read in inbound handler.

Make sure you name the parameter like EV* .

Hope it helps.

Former Member
0 Kudos

thanx for the reply but its not ovs as u assumed as the data is intialized in 2 nd  view which could be huge(not getting from data base table) so above process might not work