02-27-2013 9:36 AM
Hi experts,
In BW, i am inserting with an abap code some data to a custom SE11 table (ycnv_report)
I am calculating data with three different internal tables and i regroup all data in one internal table from which i am inserting data into my custom sap table.
REFRESH wt_report_final.
INSERT LINES OF wt_report2 INTO TABLE wt_report_final.
REFRESH wt_report2.
INSERT LINES OF wt_report_x2 INTO TABLE wt_report_final.
REFRESH wt_report_x2 .
INSERT LINES OF wt_report_y2 INTO TABLE wt_report_final.
REFRESH wt_report_y2.
SORT wt_report_final BY comp_code costcenter chrt_accts gl_account costelmnt /bic/y_tprtnr co_area profit_center y_labbu y_labdiv y_program part_prctr y_labprbu y_ptnrdiv doc_currcy loc_currcy fiscper version.
DELETE ADJACENT DUPLICATES FROM wt_report_final COMPARING comp_code costcenter chrt_accts gl_account costelmnt /bic/y_tprtnr co_area profit_center y_labbu y_labdiv y_program part_prctr y_labprbu y_ptnrdiv doc_currcy loc_currcy fiscper version.
* DELETE ADJACENT DUPLICATES FROM wt_report_final COMPARING ALL FIELDS.
IF NOT wt_report_final IS INITIAL.
INSERT ycnv_report FROM TABLE wt_report_final.
ENDIF.
I made tests in DEV, it's working fine.
But before transporting, i would like to know your opinion and any possiblities of enhancements. In Production i have more data to treat and in few years my program will deal with many millions of records.
By the way, is there any settings that you recommand me to my SE11 table in my case?
Thanks for your help.
Amine
02-27-2013 10:59 AM
amine lamkaissi wrote:
... my program will deal with many millions of records.
As in: your program will update/insert millions of records? If that's the case you should consider to update/insert or modify in small packages instead of trying to do that in 1 single insert.
02-27-2013 10:30 AM
Hi Amine,
u can use the above code.
u can change One line of code .
inspite of INSERT u can use MODIFY Statement.
02-27-2013 10:33 AM
Hi Amine,
U can change one more code.
Inspite of INSERT staement u can use APPEND.
APPEND LINES OF wt_report2 INTO wt_report_final.
Thanks
Tarak
02-27-2013 10:59 AM
amine lamkaissi wrote:
... my program will deal with many millions of records.
As in: your program will update/insert millions of records? If that's the case you should consider to update/insert or modify in small packages instead of trying to do that in 1 single insert.
02-27-2013 10:39 PM
Hi Maen,
How can i modify the insertion of data with small packages?
Thanks.
Amine
02-27-2013 11:42 PM
By moving bits of the large table to a small table, doing the modify, refreshing the small table and repeating until everything is processed.
This will process 5000 lines at a time.
WHILE LINES( large_table ) > 0.
LOOP AT large_table INTO wa.
DELETE large_table INDEX 1.
APPEND wa TO small_table.
IF LINES( small_table ) >= 5000 OR LINES( large_table ) = 0.
EXIT.
ENDIF.
ENDLOOP.
"insert small table into database
REFRESH small_table.
ENDWHILE.
02-27-2013 11:02 AM
Hi,
Try to create the secondary index for the fields which u want to access frequently. By doing so your program performance will be increased.
Regards,
Vineesh.
02-28-2013 11:59 AM