cancel
Showing results for 
Search instead for 
Did you mean: 

CV_FIRST_VISIBLE_ROW not working

0 Kudos

Hey,

CV_FIRST_VISIBLE_ROW is set in my GET_DATA method correct. When I indicate that there were some data changes via EV_DATA_CHANGED, the list automatically scrolls to the top after processing the method. I have no clue where this behavior come from. I want the list to keep the scrollbar where it was!

Any suggestions?

Kind Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Josua:

Have you fixxed this problem?  I just met the same problem, no matter what I do, the  scrollbar will go back the top of the table. If you find the solution, could you sent it to me via Email 250765745@qq.com, thanks a lot.

Best regards

John

Former Member
0 Kudos

Hi Josua,

You have to set CV_LEAD_INDEX also along with the CV_FIRST_VISIBLE_ROW .

Because by default CV_LEAD_INDEX is 1 , so if you are changing CV_FIRST_VISIBLE_ROW equal to your required row , then same lead selection you have to assign into your CV_LEAD_INDEX .

Surely it will work..

Thanks & Regards

Praveen Gupta

0 Kudos

that completely changes the behaviour of my application. I want to keep the selected row selected - not changing the lead index to first visible row. 

Lets assume I

  1. scroll to the bottom of the list
  2. select the last line
  3. change the data of the last line
  4. this is the point where i check cv_first_visible_row and cv_lead_index in GET_DATA with the debugger. the values are set totally fine!
  5. now I change the value of EV_DATA_CHANGED to true - because there were data changes
  6. the scroll bar scrolls automatically to the top but the last line is still selected.

Any ideas?

EDIT:

I found out, that this behaviour disappears when I deactivate the sorting and the filtering in GET_DEFINITION. But I need the functionality to filter/sort!

Former Member
0 Kudos

Hi Josua,

After setting ev_data_changed to abap_true ,CV_LEAD_INDEX automatically set to 1. That's why i am trying to tell you each and after change you have to set CV_LEAD_INDEX and CV_FIRST_VISIBLE_ROW as you want in your application...

Thanks & Regards

Praveen Gupta

0 Kudos

Here is a screenshot after ev_data_changed = abap_true. Somehow nothing is resetted and still scrolling to the top.

When I comment out this line in GET_DEFINITION, the scroll bar is not scrolling to the top automatically when changing the last row.

Former Member
0 Kudos

Hi,

Yaa you should not alllow sorting when you are doing changes and want specific row to be selected.

See there is one entry in CT_SELECTED_LINES what index is setted there and you are setting CV_FIRSTVISIBLE_ROW = 3 then CV_LEAD_INDEX also should be set 3 then only after change your selected line focus and first visible row 3 will appear into your application screen.

Check if there is any problem due to the EV_SELECTED_LINE_CHANGED means it't doesn't have any value.

Thanks & Regards

Praveen Gupta

0 Kudos

Im sorry but I don't understand this sentence.

Praveen Gupta wrote:

See there is one entry in CT_SELECTED_LINES what index is setted there and you are setting CV_FIRSTVISIBLE_ROW = 3 then CV_LEAD_INDEX also should be set 3 then only after change your selected line focus and first visible row 3 will appear into your application screen.

So either I allow sorting and have a wrong behaviour or I don't allow sorting and have a right behaviour?

Former Member
0 Kudos

Hi Josua,

In your snap shot CT_SELECTED_LINES is having 1 entry. First check in the selected line table what is the index number. if it is not equal to what you have set in CV_FIRST_VISIBLE_ROW.

Might be in your ct_selected_lines will be having 1, that's why cursor is going up.

I think sorting should not be the problem whenever you are changing the table record.

Set your CV_FIRST_VISIBLE_ROW and CV_LEAD_INDEX.

It will work surely..

Thanks

Praveen Gupta

0 Kudos

Sorry, Praveen but all the values are fine in the debugger =/ Have a look at the screens below:

This is how my table looks like after I've selected a row in the middle - now I'm triggering a change in a GUIBB Form

Setting ct_data and ev_data_changed

The correct row is selected in CT_SELECTED_LINES

First visible row is also fine


Lead index is perfect - exactly what I have selected

This is how my table looks like after the change

The scroll bar is at the top and so the selected line is no longer visible as long as the user doesn't scroll down.

Everything is fine and works as expected - except the scroll bar - the scroll bar is going to the top somehow.

Maybe we should keep in mind that in this scenario, sorting is allowed on columns. If i disable the sorting, the scroll bar doesnt

scroll to the top.

Former Member
0 Kudos

Hi Josua,

There is conflict in the value of CV_FIRST_VISIBLE_ROW.

As per your code assign CV_FIRST_VISIBLE_ROW = 9.

That's what i am telling , you have to assign same value to the CV_FIRST_VISIBLE_ROW and CV_LEAD_INDEX.

Try with assigning the same value it will work...Your scroll will not go up..

Thanks & Regards

Praveen Gupta

0 Kudos

I really appreciate your help, but if I would do so, then my first visible row would be 9 and not 6. That's not what I want.

Former Member
0 Kudos

Hi,

if you are setting first visible row is 6 it doesn't mean that your 6th row will be the first row which will be selected and rest of the record will come.

It will come at 3-4th position when render.

Suppose if you have set your minimum row display variable as a 5.

Then you are making up first visible row as 6th ..Then it will appear at 3or 4th position in your table it will not appear as a 1st row which you have set visible.

Thanks & Regards

Praveen Gupta

0 Kudos

I know that first visible row != lead index. But the value of first visible row - which comes from the framework - is not working as it is expected.

You are describing the correct behavior, how it should work but unfortunately it doesn't do so.

May I show you what I mean in a live debugging session?  5-10 minutes?