Application Development and Automation 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: 
Read only

What is Import parameter and Export parameter

Former Member
0 Likes
14,773

What is Import parameter and Export parameter and explain the difference between these two

1 ACCEPTED SOLUTION
Read only

VikasB
Active Participant
5,825

Hi Steve,

Import and Export statements primarily deals with the Memory area.

when you use export with some value to one ID, that value gets stored in that Memory ID. Then you can use Import statement to again get back the value in another program UNLESS you clear or free the memory.

this value remains in the memory ID untill you finish off with all your sessions.

Regards,

Vikas.

plz reward if helpful...

7 REPLIES 7
Read only

VikasB
Active Participant
5,826

Hi Steve,

Import and Export statements primarily deals with the Memory area.

when you use export with some value to one ID, that value gets stored in that Memory ID. Then you can use Import statement to again get back the value in another program UNLESS you clear or free the memory.

this value remains in the memory ID untill you finish off with all your sessions.

Regards,

Vikas.

plz reward if helpful...

Read only

former_member195698
Active Contributor
0 Likes
5,825

Import export parameter With Respect to A Function Module

Import - Contains a list of the formal parameters that are used to pass data to a function module. You cannot overwrite the contents of import parameters at runtime.

Export - Contains a list of the formal parameters that are used to receive data from a function module

The same will apply to any object

regards,

aj

Read only

Former Member
0 Likes
5,825

Import parameters are the values, which are need to be given as input to any function module or program

Export parameters are the values which are to be taken out form the function module or program.

Read only

Former Member
0 Likes
5,825

Import parameters. These must be supplied with data when you call the function module, unless they are flagged as optional. You cannot change them in the function module.

Export parameters. These pass data from the function module back to the calling program. Export parameters are always optional. You do not have to receive them in your program

Difference:

Calling Function Modules in ABAP

After EXPORTING, you must supply all non-optional import parameters with values appropriate to their type. You can supply values to optional import parameters if you wish.

After IMPORTING, you can receive the export parameters from the function module by assigning them to variables of the appropriate type.

Regards,

Maha

Read only

Former Member
0 Likes
5,825

Hi,

Here is sample program for import and export stmts.

Please copy these 2 programs differently inot ur system and try.you will get some idea.

-


Program1----


REPORT demo_program_rep3 NO STANDARD PAGE HEADING.

DATA: number TYPE i,

itab TYPE TABLE OF i.

SET PF-STATUS 'MYBACK'.

DO 5 TIMES.

number = sy-index.

APPEND number TO itab.

WRITE / number.

ENDDO.

TOP-OF-PAGE.

WRITE 'Report 2'.

ULINE.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'MBCK'.

EXPORT itab TO MEMORY ID 'HK'.

LEAVE.

ENDCASE.

-


Program2----


REPORT demo_programm_leave NO STANDARD PAGE HEADING.

DATA: itab TYPE TABLE OF i,

num TYPE i.

SUBMIT demo_program_rep3 AND RETURN.

IMPORT itab FROM MEMORY ID 'HK'.

LOOP AT itab INTO num.

WRITE / num.

ENDLOOP.

TOP-OF-PAGE.

WRITE 'Report 1'.

ULINE.

-


end of program 2----


Now you copy this programs with same name as i mentioned and execute demo_programm_leave Program.you will understnad clearly.

Notes::: A logical memory model illustrates how the main memory is distributed from the view of executable programs. A distinction is made here between external sessions and internal sessions .

An external session is usually linked to an R/3 window. You can create an external session by choosing System/Create session, or by entering /o in the command field. An external session is broken down further into internal sessions. Program data is only visible within an internal session. Each external session can include up to 20 internal sessions (stacks).

Every program you start runs in an internal session.

To copy a set of ABAP variables and their current values (data cluster) to the ABAP memory, use the EXPORT TO MEMORY ID statement. The (up to 32 characters) is used to identify the different data clusters.

If you repeat an EXPORT TO MEMORY ID statement to an existing data cluster, the new data overwrites the old.

To copy data from ABAP memory to the corresponding fields of an ABAP program, use the IMPORT FROM MEMORY ID statement.

Regds

Sivaparvathi

Please reward points if helpful

Read only

Former Member
5,824

if you are sending parameters to function module, that are importing parameters to the function module, the function module replys that are exporting parameters from function module point of view

ex : Suppose you buy one imported car,

then your point of view that is imported

same time the manufacturing country is there that country point of view that is exporting.

Read only

Former Member
0 Likes
5,824

hi steve,

Import parameters. These must be supplied with data when you call the function module, unless they are flagged as optional. You cannot change them in the function module.

Export parameters. These pass data from the function module back to the calling program. Export parameters are always optional. You do not have to receive them in your program.