SAP ABAP Syntax for EXPORT part two
This article is in continuation with SAP ABAP SYNTAX CHECK FOR EXPORT PART ONE.
Variant 2
EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
Additions
1. ... FROM g (for each field to be exported)
2. ... CLIENT h (after dbtab(ar) )
3. ... USING form
Effect
Exports the objects obj1 ... objn (fields, structures or tables) as a data cluster to the database table dbtab . The database table dbtab must have a standardized structure .
The database table dbtab is divided into different logically related areas ( ar , 2-character name).
You can export collections of data objects (known as data clusters ) under a freely definable key (field key ) to an area of this database.
IMPORT allows youto import individual data objects from this cluster.
Notes
The table dbtab specified after DATABASE must be declared under TABLES .
The header lines of internal tables cannot be exported because specifying the name of an internal table with a header line always exports the actual table data.
Example
Export two fields and an internal table to the database table INDX :
TABLES INDX.
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
F1(4), F2 TYPE P, BEGIN OF ITAB3 OCCURS 2, CONT(4), END OF ITAB3.
* Before the export, the data fields in
* front of CLUSTR are filled.
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
* Export der Daten.
EXPORT F1 F2 ITAB3 TO DATABASE INDX(ST) ID INDXKEY.
Addition 1
... FROM g (for each object to be exported)
Effect
Exports the contents of the field g and stores them under the specified name in the database.
Addition 2
... CLIENT h (after dbtab(ar) )
Effect
Stores the data objects in the client h (if the import/export database table dbtab is client-specific).
Addition 3
... USING form
Effect
Does not export the data to the database table. Instead, calls the FORM routine form for every record written to the database without this addition. This routine can take the data from the
database table work area and therefore has no parameters.
Runtime errors
Errors in the structure of the EXPORT / IMPORT database can cause runtime errors .
Variant 3
EXPORT obj1 ... objn TO DATASET dsn(ar) ID key.
Runtime errors
EXPORT_DATASET_CANNOT_OPEN : Unable to describe file.
EXPORT_DATASET_WRITE_ERROR : File write error.
61.53
RELATED POST
SAP ABAP REAL TIME INTERVIEW QUESTIONS PART FOUR
Variant 2
EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
Additions
1. ... FROM g (for each field to be exported)
2. ... CLIENT h (after dbtab(ar) )
3. ... USING form
Effect
Exports the objects obj1 ... objn (fields, structures or tables) as a data cluster to the database table dbtab . The database table dbtab must have a standardized structure .
The database table dbtab is divided into different logically related areas ( ar , 2-character name).
You can export collections of data objects (known as data clusters ) under a freely definable key (field key ) to an area of this database.
IMPORT allows youto import individual data objects from this cluster.
Notes
The table dbtab specified after DATABASE must be declared under TABLES .
The header lines of internal tables cannot be exported because specifying the name of an internal table with a header line always exports the actual table data.
Example
Export two fields and an internal table to the database table INDX :
TABLES INDX.
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
F1(4), F2 TYPE P, BEGIN OF ITAB3 OCCURS 2, CONT(4), END OF ITAB3.
* Before the export, the data fields in
* front of CLUSTR are filled.
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
* Export der Daten.
EXPORT F1 F2 ITAB3 TO DATABASE INDX(ST) ID INDXKEY.
Addition 1
... FROM g (for each object to be exported)
Effect
Exports the contents of the field g and stores them under the specified name in the database.
Addition 2
... CLIENT h (after dbtab(ar) )
Effect
Stores the data objects in the client h (if the import/export database table dbtab is client-specific).
Addition 3
... USING form
Effect
Does not export the data to the database table. Instead, calls the FORM routine form for every record written to the database without this addition. This routine can take the data from the
database table work area and therefore has no parameters.
Runtime errors
Errors in the structure of the EXPORT / IMPORT database can cause runtime errors .
Variant 3
EXPORT obj1 ... objn TO DATASET dsn(ar) ID key.
Runtime errors
EXPORT_DATASET_CANNOT_OPEN : Unable to describe file.
EXPORT_DATASET_WRITE_ERROR : File write error.
61.53
RELATED POST
SAP ABAP REAL TIME INTERVIEW QUESTIONS PART FOUR



July 31, 2008 12:47 PM
Hello,
Thanks for your comment on http://www.madeitsimple.com, yes i do remember it. BTW your articles are indeed superb. Keep up the great work..Lets plan to link our sites if you agree..
Regards,
Ameya