Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table Control

Former Member
0 Likes
450

I have a field with a match-code in a table control. Is there any way to know the current row number when i press the match-code of that field?

Thanks

1 ACCEPTED SOLUTION
Read only

former_member491305
Active Contributor
0 Likes
395

Hi,

Use "<b>Get Cursor field fname line n</b>".

n-line number of TC.

3 REPLIES 3
Read only

former_member491305
Active Contributor
0 Likes
396

Hi,

Use "<b>Get Cursor field fname line n</b>".

n-line number of TC.

Read only

Former Member
0 Likes
395

Hi Jose ,

READ TABLE i_tab1 INDEX tab_cntrl-current_line.

This statement reads the table control current row .

Reward points if helpful.

Regards,

Hemant

Read only

Former Member
0 Likes
395

Hi,

After user interaction with the screen, you may need to know the position of the cursor when the action occurred. This is particularly important if the user chooses the Choose function (F2 or mouse double-click).

To find out the cursor position, use the following statement:

GET CURSOR FIELD <f> [OFFSET <off>]

[LINE <lin>]

[VALUE <val>]

[LENGTH <len>].

This statement transfers the name of the screen element on which the cursor is positioned during a user action into the variable <f>. If the cursor is on a field, the system sets SY-SUBRC to 0, otherwise to 4.

The additions to the GET CURSOR statement have the following functions:

OFFSET writes the cursor position within the screen element to the variable <off>.

LINE writes the line number of the table to the variable <lin> if the cursor is positioned in

a table control. If the cursor is not in a table control, <lin> is set to zero.

VALUE writes the contents of the screen field in display format, that is, with all of its

formatting characters, as a string to the variable <val>.

LENGTH writes the display length of the screen field to the variable <len>

Regards,

Bhaskar