Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8419

Problem when get current row selected by double click in control table

$
0
0

Hello guys, I have a problem I can get the curren row select by double click in my Control Table with code below:

WHEN 'DBCLICK'.

         clear: OK_CODE200.

         data: ws_field type string,

               ws_line type string.

       GET CURSOR FIELD ws_field LINE ws_line.

       IF ws_field(7) EQ 'WA_ALV2'.

 

       clear wa_alv2.

READ TABLE IT_ALV2 INTO WA_ALV2 INDEX ws_line

If the user, click on the any row when the control table is showing all  "first rows" is correct, for example in image below, user click on the first line:

primera linea.PNG

I get the correct current line selected

linea.PNG

But, when I move the scroll to down, the numerical order is modified, for example, in the image below you can see  only 3 rows, this is because I moved the scroll to down, and now I only can see 3 records, but the others records are above:

rows.PNG

If I click on the first record displayed, my ws_line variable will have the value "1"

 

Captura.PNG

this is not correct, is correct only because the control table its showing only 3 records, but the other records are above, this is my problem, because when the user click on this row, my variable ws_line get the number row select, for example "1" with this number I go to my internal table for example:

READ TABLE IT_ALV2 INTO WA_ALV2 INDEX ws_line


But with this, I will get the first row of the internal table, but in my internal table I have all record not only 3 like image above:

Captura.PNG

 

Any one can help me?


Viewing all articles
Browse latest Browse all 8419

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>