Skip to Content
Former Member
Aug 25, 2010 at 02:02 PM

Best way to update custom table


Hello experts,

Iu2019m writing a report program and after pulling data from a custom table Iu2019m modifying certain fields within internal table and then eventually update custom table. The way Iu2019m updating custom table is working fine. However Iu2019m concern about performance issues because Iu2019m doing update on custom table within loop.

Here is my code for reference.



*& Form update_contracts


  • text


  • --> p1 text

  • <-- p2 text


FORM update_contracts .

  • Update record in an internal table first

loop at izsc_compliance into wa_zsc_compliance..

wa_zsc_compliance-zapproval = c_accepted.

wa_zsc_compliance-CHANGED_DT = sy-datum.

wa_zsc_compliance-CHANGED_TM = sy-uzeit.

wa_zsc_compliance-CHANGED_BY = sy-uname.

modify izsc_compliance from wa_zsc_compliance index sy-tabix.

write:/ sy-tabix, wa_zsc_compliance-vbeln_new, wa_zsc_compliance-zapproval.

if p_test is initial.

move wa_zsc_compliance to zsc_compliance.

update zsc_compliance.



  • Write records to database

if p_test = 'X'.


write:/ 'Test mode'.


ENDFORM. " update_contracts


Iu2019m not certain if there is any better way by not doing update within loop and update custom table outside this loop.

Many thanks in advance.