‎2012 Jun 14 4:51 AM
I am new to ABAP OOP, especially the 'Persistent Class'.
Hope SAP technical gurus could give me your advices, thanks very much!
I have an internal table with 50K records, for each record, I need to access the
loop at itab assigning <ls_tab>. "50k records
zca_**_pers=>agent->get_persistent_by_query(
i_par1 = <ls_tab>-field1
i_query = cl_os_system=>get_query_maanger( ) -> create_query(
i+filter = 'field1 = par1' ) ).
endloop
Will the get statement inside a loop impact performance? Thanks.
‎2012 Jun 14 6:34 AM
Hello,
If you check the system generated Agent(ZCA*) & Base(ZCB*) classes, the method GET_PERSISTENT_BY_QUERY( ) does a SELECT * on the table for which the Persistent mapping has been defined.
So i don't think it'll be a good idea to perform this operation inside a LOOP. 50k iternations is definitely a big NO!
Is there are specific reason you're persistent classes to access the DB? If not, i'll suggest revert back to Open SQL.
BR,
Suhas
Message was edited by: Suhas Saha
‎2012 Jun 14 6:34 AM
Hello,
If you check the system generated Agent(ZCA*) & Base(ZCB*) classes, the method GET_PERSISTENT_BY_QUERY( ) does a SELECT * on the table for which the Persistent mapping has been defined.
So i don't think it'll be a good idea to perform this operation inside a LOOP. 50k iternations is definitely a big NO!
Is there are specific reason you're persistent classes to access the DB? If not, i'll suggest revert back to Open SQL.
BR,
Suhas
Message was edited by: Suhas Saha
‎2012 Jun 14 7:57 AM
Thanks Suhas,
Therefore I will do a multiple selection with GET_PERSISTENT_BY_QUERY, with sorted key, and inside the loop i will read table with sorted key. Thanks.
‎2012 Jun 20 12:03 PM
The persistence framework is not really appropriate when processing large volumes of data. Use OpenSQL instead.
‎2012 Jul 17 1:28 AM