SAP BULK MODIFY ABEXA



Get Example source ABAP code based on a different SAP table
  



MODIFY, FROM TABLE
This example demonstrates the statement MODIFY ... FROM TABLE.

ABAP_SOURCE_CODE
DEMO CL_DEMO_BULK_MODIFY

ABAP_DESCRIPTION
The DDIC database table DEMO_BULK_MODIFY has two key fields, K1 and K2, and a regular field V1. A unique secondary index IDX comprises the fields K1 and V1. The DDIC database table is filled with a row 1, 1, 1, and then the statement MODIFY ... FROM TABLE is used with an internal table with the rows 1, 2, 1 and 1, 1, 2. The result is platform-dependent:
In database systems with row-by-row MODIFY, like the SAP HANA database, the first row of the internal table cannot be inserted because of the unique secondary index. The second row of the internal table overwrites the existing row and the result is a row with the content 1, 1, 2.
In database systems with row-by-row MODIFY and termination after a failed insert, such as SAP MaxDB, no change is made and the result is a row with the content 1, 1, 1.
In database systems with block-by-block UPDATE and INSERT, such as ORACLE DB, the existing row is overwritten with the second row of the internal table and then the first row of the internal table is inserted. The result is two rows 1, 1, 2 and 1, 2, 1.