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

Import statement .. what does it do ??

Former Member
0 Likes
1,136

Hi All,

What is IMPORT statement doing ??

IMPORT order_items_in to w_order_items_in from MEMORY ID

'FREEGOODSTERMS'.

can you kindly explain what this statement is doing ?

I was by my friend that this is used to pass order_items from one session to this sesssion, but when I searched for FREEGOODSTERMS, I could find export after this statment. I was wondering how can import me first and then export.

Please let me know.

Thanks

venkat.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,092

Hi Venkat,

1st Import would be to import data from some other program which has EXPORTED the data.

2nd Export would be to export data to some other program.

YOu can check which program has been using IMPORT EXPORT with this string search program.

Goto SE38 & type RPR_ABAP_SOURCE_SCAN

Execute & Enter the search string.

Best regards,

Prashant

9 REPLIES 9
Read only

Former Member
0 Likes
1,092

It is like ABAP Memory.

Passing the data from one program to other program.

first program you can use export memory and second program you can use Import the data based on memory.

Thanks

Seshu

Read only

0 Likes
1,092

Hi Seshu,

Thank you very much for your reply.

In My program, When I searched with 'FREEGOODSTERMS' as this is memory ID. I should get only one export and one import both of them are in same include program, more over import statement appears before export statement.

Also I have realised that, w_order_items_in is Internal table with header line.

1) Why import statment appeard first.

2) after import statement, w_order_items_in table is not having any value. please let me know, how to check values before this import statement.

Thanking you.

venkat

Read only

0 Likes
1,092

hi venkat,

It is possible that they assigned values to the memory id in some other program. Hence in this program u are importing it..doing some changes and exporting it back.

Sri

Read only

0 Likes
1,092

Hello Venkat,

Sorry for late reply..

Please see the program which other program submitting somewhere.

if they are using multiple purpose then export and import statement may possible in one include.

Best way just use where used list for that include and other programs searching like export and submit..

For better understanding about export and import then see the below sample programs.

Create one program and paste below code :

REPORT ZTEST_AMEM1.

tables : lfa1.

data : begin of i_lfa1 occurs 0 ,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

end of i_lfa1.

start-of-selection.

select lifnr

name1

land1 from lfa1

into table i_lfa1 up to 100 rows.

  • Export

export i_lfa1 to memory id 'SAP'.

submit ztest_amem2 and return.

write:/ 'hello'.

Now create one more program and paste below code :

REPORT ZTEST_AMEM2.

data : begin of j_lfa1 occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

end of j_lfa1.

start-of-selection.

import i_lfa1 to j_lfa1 from memory id 'SAP'.

loop at j_lfa1.

write:/ j_lfa1-lifnr,j_lfa1-name1,j_lfa1-land1.

endloop.

Thanks

Seshu

Read only

0 Likes
1,092

Thanks Sri,

This reply is definitely helpful.

Regards

Venkat

Read only

0 Likes
1,092

Hi Seshu, Prashant and Tree.

Thank you very much for your inputs. I got it now.

I have tried using example code given by Seshu and worked out fine.

Thank you all. This is really great help.

I have a quick question, If I am in my second program and not getting any value after export statement, meaning no value has passed from first program, I want to go to my first program and see why data is not comming.

what is the best way to search and go to first program. I am having problem with using Where-Used funtion.

Should I keep m,y cursor on memory ID, or Submit export ??

Please let me know.

Regards

Venkat

Points awarded.

Message was edited by:

venkat Kumbham

Read only

0 Likes
1,092

Hello Venkat,

if where use function is not working then use Program RSRSCAN1(4.6C Version) ( Search string would be memory id and program name is Z* or what ever).

If you are not getting the data then issue might be at first program,so keep break point first program then see the results.

either you can set break point submit area or import statement once you get the data using export statement

Hope it helps you

Thanks

Seshu

Read only

Former Member
0 Likes
1,093

Hi Venkat,

1st Import would be to import data from some other program which has EXPORTED the data.

2nd Export would be to export data to some other program.

YOu can check which program has been using IMPORT EXPORT with this string search program.

Goto SE38 & type RPR_ABAP_SOURCE_SCAN

Execute & Enter the search string.

Best regards,

Prashant

Read only

varma_narayana
Active Contributor
0 Likes
1,092

Hi..

Check this. You may get the Idea..

ABAP MEMORY:

To transfer the Data between the Programs Running in the Same Session We can use.

Eg:

Calling Report.

REPORT ZREP1.

DATA : ITAB TYPE TABLE OF MARA.

SELECT * FROM MARA INTO TABLE ITAB.

EXPORT TEMPTAB FROM ITAB TO MEMORY ID 'M1'.

SUBMIT ZREP2 AND RETURN.

Called report

REPORT ZREP2.

DATA: IT_MARA TYPE TABLE OF MARA.

DATA WA TYPE MARA.

IMPORT TEMPTAB TO IT_MARA FROM MEMORY ID 'M1'

LOOP AT IT_MARA INTO WA.

WRITE:/ WA-MATNR.

ENDLOOP.

<b>SAP Memory:</b>

It is used to pass the Data to Screen fields or Read data from Screen Fields.

It can be used to Transfer data from one Session(window) to another within the Login.

DATA : V_KUNNR TYPE KNA1-KUNNR VALUE 1000.

SET PARAMETER ID 'KUN' FIELD V_KUNNR.

CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.

<b>Reward if Helpful.</b>