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

Cursur position in Table control.

Former Member
0 Likes
557

Dear friends,

I am using the table contol to enter the data,

TC is having 5 Rows and 3 cols, After enter the data in first row I will press Enter key then cursur will come into second row first column, which is working fine.

After compliting the total 5 rows ( displayed 5 rows ) if I press the Enter Key the cursur is going to top row, it should come to next line ( I mean to 6th row we can say page down )

I am using the below logic in my PBO

DATA lv_line11 LIKE sy-tabix.

DESCRIBE TABLE gt_scr200 LINES lv_line11.

SET CURSOR FIELD 'WA_SCR200-ZZID' LINE lv_line11.

gt_scr200 is my Internal Table.

Pls let me know to to make the cursur position.

Thanks,

Sridhar

4 REPLIES 4
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
528

try this:

lv_cursor = lv_line11 + 1.

SET CURSOR FIELD 'WA_SCR200-ZZID' LINE lv_cursor.

.

Read only

siddhesh_pathak4
Contributor
0 Likes
528

THis may help you,

[;

Read only

sarbajitm
Contributor
0 Likes
528

Hi

Please search the CODE GALLERY with Insertion of data from Table Control to Database table You will get a code.........try to utilize it.

Thanks.

Read only

MarcinPciak
Active Contributor
0 Likes
528

Hi Sridhar,

As you said, TC is dispaling only 5 rows, so the top one is the 1st one. Whenever you want to "page down" you have to scroll your tc, setting new top_line field number.


"in screen flow logic
PROCESS AFTER INPUT.
     Loop at gt_scr200.
        MODULE some_module.
     Endloop.

"in ABAP program 
MODULE some_module INPUT.
    if lv_line11 = sy-loopc.   "if last displayed line reached.
      ADD sy-loopc TO tc_structure-top_line.    "scroll down, setting new top line 
      ADD sy-stepl TO lv_line11.    "set current line as the new top line
    endif.

   SET CURSOR FIELD 'WA_SCR200-ZZID' LINE lv_line11. "set cursor at new position (in 6th row )
ENDMODULE.

That should suffice.

Regards

Marcin