Skip to Content
avatar image
Former Member

Jumping back to the first page of the result table after second search

Hi Experts,

i have a search area and a result table, I type a text in inputfield and click on find button. I get the results in a table beneath the search area on the same view. I select some line or lines and turn the page for example to the third page.

By a new search I get the results in the table correctly, but it shows still the third page. If I turn now the page to the first page, I see that the first row is selected automatically which is good but it is not visible automatically.

How can I get back automatically to the first page after a new search.?

Properties of the table context node:

cardinality 0..n

selection 0..n

Initialization Lead Selection -> checked

Initialization Lead Selection: here I tested also the unchecked case. The only difference was the setting of the selection. By unchecked it doesn't set the selection on the first row. You can see no difference by turning the page, it stays also on the last viewed page by the last search.

Layout properties of the table:

I tested "MultiNoLead" and "auto" for the selectionMode and noticed that in both cases, it deletes the last selection (yellow highlighted) from last search process.

The difference here was:

MultiNoLead -> sets no selection on first row and also doesnu2019t jump to the first row

auto -> sets selection on first row but still doesnu2019t jump to the first page

I tried all these Methods below in my search method (find button) before binding the table to the context. I tried each method separately. Still no jumping to the first page automatically.

****************************************************************************
** Show the first row (turn to the first page of table) by new search 
**************************************************************************** 

** deletes the last Lead selection (yellow highligted) 
** selectionMode: MultiNoLead -> sets no selection on first row, doesnu2019t jump to the first row 
** selectionMode: auto -> sets selection on first row but still doesnu2019t jump to the first row 
   
* lo_nd_table_data->SET_LEAD_SELECTION_INDEX( index = 0 ). 
** or 
*  lo_nd_table_data->SET_SELECTED( flag  = '' 
*                           index = 0 ). 
** or 
*  lo_nd_table_data->SET_SELECTED( flag  = 'X' 
*                           index = 0 ). 
** or 
*  lo_nd_table_data->SET_SELECTED( flag  = abap_true 
*                           index = 0 ). 
** or 
*  lo_nd_table_data->move_first( 
*     RECEIVING new_lead_selection = lo_el_table_data ). 
** or 
*  lo_nd_table_data->move_to( 
*     EXPORTING index = 1 
*  RECEIVING  new_lead_selection = lo_el_table_data ). 


****************************************************************** 
* Binding the table to the context 
****************************************************************** 
  lo_nd_table_data->bind_table( 
  new_items = lt_table_data 
  set_initial_elements = abap_true ). 
*  index = 0 ).

As you can see above i tried also to set the index = 0 in the bind_table method but still it doesn't jump to the first page.

Does anyone has an Idea?

Thank you

Regards

Haleh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 27, 2008 at 07:27 AM

    Hi,

    I have smiler problem, and the only solution I found is to reset the view layout

    In method WDDOMODIFYVIEW of the view call view->reset_view( )

    You need to do this ONLY after the search is performed, otherwise your layout will reset all the time. If you have any dynamic layout changes, they will be reset as well.

    Regards

    Kameliya

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Kamelyia,

      this is greate. That was the right answer. I did it and it works properly. 😊))))

      thank you very much for your help.

      Regards

      Haleh

  • avatar image
    Former Member
    Nov 26, 2008 at 06:17 PM

    I Presume, third page is a separate view. There are two options:

    1. Set the life time of the view to "When Visible" instead of framework controlled

    2. Invalidate the node when you navigate back to first page.

    Regards

    Rohit Chowdhary

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rohit,

      thank you for your answer. Due to the options you wrote:

      - all of my UI elements are on a view. I turn the page with the icons on the footer of the table.

      - I validate the table node at the beginning of the search method (find button).

      Did I understand you rught?

      Regards, Haleh