cancel
Showing results for 
Search instead for 
Did you mean: 

ALV table is not displaying data of new selection

Former Member
0 Kudos

Hi Experts,

on my WD Component there are two drop downs (one for employees, one for projects) to specify a data selection. The selected data is displayed in an alv table.

So when I'm selecting an employee, all his projects are displayed in the alv table. When I'm additionally selecting some projects by second dropdown the selection is constricted. So after usage of first drop down there are i.e. 10 entries displayed, after usage of second dropdown there are only 5 entries displayed in alv table.

so long everythings fine.

My problem is, that when I have selected an employee and I'm selecting an other employee (to start a new selection) the alv table is not updated/is not loading the new selection/is not displaying the new selection.

But the respective context node, which is mapped with the "data" context node of ALV component is filled with the correct data. So in the background processing the selected data is correct depending on the dropdown selections, only it is not displayed on the alv table.

Does anyone has an idea what's the reason for this behavior?

Thanks in advance,

Tan

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

AS basakaran said , Code is required to get the idea how you are filling the node again.

The filling should happen on the onselect event of the employee dropdown.

try one more thing, just invalidate the node before filling it again.

Data ln_node type ref to  if_wd_context_node.
ln_node = wd_context->get_child_node( '<node name> ' ).
ln_node->INVALIDATE( ).

" then write the code to fill the node with new data

thanks

Sarbjeet Singh

Former Member
0 Kudos

Hi,

the code is like your posted code:

* Invalidate Node with data for ALV
  context_node = wd_context->get_child_node( name = wd_this->wdctx_tab_ma_leist ).
  context_node->invalidate( ).

* Invalidate Node for second Drop Down
  context_node = wd_context->get_child_node( name = wd_this->wdctx_tab_ma_prjwopl ).
  context_node->invalidate( ).

After invalidation of a node his supply function is processing again, isn't it? Because there is no coding in this method that's filling my node...

Former Member
0 Kudos

>

> Hi,

> the code is like your posted code:

>

>

>

* Invalidate Node with data for ALV
>   context_node = wd_context->get_child_node( name = wd_this->wdctx_tab_ma_leist ).
>   context_node->invalidate( ).
> 
> * Invalidate Node for second Drop Down
>   context_node = wd_context->get_child_node( name = wd_this->wdctx_tab_ma_prjwopl ).
>   context_node->invalidate( ).

>

> After invalidation of a node his supply function is processing again, isn't it? Because there is no coding in this method that's filling my node...

Hi,

Is this the only code you have when you select a employee ? from where do you call the Function module ?

You said "supply function", is there a supply function for these nodes then ?.

If you suspect invalidate is causing problemm you can comment that line for a while and replace with a line like

lt_tab_ma_leist type wd-this->elements_tab_ma-leist.

context_node->bind_table( lt_tab_ma_leist )

repeat the same for the other node as well.

Former Member
0 Kudos

This is the complete code:


* Invalidate Node with data for ALV
  context_node = wd_context->get_child_node( name = wd_this->wdctx_tab_ma_leist ).
  context_node->invalidate( ).

* Invalidate Node for second Drop Down
  context_node = wd_context->get_child_node( name = wd_this->wdctx_tab_ma_prjwopl ).
  context_node->invalidate( ).

* Invalidate Node with second node's content depending on selected employee (first dropdown)
  context_node = wd_context->get_child_node( name = wd_this->wdctx_tab_mawopl_filter ).
  context_node->invalidate( ).

* This method is generating content for itab which is filling the context node that is displayed in alv table
  wd_this->set_alv_filter( ).

The supply function is connected with the context node in componentcontroller. It should be executed after invalidate().

In the method "set_alv_filter( ) there is context_node->bind_table( lt_tab_ma_leist ) implemented.

In the processing of the wd component everything is working fine, all itabs are filled with the correct data, and the correct context nodes are filled with this data.

The only thing not correctly working is the alv table.....so I thought the ALV Component and especially the "data" node is not working correct......

gill367
Active Contributor
0 Kudos

HI after invalidating the node get the instance of the interface controller of the ALV comp usage and

call teh method set_data and pass the node once again.

here is the sample code.

context_node->INVALIDATE( ).

DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE . 

lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_alv( ).
 lo_interfacecontroller->set_data( context_node ).

this will solve the issue.

Thanks

sarbjeet singh

Former Member
0 Kudos

I have seen in some thread that this have solved their problem. You can try , otherwise i suggest you search for some SAP notes related to this problem.

You can try using IWCI_SALV_WD_TABLE->refresh( ).

Former Member
0 Kudos

Perfect! Exactly what I needed!

Thank you!

Former Member
0 Kudos

Hi again,

unfortunately this piece of code has some unscheduled consequences for the WD Component:

There are some Buttons / User Functions in my ALV List. Next to the standard ALV Buttons "Export" and "Printversion" there are some extra coded Buttons. This buttons are displayed, but after the first execution of this coding

context_node->INVALIDATE( ).
 
DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE . 
 
lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_alv( ).
lo_interfacecontroller->set_data( context_node ).

the Buttons are not displayed any more.

Does anyone has an idea whats wrong there?

This is the coding for one of the buttons:

lr_user_function = wd_this->lr_alv_model->if_salv_wd_function_settings~create_function( id = 'APPEND_ROW' ).
  CREATE OBJECT lr_user_button.
  lv_text = wd_assist->get_text( key = wd_assist->co_btn_append ).
  lr_user_button->set_text( lv_text ).
  lr_user_function->set_editor( lr_user_button ).

Thanks in advance.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The way you described, i do not see any problem. can you post the code what you do when the employee is selected ?