cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh memory of a help component.

Former Member
0 Kudos

I have a component implementing interface IWD_VALUE_HELP, which is meant to provide an ALV showing materials and material descriptions.

I take the value in the input field when F4 is pushed, and I search the database for matching materials (I mean, if the user has written 0* before pushing F4 only materials beginning with a 0 will be shown).

So far so good.

The problem is that, if I close the help window, no matter what I provide in the input field. The data the help component shows is always exactly the same as the first time.

I've been putting breakpoints all around, and, that I see, no method is executed before the window is shown again.

Is there some way of cleaning the component's memory, so that it doesn't remember it's been called before?

Thank you in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Yashpal
Active Contributor
0 Kudos

Hi ,

as for the first time the component of f4 is not instatinated there is no problem but for other time its state is active bcoz its is handled by the framework and i think u have written the code in init method of the view so its only getting executed first time only .

so the problem to this solution is first u should embed the empty view as a default view then create a outbound plug in the window and a inbound plug in view and create a navigation link in between them .

fire the outbound plug to the view in the default plug of the window and write the code for the data selection in the inbound plug handler of view .

this should solve ur problem

Regards

Yash

Former Member
0 Kudos

I have provided a function for the node to be filled, not used the view init method.

(I've tried that as well, but you're right, it didn't work).

I'm trying to implement your solution:

- I've created a new, empty, view, and set it as the default for the window.

- I've created an outbound plug for the window.

- I've created an inbound plug for the non-empty view.

- I've created a navigation link between these two plugs.

- I've fired the outbound plug from the handledefault method in the window.

The result is an empty window.

What have I misunderstood?

Thank you,

Soledad

Yashpal
Active Contributor
0 Kudos

have u provided the supply function for the node..??

if so then in the handle of the view u have to invalidate the node.. then only it will be executed again...otherwise it wiill have the old data....

and regarding the navigation it looks fine... debug it from the handledefault method of the window whether its firing the plug or not...

regards

Yash

Former Member
0 Kudos

Where should I invalidate the node?

I've tried to do it in the window exit method, in the component controller window exit method and in the view exit method. It doesn't work. My code is:

DATA lo_nd_lista_matnr TYPE REF TO if_wd_context_node.

DATA lo_el_lista_matnr TYPE REF TO if_wd_context_element.

DATA ls_lista_matnr TYPE wd_this->element_lista_matnr.

lo_nd_lista_matnr = wd_context->get_child_node( name = wd_this->wdctx_lista_matnr ).

check lo_nd_lista_matnr IS not INITIAL.

lo_nd_lista_matnr->bind_element(

exporting

SET_INITIAL_ELEMENTS = ABAP_TRUE ).

As for the outbound plug, it doesn't seem it's being fired at all.

Any suggestion?

Thanks a lot,

Soledad

Yashpal
Active Contributor
0 Kudos

to invalidate the node u have to call the invalidate method of the node element .like this

data : lr_node type ref to if_wd_context_node .

lr_node = wd_context->get_child_node( 'node_name' ).

lr_node->invalidate( ).

In general, the supply function is called when one or more elements of a context node are

accessed and when

● the context node is not filled yet or is initial, or

● the context node has been invalidated in a previous step.

if ur node does not contain any child node than u should not write the supply function as u dont know at what time the supply function will get called .. so write the code in a method and call in the handle of the view...

put a debug point in the window defaultplug handler....and then check it...

Regards

Yash

Answers (0)