2013 Apr 21 2:41 PM
Hi Experts,
I have made a Z Table Control where i have given vertical and horizontal scrolling . Now when I scroll and try to select a row, then ZTABLE_CONTROL-CURRENT_LINE fetches line number not from the top, it fetches from the current top of ztablecontrol.
It is onlyy changing the value on scrolling, if i do not scroll table control then value is coming correct.
My requirement is whenever i select any row of ZTABLE CONTROL i need to get the curent line number from top. Please guide me what should i do.
Early reply will be rewarded.
Thanks.
2013 Apr 22 7:13 AM
Hi Prachi
You can get the current line index by the simple calculation
ZTABLE_CONTROL-TOP_LINE + ZTABLE_CONTROL-CURRENT_LINE - 1
IF ZTABLE_CONTROL-TOP_LINE > 0.
lw_index = ZTABLE_CONTROL-TOP_LINE + ZTABLE_CONTROL-CURRENT_LINE - 1.
ENDIF.
Regards
Swati
2013 Apr 22 4:29 AM
2013 Apr 22 10:55 AM
Hi Athreya,
Thanks for the reply. But the above thread did not solve my problem . Could you pls suggest something else.
2013 Apr 22 7:13 AM
Hi Prachi
You can get the current line index by the simple calculation
ZTABLE_CONTROL-TOP_LINE + ZTABLE_CONTROL-CURRENT_LINE - 1
IF ZTABLE_CONTROL-TOP_LINE > 0.
lw_index = ZTABLE_CONTROL-TOP_LINE + ZTABLE_CONTROL-CURRENT_LINE - 1.
ENDIF.
Regards
Swati
2013 Apr 22 10:56 AM
2013 Apr 22 8:13 AM
Hi prachi,
first of all you need to name (like zmark) the option named mark in table control just tick it.
also include it in your final table then you need to update zmark = 'x'.
at user command so that it pick the current line and code accordingly.