Application Development 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: 

Table Control : get cursor to last entry pasted

Former Member
0 Kudos

Hi All,

I had to design a table control on which I could paste upto 100 entries from excel.

In the current scenario, my table control shows only the first 7 8 entries on the screen after getting pasted.

The rest of the entries are filled when we scroll the cursor downwards.

But now the requirement is that when the values are pasted , they all appear on the screen and the cursor is set to the last entry without having to scroll.

Please tell me how to set the cursor to the last entry.

thanks in advance

Inesha

1 ACCEPTED SOLUTION

former_member1245113
Active Contributor
0 Kudos

HI

In PBO

module STATUS_0100  "Output

in Program

module status_0100.
describe table itab lines tc-lines. " Itab is the Internal Table into which 100 lines copied from Excel been pasted
set cursor field itab-field1 line tc-lines.  " Itab-field1 is the field on which the cursor is set
endmodule.

For more info Take F1 help on SET CURSOR key word

Cheerz

Ramchander Rao.K

5 REPLIES 5

former_member1245113
Active Contributor
0 Kudos

HI

In PBO

module STATUS_0100  "Output

in Program

module status_0100.
describe table itab lines tc-lines. " Itab is the Internal Table into which 100 lines copied from Excel been pasted
set cursor field itab-field1 line tc-lines.  " Itab-field1 is the field on which the cursor is set
endmodule.

For more info Take F1 help on SET CURSOR key word

Cheerz

Ramchander Rao.K

0 Kudos

Hi Ramchandra,

THanks you for your reply.

I have laready coded these lines. But the cursor does not go to the last line. Infact it stays with the top lines.

Is there a reason this could not be working ?

thanks and regards,

Inesha

0 Kudos

Hi Ram,

One more thing. This solution only works when the number of lines i am pasting is less than those visible on the screen.

Once it exceeds 8 lines , it settles on the first line. I need to manually scroll it down to the line which is not visible on the screen.

Hope there is something that can be done.

Thanks so much

Inesha

kesavadas_thekkillath
Active Contributor
0 Kudos

You have to code it. Standard paste functionality only pastes in visible area os table control.

Use method clipboard_import of class cl_gui_frontend_services and get the copied content from buffer to an internal table and then use the data and modify the internal table linked to the table control. Later set the cursor to the last record programatically.

0 Kudos

Hi Keshav,

I have already pastd these lines. But I have not been able to make sure that after pasting , the cursor goes to the last line on which the pasting was done.

thanks and regards,

Inesha