cancel
Showing results for 
Search instead for 
Did you mean: 

invalidate method is not working, why ?

Rodrigo-Giner
Active Contributor
0 Kudos

Hi, I have a search view. where I execute 3 RFC, each rfc node is in a different view with a back to search button.

My problem is that in only one of this view if I make a search where that brings no data. It appears the data of the earlier search.

The seatch button action contains this:

wdContext.currentZtableCcElement().setClientid(l_client);

wdContext.currentZtableCcElement().setSociedad(l_combo);

wdThis.wdGetMultiCcCustController().executeZtrae_Cc_Input();

wdContext.nodeOutput_Cc().invalidate();

wdContext.currentZtablePagosElement().setClientid(l_client);

wdContext.currentZtablePagosElement().setSociedad(l_combo);

wdThis.wdGetMultiCcCustController().executeZtrae_Pagos_Input();

wdContext.nodeOutput_Pagos().invalidate();

wdContext.currentZtableHistElement().setClientid(l_client);

wdContext.currentZtableHistElement().setSociedad(l_combo);

wdThis.wdGetMultiCcCustController().executeZtrae_Hist_Input();

wdContext.nodeOutput_Hist().invalidate();

wdThis.wdFirePlugToReportCc();

How can the invalidate() method works in the first and third node, but not in the second one ???

If the new search have some data works fine, but if there is no data, it shows the earlier search.

some ideas ? thx

Accepted Solutions (0)

Answers (3)

Answers (3)

monalisa_biswal
Contributor
0 Kudos

Check whether your function module is working fine or not in R3.Try executing the RFC with giving some parameters for which it returns result and after that execute RFC with giving some parameters for which it does not return any result in R3.

Former Member
0 Kudos

Try:

wdContext.currentZtableCcElement().modelObject().execute();

wdContext.nodeOutput_Cc().invalidate();

Former Member
0 Kudos

Hi Rodrigo,

first of all, empty all output nodes:

while (wdContext.nodeXY().hasNext()){
wdContext.nodeXY().removeElement(0);
}

and after call your RFCs.

Regards,

Gianluca Barile

Rodrigo-Giner
Active Contributor
0 Kudos

Hi Gianluca.

I cant use the hasNext method. It tells me that the hasNext is undefined for my type of node.

I have rechecked my code again and everything is fine. I dont really know why this happens.

Any idea on how can I "fix" this problem with any other way ?

former_member182372
Active Contributor
0 Kudos

Rodrigo, double check your code flow - may be execution of model class (modelClassInstance.execute()) causes some RFC exception and invalidate() is not executed.

Former Member
0 Kudos

Try this method:

public void EmptyNode( com.sap.tc.webdynpro.progmodel.api.IWDNode node )
  {
    //@@begin EmptyNode()
	while (!node.isEmpty())
		node.removeElement(node.getElementAt(0));
    //@@end
  }

Regards,

Gianluca Barile