‎2009 Dec 17 5:43 AM
Hi All,
I have recently started working on persistent classes and need some quick inputs on the scope of persistent classes.
1. I have tried updating a custom table using create_persistent but this method creates one record at atime.......
Is it possible to do mass upload using persistent class. Assume if i have 10000 records in an internal table and i want to insert them in a custom table at one go.
In preocedural i can use insert and can update the table at one go insetad of inserting one by one .
Regards/Ajay Dhyani
‎2009 Dec 17 10:05 AM
If you're dealing with many records, then the persistence framework is not appropriate. You should still encapsulate all your db operations away from the business logic, but use Open SQL rather than persistence.
matt
‎2010 Mar 06 4:35 PM
Hey Ajay,
For mass uploads as you have said like 10000 records using persistence classes is not good,but if you want to upload these records in slots of couple of thousands i think using the methods of the persistence classes work fine. You have to loop the internal table and then call the persistence methods. Anyhow internally these methods also use Sql statements to upload the data into the database tables.
Regards,
Rahul Tripathi
‎2010 Mar 07 6:35 AM
It is far more efficient to upload all the records using openSQL statements, via internal tables. Then the records are inserted into the table all in on go. Using persistence framework is like adding one record at a time. Most inefficient.
‎2010 Mar 07 8:15 AM
Matt & Rahul,
i do agree with you......because of this limitation we in our scenario developed a normal Class in ABAP with sql statements wrapped ....just wondering if you can give a small real time scenario where these persistent classes can be utilized.
Regards/Ajay Dhyani
‎2010 Mar 09 11:44 AM
‎2010 Mar 10 4:46 AM
Persistence classes can be used to replace select statements,from your application logic. This can be the most important part of persistent classes and methods. You can use GET and SET methods to do so.
Regards,
Rahul.