Application Development and Automation 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: 
Read only

Regarding persistent class

Former Member
0 Likes
829

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

6 REPLIES 6
Read only

matt
Active Contributor
0 Likes
793

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

Read only

Former Member
0 Likes
793

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

Read only

matt
Active Contributor
0 Likes
793

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.

Read only

0 Likes
793

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

Read only

0 Likes
793

This message was moderated.

Read only

0 Likes
793

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.