cancel
Showing results for 
Search instead for 
Did you mean: 

Values in selection criteria is not getting refreshed and picking the old value only.

anurag_gaurav
Explorer
0 Kudos

Hi Experts,

I have developed a Web Dynpro application. It is a Process Chain dashboard actually which shows the live PCs status. The PCs will be displayed based on Functional Area/Domain/Business Area (OTC, POS, FICO etc.)  and Region (Asia, Europe etc.) given on selection scree/ 1st window/input view.

At the time of execution i am able to enter values from the drop-down in both fields and get the expected result.

Then i go and change region/ both region and functional area then also i am able to get the expected result.

if again i am going to change region field it is not allowing me to change . it retains the old value only. at the same time functional area is allowing the change in value and giving the correct output.

Please give some pointers to resolve this issue.

Also let me know if further clarification is required.

Thanks and Regards,

Anurag Gaurav

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Anurag,

Let us know if this got resolved. If yes, close the thread.

Thanks

Ananda

anurag_gaurav
Explorer
0 Kudos

Hi Ananda,

Sorry for late reply.

The issue is resolved now.

I have created separate node for both fields and used Dropdownbyindex.

Thanks for your valuable inputs.

Thanks and Regards,

Anurag Gaurav

0 Kudos

Hi Anurag,

Could you please share the screen shots.

If it is issue in drop down and you are using Dropdownbyindex, check the property "selectionchangebehaviour". It show be auto.

Thanks

Ananda

anurag_gaurav
Explorer
0 Kudos

Hi Ananda,

Thank you for reply.

The issue is not with drop-down.

Also i am using dropdownbykey.

i am attaching the screenshots.

now i am facing again a weird behavior.

initially it was allowing me to change REGION for at least one time now after initial execution i am not able to change it for a single time.

The initial screen after execution web application is below:

Suppose, I enter Master Data (MD) in Functional Area and LSE in Region ID and press SEARCH.

I get the expected result as below:

Then I go and change Region ID to LSC.

On pressing SEARCH, since there is no record present, output should be blank.

But the system is not taking LSC as region but keeping old value there as LSE only and output is same as previous.

At the same time when I change the functional area system is getting refreshed and keeping new value with it and giving correct result for the same region which is getting retained there.

Please let me know if any further clarification is required.

Thanks and Regards,

Anurag Gaurav

0 Kudos

Hi Anurag,

In the search button action, just invalidate the node at the beggining . It will work.

<node_reference>-invalidate( ).

<node_reference> TYPE REF TO  if_wd_context_node.

Thanks

Ananda

anurag_gaurav
Explorer
0 Kudos

Hi Ananda,

this is working but not as the requirement is.

i am using INVALIDATE method at the last.

because of this when i press SEARCH and the records are getting displayed the content of the selection fields getting cleared but i want them there also.

in below screenshot i have entered Europe as region and Master Data as selection criteria. but when the records getting displayed values in selection criteria is gone due to INVALIDATE.

Thanks and Regards,

Anurag gaurav

0 Kudos

Hi Anurag,

Don't clear the input data. Just write invalidate method for the node in beginning of search method.

Check the input data clearance in Debugging.

Thanks

Ananda

anurag_gaurav
Explorer
0 Kudos

Hi Ananda,

Using INVALIDATE in the beginning is giving error after pressing SEARCH.

PFB the pseudo code

METHOD ONACTIONACTION_FIND .
DATA LO_ND_NODE TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_NODE TYPE WD_THIS->ELEMENT_NODE.
LO_ND_NODE
->INVALIDATE( ).

* navigate from <CONTEXT> to <NODE_DOM_REG> via lead selection
LO_ND_NODE
= WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_NODE ).

* get element via lead selection
LO_EL_NODE
= LO_ND_NODE->GET_ELEMENT( ).


* alternative access  via index
LO_EL_NODE
= LO_ND_NODE->GET_ELEMENT( INDEX = 1 ).


* @TODO handle not set lead selection
IF LO_EL_NODE IS INITIAL.
ENDIF.

* get all declared attributes
LO_EL_NODE
->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES
= LS_NODE ).

please let me know where you want me to write that code.


Thanks and Regards,

Anurag Gaurav

0 Kudos

Hi Anurag,


Verify your code with this.


***************************************************

*  Following section is to Read the Input data

*  I have taken node with attributes Region ID(region_id) and Function area(func_area)   

*************************************************** 

     DATA lo_nd_input TYPE REF TO if_wd_context_node.

     DATA lo_el_input TYPE REF TO if_wd_context_element.

     DATA ls_input TYPE wd_this->element_input.

     lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).

     lo_el_input = lo_nd_input->get_element( ).

     lo_el_input->get_static_attributes(

       IMPORTING

         static_attributes = ls_input ).   "ls_input contains user entered Region ID and Func Area

****************************************************

* To get result and bind the result to Output table*      

****************************************************       

       DATA lo_nd_node TYPE REF TO if_wd_context_node.

       DATA lt_node TYPE wd_this->elements_node.

       lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).

 

* write the select query to fetch the data and bind table as lt_node    

* Below is the sample select query. Replace the <...> with your decared ones.

select <fields> from <table> into table lt_node where <region id> EQ ls_input-<region_id> and <func_area> EQ ls_input-<func_area>.

       lo_nd_node->invalidate( ).

       lo_nd_node->bind_table( new_items = lt_node set_initial_elements = abap_true ).


Invalidate will work before binding the table.


Thanks

Ananda

anurag_gaurav
Explorer
0 Kudos

Hi ananda,

In the above code if i am INVALIDATE 2nd node no change is getting reflected.

but if i am INVALIDATE 1st node then it is working but same as earlier the fields are getting cleared.

Thanks and Regards,

Anurag Gaurav         

0 Kudos

Hi Anurag,

Lets say we are using 2 nodes. One for Input and One for Output.

In the search method, take the input data but don't use validate method for it. So values will  remain.

fetch the necessary data with select query and bind to output node. Before binding use invalidate method for Output node.

Invalidate means clearing the data in general. If you invalidate the output node before binding, Table will be filled with fresh data that we fetched with the input.

Let me know for any clarifications.

Thanks

Ananda

anurag_gaurav
Explorer
0 Kudos

Hi Ananda,

the issue is with the input only.

what it is fetching is correct as per input. there is no discrepancies with the output.

What i said is ...when i am entering another valued in the field REGION it is taking the old value only.

and for that input it is correctly fetching the records .

the fix should be with the first node itself.

i need to refresh the first node so that the new values should be read.

Regards,

Anurag Gaurav

0 Kudos

Let me know where you are getting input data for result.

It should in FIND action.

In the earlier post, I didn't find the input fetching logic (Jul 4, 2016 2.55 PM)

Thanks

Ananda