Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Home arrow Tips and Tricks arrow ABAP Dictionary arrow Performance considerations for DB updates
Performance considerations for DB updates PDF Print E-mail
User Rating: / 1
PoorBest 
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.


 
< Prev   Next >

Google Search

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor