Home Tips and Tricks ABAP Dictionary Performance considerations for DB updates
|
|
|
|
Performance considerations for DB updates |
|
|
|
|
Written by Anon.
|
|
Thursday, 15 March 2007 |
|
Array updates All Database manipulations in SAP (UPDATE, INSERT, DELETE) can be executed one record at a time or through an 'Array' operation. Example: No good LOOP AT T_MAT. * Assign value to material group MARA-MATKL …… UPDATE MARA SET MATKL = T_MAT-MATKL. WHERE MATNR = T_MAT-MATNR. ENDLOOP. GOOD LOOP AT T_MAT. * Assign value to material group MARA-MATKL …… ENDLOOP UPDATE MARA FROM TABLE T_MAT. After the execution of the array update, the following system fields are populated: - SY-SUBRC - Contains 0 if all updates were successfully executed
- SY-DBCNT -Contains the number of successfully updated records
Restrictions: - The Array update function can't be combined with UPDATE SET
Recommendation: - If a large number of fields are changed in multiple records Array update
- If a small number of fields are changed in one record Update set
- If a small number of fields are changed in multiple records
-> Define a modifiable view using the key fields and the fields which are to be changed Updating Key fields
Key fields can be updated for transparent tables just like any other table.
Exception: If synchronous match codes exist for the table, the key field update will be unsuccessful.
|
|
|
|