05-23-2011 1:21 PM
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
05-23-2011 1:34 PM
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
05-23-2011 1:34 PM
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
05-24-2011 6:12 AM
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
05-24-2011 6:26 AM
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
05-23-2011 2:12 PM
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.
05-24-2011 6:18 AM
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