‎2007 Sep 27 8:38 PM
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.
‎2007 Sep 28 5:04 AM
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
‎2007 Sep 27 8:42 PM
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
‎2007 Sep 27 8:54 PM
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
‎2007 Sep 27 8:56 PM
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
‎2007 Sep 28 1:54 AM
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
‎2007 Sep 28 3:10 PM
‎2007 Sep 28 3:13 PM
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
‎2007 Sep 28 6:06 PM
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
‎2007 Sep 28 5:04 AM
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
‎2007 Sep 28 5:09 AM
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>