SAP DB WRITER ABEXA



Get Example source ABAP code based on a different SAP table
  



AB_SQL - Writer Stream, Fill Database Table
The example demonstrates how data can be written to a DDIC database table using a writer stream.

ABAP_SOURCE_CODE
DEMO CL_DEMO_DB_WRITER

ABAP_DESCRIPTION
The method main derives an LOB handle structure from the structure of the DDIC database table DEMO_BLOB_TABLE, where the component PICTURE is declared as an LOB handle component for a binary writer stream.
This writer stream is created in the statement INSERT and then the content of the internal table pict is passed to it sequentially. After the writer stream is closed, the content of the internal table is stored in the DDIC database table as a binary string.
Here, the content of the internal table is a figure in <(>GIF<)> format, which is retrieved from the Mime Repository using an auxiliary method. The address there is also used as a DDIC database table key. Any existing rows are deleted in the static constructor to ensure that the example always works.
The number of changed rows is checked by an object of the class CL_ABAP_SQL_CHANGING_STMNT.
The content can be read again using the executable reader stream example.