ERP Database - The Unofficial ERP Knowledge Base

Facebook Twitter del.icio.us Digg it
ERP Database contains a huge collection of articles related to ERP System and Software. Many of the articles are specifically related to SAP. All these ERP/SAP articles are freely available to everyone.

If you would like to submit an article or share any document related to ERP or any specific ERP software. Please mail it to support@erpdb.info. Please make sure that the documents are not copyrighted.
Social Bookmarks:

EXPORT : ABAP Keyword a day

Print This Post Email This Post Written by admin on Feb 6th, 2008 | Filed under: ABAP Keywords

EXPORT

1
2
3
4
*Export data
- EXPORT obj1 ... objn TO MEMORY.
- EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
- EXPORT obj1 ... objn TO DATASET dsn(ar) ID key.

Export a screen
- EXPORT DYNPRO h f e m ID id.
Export a structure description
- EXPORT NAMETAB h f ID id.

EXPORT – Export data

Variants

1. EXPORT obj1 … objn TO MEMORY.
2. EXPORT obj1 … objn TO DATABASE dbtab(ar) ID key.
3. EXPORT obj1 … objn TO DATASET dsn(ar) ID key.
Variant 1
EXPORT obj1 … objn TO MEMORY.
Additions
1. … FROM g (for each field to be exported)
2. … ID key
Effect
Exports the objects obj1 … objn (fields, structures or tables) as a data cluster to ABAP/4 memory .
If you call a transaction, report or dialog module (with CALL TRANSACTION , SUBMIT or CALL DIALOG ), the contents of ABAP/4 memory are retained, even across several levels. The called transaction can then retrieve the data from there using IMPORT … FROM MEMORY . Each new EXPORT … TO MEMORY statement overwrites any old data, so no data is appended.
If the processing leaves the deepest level of the call chain, the ABAP/4 memory is released.
Note
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.
Addition 1
… FROM g (for each object to be exported)
Effect
Exports the contents of the data object g and stores them under the name specified before FROM .
Addition 2
… ID key
Effect
Stores the exported data under the ID key in ABAP/4 memory . You can then use the ID to read it in again (with IMPORT ). The ID can be up to 32 characters long.
Note
If you store data both with and without an ID , the data stored without an ID remains separate and you can re-import it (using IMPORT without ID ).
Note
Runtime errors

* EXPORT_NO_CONTAINER : SAP paging exhausted

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 you to 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.
Note
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.
Note
This variant is not to be used at present.
Note
Runtime errors
* EXPORT_DATASET_CANNOT_OPEN : Unable to describe file.

* EXPORT_DATASET_WRITE_ERROR : File write error.

EXPORT – Export a screen

Basic form
EXPORT DYNPRO h f e m ID id.
Effect
Exports the screen specified in the field id . The screen information is taken from the structure h ( screen header , structure D020S ) and the internal tables f (field list, structure D021S ), e (flow logic, structure D022S ) and m (matchcode information, structure D023S ).
Related IMPORT DYNPRO , GENERATE DYNPRO , SYNTAX-CHECK FOR DYNPRO , DELETE DYNPRO .

EXPORT NAMETAB – Export a structure description
Basic form
EXPORT NAMETAB h f ID id.
Effect
Exports a generated structure description. This statement can only be used by ABAP/4 Repository tools!
Note
Runtime errors
* EXPORT_NAMETAB_WRONG_ID : Table name is too long

Share

If you like this post, you may as well like these too:

  1. AT : ABAP Keyword a day AT Events in lists- AT LINE-SELECTION.- AT USER-COMMAND.- AT PFn.Events on selection screens- AT SELECTION-SCREEN.Control break with extracts- AT NEW f.- AT END OF f.- AT FIRST.- AT LAST.- AT...
  2. GET: ABAP Keyword a day GET: Event keyword for defining event blocks for reporting events. GET <node> [FIELDS <fi> <f 2>...]. GET node LATE [FIELDS f1 f2 ...]. Only occurs in executable programs. When the...
  3. DO : ABAP Keyword a day DO Variants 1. DO. 2. DO n TIMES. Variant 1 DO. Addition … VARYING f FROM f1 NEXT f2 Effect Repeats the processing enclosed by the DO and ENDDO statements...
  4. ASSIGN: ABAP Keyword a day ASSIGN Variants:1. ASSIGN f TO .2. ASSIGN (f) TO .3. ASSIGN TABLE FIELD (f) TO .4. ASSIGN LOCAL COPY OF MAIN TABLE FIELD (f) TO .5. ASSIGN COMPONENT idx OF...
  5. FORM: ABAP Keyword a day FORM: Defines a subroutine. Syntax FORM [USING ... [VALUE(][)] [TYPE |LIKE ]„. ] [CHANGING... [VALUE(][)] [TYPE |LIKE ]„. ]. Introduces a subroutine. The USING and CHANGING additions define the subroutine’s...
  6. FETCH : ABAP Keyword a day FETCH Basic form FETCH NEXT CURSOR c target. Effect Uses the cursor c to read the next line or lines from the dataset of a database table determined by OPEN...
  7. ENDCASE : ABAP Keyword a day ENDCASE Basic form ENDCASE. Effect The ENDCASE statement closes a case disinction introduced by CASE ....
  8. DELETE : ABAP Keyword a day DELETE Delete from a database table - DELETE FROM dbtab WHERE condition. - DELETE FROM (dbtabname) WHERE condition. - DELETE dbtab. - DELETE *dbtab. - DELETE (dbtabname) … . -...
  9. DATA : ABAP Keyword a day DATA Variants1. DATA f.2. DATA f(len).3. DATA: BEGIN OF rec,…END OF rec.4. DATA: BEGIN OF itab OCCURS n,…END OF itab.5. DATA: BEGIN OF COMMON PART c,…END OF COMMON PART.EffectDefines global...
  10. CONTINUE: ABAP Keyword a day CONTINUE Basic formCONTINUE.EffectWithin loop structures like * DO … ENDDO* WHILE … ENDWHILE* LOOP … ENDLOOP* SELECT … ENDSELECTCONTINUE terminates the current loop pass, returns the processing to the beginning...
  11. CONCATENATE : ABAP Keyword a day CONCATENATE Basic form CONCATENATE f1 … fn INTO g. Addition … SEPARATED BY h Effect Places the fields f1 to fn after g . With the fields fi (1 <=...
  12. COMPUTE: ABAP Keyword a day COMPUTEBasic formCOMPUTE n = arithexp.EffectEvaluates the arithmetic expression arithexp and places the result in the field n .Allows use of the four basic calculation types + , – , *...
  13. CNT : ABAP Keyword a day CNT Basic form… CNT(h) …EffectCNT(h) is not a statement, but a field which is automatically created and filled by the system if f is a sub-field of an extract dataset...
  14. CASE: ABAP Keyword a day CASE Basic formCASE f. Effect Case distinction.Depending on the current contents of a field, this statement executes one of several alternative processing branches. The field whose contents determine how the...
  15. GET PARAMETER: ABAP Keyword a day GET PARAMETER Gets an SPA/GPA parameters. Syntax GET PARAMETER ID <pid> FIELD <field_name>. Writes the value of the SPA/GPA parameter <pid> from the user-specific SAP memory into the variable <f>....



Leave a Reply