12-17-2008 6:39 AM
Hi All,
I am not able to insert data in the data base table(YY...) as it is in the internal table.
I do have data in following order in the internal table :
I am simply using statement insert (database table) from (wa) in the loop...endloop.
001 0002 2008 0000494219 001 0000494219 254.02 W4136 Keller & Kalmbach Widex
001 0002 2008 0000198630 001 0000494219 100.10 W4136 Keller & Kalmbach Widex
001 0002 2008 0000198418 001 0000494219 39.57 W4136 Keller & Kalmbach Widex
001 0002 2008 0000198419 001 0000494219 89.93 W4136 Keller & Kalmbach Widex
but when data is inserted in the table it appears as below:
Means system is sorting the data in ascending order based on 4th column which is document number.
001 0002 2008 0000198418 001 0000494219 39.57 W4136 Keller & Kalmbach Widex
001 0002 2008 0000198419 001 0000494219 89.93 W4136 Keller & Kalmbach Widex 001 0002 2008 0000198630 001 0000494219 100.10 W4136 Keller & Kalmbach Widex 001 0002 2008 0000494219 001 0000494219 254.02 W4136 Keller & Kalmbach Widex
How can I keep the sequence of data as it is in the internal table when I insert them into data base table.
Thanks,
Mark
12-17-2008 7:02 AM
Hi,
When you insert the data in DB tables , you can not control the sequence , it depends on the primary keys and table design.
Rgds,
Sandeep
12-17-2008 7:02 AM
Hi,
In Ur Database table which field hav primary Key.
Check if Docnum is primary key .
12-17-2008 7:06 AM
Assign one more field (let's say SEQ_NO). In your loop keep on incrementing this field and insert in database.
You have to add this field as first primary key in your database table also.
Hence you data will look like
1 001 0002 2008 0000494219 001 0000494219 254.02 W4136 Keller & Kalmbach Widex
2 001 0002 2008 0000198630 001 0000494219 100.10 W4136 Keller & Kalmbach Widex
3 001 0002 2008 0000198418 001 0000494219 39.57 W4136 Keller & Kalmbach Widex
4 001 0002 2008 0000198419 001 0000494219 89.93 W4136 Keller & Kalmbach Widex
Regards,
Mohaiyuddin
12-17-2008 7:17 AM
001 0002 2008 0000494219 001 0000494219 254.02 W4136 Keller & Kalmbach Widex
001 0002 2008 0000198630 001 0000494219 100.10 W4136 Keller & Kalmbach Widex
001 0002 2008 0000198418 001 0000494219 39.57 W4136 Keller & Kalmbach Widex
001 0002 2008 0000198419 001 0000494219 89.93 W4136 Keller & Kalmbach Widex
the order of ur internal table is in descending if i take the field 0000494219.
in my opinion the DB stores or displays the table entries in ascending in which the reverse sequence is appearing to you ..
09-11-2009 7:12 AM