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

Best practice in table fields update (big table)

jepi_flanders
Participant
0 Likes
2,165

Hi everybody,

I'm wondering which best practice shall be adopted in the following scenario:

  • ECC 6.0 (SAP_ABA 700)
  • Oracle 12.1.0.2.0
  • Z table with 53 fields, 3 fields as primary key (plus 1 for MANDT), total fields length 831 Bytes
    the table contains more than 13 mil records;
    out of them, about 350 k shall have two fields that need to be changed (with different values per record)

While looping through the records finding those to change, and calculating the two fields new values to modify, shall I go with UPDATE... SET... WHERE?

Or, shall I collect the records and do an UPDATE... FROM TABLE...? (in such a case, how many records shall I process? one shot?)

When to do a Commit Work?

Any suggestion on this is highly appreciated!

Thank you and Kind regards,

JFlanderds

1 ACCEPTED SOLUTION
Read only

chaitanya285
Participant
0 Likes
1,611

Hi,

go to ABAPDOCU t code and search for INSERT, UPDATE and MODIFY keywords. There you will get the exact use and syntax of these statements while inserting or updating records in database table.

Now, for your question, it is always recommended to perform operations on data, store that data in internal table and then modify database table from that internal table in one go. This is minimize the actual database access.

Please search on SCN for any question before adding new question as some similar questions might be anweserd already 🙂

Hi everybody,

I'm wondering which best practice shall be adopted in the following scenario:

  • ECC 6.0 (SAP_ABA 700)
  • Oracle 12.1.0.2.0
  • Z table with 53 fields, 3 fields as primary key (plus 1 for MANDT), total fields length 831 Bytes
    the table contains more than 13 mil records;
    out of them, about 350 k shall have two fields that need to be changed (with different values per record)

While looping through the records finding those to change, and calculating the two fields new values to modify, shall I go with UPDATE... SET... WHERE?

Or, shall I collect the records and do an UPDATE... FROM TABLE...? (in such a case, how many records shall I process? one shot?)

When to do a Commit Work?

Any suggestion on this is highly appreciated!

Thank you and Kind regards,

JFlanderds

1 REPLY 1
Read only

chaitanya285
Participant
0 Likes
1,612

Hi,

go to ABAPDOCU t code and search for INSERT, UPDATE and MODIFY keywords. There you will get the exact use and syntax of these statements while inserting or updating records in database table.

Now, for your question, it is always recommended to perform operations on data, store that data in internal table and then modify database table from that internal table in one go. This is minimize the actual database access.

Please search on SCN for any question before adding new question as some similar questions might be anweserd already 🙂