‎2008 Apr 26 5:55 AM
hai friends,
i want to transfer data from table control t o internal table with three fields....... table control having multiple records.
for example.
first i want to want to transfer 10 records. at time.
next time save three records like that i wnt to save it......
thank u
suresh
‎2008 Apr 26 12:13 PM
Hi Suresh,
Consider the table control as int_tc
and your internal table as int_table
if you need to enter 10 records..from int_tc to int_table.
do the following
append LINES OF int_tc [FROM idx1] [TO idx2] to int_table.
put
append LINES OF int_tc FROM 1 TO 10 to int_table.
Effect
The rows of an internal table jtab are appended according to the same rules that apply for appending a workarea, in the sequence in which they exist in jtab. If jtab is an index table, you can restrict the rows to be appended by specifying FROM idx1 and TO idx2. In this case, only the table rows starting at table index idx1 or ending at table index idx2 from jtab are appended. For idx1 and idx2, data objects of type i are expected. If the value idx1 or idx2 is less than 0, an untreatable exception occurs. If idx1 is greater than idx2 or greater than the number of table rows, no rows are appended. If idx2 is greater than the number of table rows, it is set to the number of table rows.
so next time you want to enter 3 records
put
append LINES OF int_tc FROM 11 TO 13 to int_table.
Please do .....
data : count type i.
describe table int_tc lines count.
count returns number of lines in the table
so make sure that you give index of existing lines otherwise the output may be unpredictable or even a dump
Pls check and revert
Reward if helpful
Regards
Byju
‎2008 Apr 28 12:46 PM
‎2008 Jun 02 6:08 AM