cancel
Showing results for 
Search instead for 
Did you mean: 

How to refresh View1 after View2 action

LN1
Participant
0 Kudos

Hi, experts.

Currently, I have 1 Component with 2 Views and 2 Windows. V1 is embedded in W1 and V2 is embedded in W2.

V1 has a table element that lists db table entries. V2 also has a table element that lists what entries may be added to the db table.

On V1 button action, W2 is called via:

IF wd_this->m_popup_W2 IS INITIAL.
    wd_this->m_popup_W2 = lo_window_manager->create_window(
      window_name  = 'W2'
      button_kind  = if_wd_window=>co_buttons_okcancel
      message_type = if_wd_window=>co_msg_type_none ).
ENDIF.
wd_this->m_popup_W2->open( ).

where:

M_POPUP_ADD_RCP type ref to IF_WD_WINDOW

lo_window_manager TYPE REF TO if_wd_window_manager

On V2 button action, db table entries are updated and then W2/V2 is closed, which returns back to W1/V1.

My requirement/objective is to refresh V1 table contents after V2 has updated the db table. But it's not happening so I must be missing something or doing it wrong. Pls advise on what I must check and do. Do I need to have 2 Windows? I also don't think I set the Navigation links right.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Luisa,

Your requirement can be achieved as below

  • Let us say you have a method GET_DATA_FOR_V1 in component controller, which gets data from DB and binds to context node of the table in V1
  • On click of SAVE/SUBMIT button in V2, you call the method wd_comp_controller->get_data_for_v1( ) and then close the popup
  • So, that V1 table entries gets the latest records from DB

Here in your case, no need of navigation between windows/views.

Hope this helps you.

Regards,

Rama

Answers (3)

Answers (3)

rajeshkothamasu
Active Participant
0 Kudos

Hi,

Once after doing action in W2.

In button action after closing the window

refesh the data of W1(V1) or clear the data or invalidate data of present table and get the new data, bind it to table.

Hope this will help you

former_member197475
Active Contributor
0 Kudos

Hi Luisa,

If you want to refresh or clear your node contents, you can better invalidate the node of V1.

ln_v1->invalidate().

IF_WD_CONTEXT_NODE (SAP Library - Web Dynpro for ABAP)

BR,

RAM.

Former Member
0 Kudos

Hi Luisa,

This can be achieved based on your context binding to the V1 table element.

 

If you bind the view context node to the V1 table element, you can achieve this by declaring a global component attribute and update this attribute with the  added entries in V2. Add the contents of this attribute to V1 context node.

If you bind the component controller context node to the V1 table element, you can achieve this by updating this node with the added entries in V2.

Thanks,

Vamshi