SAP INDX TYPE TABLE AND SQL



Get Example source ABAP code based on a different SAP table
  



SQL Access to Export/Import Tables
Export/import tables are relational databases defined in the ABAP Dictionary. This means that, in principle, SQL statements can also be used to access export/import tables.
To be able to use SQL statements on export/import tables effectively, the special structure of these tables must be respected.
It is not a good idea to perform reads or writes on the fields that manage the data cluster, such as CLUStandard SAP Help for or SRTF2 and CLUSTR. These fields contain the data cluster in an internal format and can only be handled correctly using the EXPORT TO DATABASE and IMPORT FROM DATABASE statements.
SQL statements should only be used if the corresponding combination of special data cluster statements would be too inefficient. The SQL statement INSERT should never be used on export/import tables.
AB_SQL statements can, in certain circumstances, be used for administrative tasks on export/import tables, for which the data cluster specific statements are not suitable.



Example ABAP Coding

An export/import table can be searched systematically for a particular data cluster using SELECT. Here, information in the freely definable columns can be evaluated.
ABAP_EXAMPLE_END



Example ABAP Coding

The following example deletes all data clusters of an area from the export/import tables DEMO_INDX_BLOB and DEMO_INDX_TABLE. Each time, all rows of the data cluster are to be deleted.
ABEXA 01051
ABAP_EXAMPLE_END



Example ABAP Coding

The following example demonstrates how the name and area of a data cluster can be changed in the database tables DEMO_INDX_BLOB and DEMO_INDX_TABLE using UPDATE . Solving this problem using the special cluster statements would be considerably more time-consuming. UPDATE demo_indx_blob
SET relid = @new_relid,
id = @new_id
WHERE relid = @old_relid AND
id = @old_id.

UPDATE demo_indx_table
SET relid = @new_relid,
id = @new_id
WHERE relid = @old_relid AND
id = @old_id.
ABAP_EXAMPLE_END