Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

EXPORT and IMPORT commands

Former Member
0 Kudos

Explain the EXPORT and IMPORT commands? How can you pass more than one

group of data by using IMPORT commands?

8 REPLIES 8

bpawanchand
Active Contributor
0 Kudos

Hi

EXPORT & IMport Commands are useful in trasferring the data from one program to another program by using ABAP and SAP maemory

SAP memory

The SAP memory, otherwise known as the global memory, is available to a user during the entire duration of a terminal session. Its contents are retained across transaction boundaries as well as external and internal sessions. The SET PARAMETER and GET PARAMETER statements allow you to write to, or read from, the SAP memory.

ABAP/4 memory

The contents of the ABAP/4 memory are retained only during the lifetime of an external session (see also Organization of Modularization Units). You can retain or pass data across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory.

For different forms of passing the data by using IMPORt and EXPORt

flloeww the link

http://members.tripod.com/sap_abap/import01.htm

Regards

Pavan

Edited by: Pavan Bhamidipati on Jul 11, 2008 6:59 AM

Former Member
0 Kudos

Hi john,

i hope this will help u out.

EXPORT :-

To read data objects from an ABAP program into ABAP memory, use the following

statement:

Syntax

EXPORT <f1> [FROM <g 1>] <f 2> [FROM <g 2>] ... TO MEMORY ID <key>.

This statement stores the data objects specified in the list as a cluster in memory. If you

do not use the option FROM <f i >, the data object <f i > is saved under its own name. If

you use the FROM <g i > option, the data objet <g i > is saved under the name <f i >.

The name <key> identifies the cluster in memory. It may be up to 32 characters long.

The EXPORT statement always completely overwrites the contents of any existing data

cluster with the same name <key>.

IMPORT :-

To read data objects from ABAP memory into an ABAP program, use the following

statement:

Syntax

IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.

This statement reads the data objects specified in the list from a cluster in memory. If

you do not use the TO <g i > option, the data object <f i > in memory is assigned to the

data object in the program with the same name. If you do use the option, the data object

<f i > is read from memory into the field <g i >. The name <key> identifies the cluster in

memory. It may be up to 32 characters long.

You do not have to read all of the objects stored under a particular name <key>. You

can restrict the number of objects by specifying their names. If the memory does not

contain any objects under the name <key>, SY-SUBRC is set to 4.

Rewards with pts if answered.

thanks,

Anurodh

Former Member
0 Kudos

Hey!!

Check out this link

http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm

Regards

Abhijeet Kulshreshtha

Former Member
0 Kudos

Former Member

Former Member
0 Kudos

hi..

syntax of EXPORT command is...

EXPORT parameter_list TO medium [COMPRESSION {ON|OFF}].

This statement stores a data cluster defined using parameter_list in a storage area medium. You can use the COMPRESSION addition to specify whether the data is stored in the cluster in compressed form. You can retrieve a data cluster from the storage area using the IMPORT statement and delete a data cluster using DELETE FROM.

All data objects are archived according to the current byte sequence (endian) and character-like data objects according to the current character representation of the current text environment. The identification of the data cluster indicates which byte sequence and character representation have been used during the export. When you import the data cluster using the IMPORT statement, this identification is evaluated and the data is converted to the current byte sequence and character representation.

syntax of IMPORT command is...

IMPORT parameter_list FROM medium [conversion_options].

Import data objects specified in parameter_list from a data cluster stored in the memory area medium. If required, the data is automatically converted to the current byte sequence (Endian) and character representation. Use additions conversion_options to make adaptations to the current platform.

hope this will clear your doubt.

please reward if it helps.

thanks.

Former Member
0 Kudos

Hello John,

EXPORT <FIELD1> TO MEMORY ID <ID>

EXPORT <FIELD2> TO MEMORY ID <ID>

this will overwrite the field1 with field2.

EXPORT <FIELD1> <FIELD2> TO MEMORY ID <ID>

here you will have both the fields in the ID.

Hope you find it helpful

Indu.