2011 Jul 19 6:17 PM
Hi Gurus,
I need one small Information.
One of the methods of a Class wil export teh data present in an internal table as shown below.
data lt_tkomv TYPE table of komv,
EXPORT dtp_prices = lt_tkomv TO MEMORY ID 'DTP_PRICES'.
I need to get the data present in that particular memory in my program..and I implented teh code as shown below.
data lt_tkomv_old type table of KOMV.
import lt_tkomv to lt_tkomv_old FROM MEMORY ID 'DTP_PRICES'.
But I couldn't able to fetch the memory from the memory ID 'DTP_PRICES'.
Please provide teh solution for the above..
Thanks
Natasha SS.
2011 Jul 20 8:03 AM
Just a moment ago I explained how to properly use syntax for IMPORT/EXPORT statements. Please refer .
Regards
Marcin
Just a moment ago I explained how to properly use syntax for IMPORT/EXPORT statements. Please refer .
Regards
Marcin
2011 Jul 19 6:41 PM
Try the following example syntax for export and import respectively and try
import it_itab to it_itab_tmp FROM MEMORY ID 'ABC'.
export it_itab from it_itab_tmp TO MEMORY ID 'ABC'.
2011 Jul 19 8:31 PM
Hi Natasha.
I think you can use like this:
DATA: lt_tkomv TYPE STANDARD TABLE OF KOMV.
export lt_tkomv TO MEMORY ID 'ABC'.
...
import lt_tkomv FROM MEMORY ID 'ABC'.
Try using same variable name (of internal table) in both programs to use import and export.
This must work fine.
best regards.
Glauco
2011 Jul 20 6:30 AM
Hi Natasha,
Please try in this way.
DATA : lt_tkomv TYPE TABLE OF komv.
lt_tkomv = dtp_prices (Filling the internal table lt_tkomv).
EXPORT lt_tkomv TO MEMORY ID 'DTP_PRICES'.
In the other program declare the internal table with the same variable name. ie, DATA : lt_tkomv TYPE TABLE OF komv.
IMPORT lt_tkomv FROM MEMORY ID 'DTP_PRICES'.
Hope this will help you.
Thanks & Regards.
Shahanaz.
Edited by: shahanazhussain on Jul 20, 2011 7:32 AM
2011 Jul 20 8:03 AM
Just a moment ago I explained how to properly use syntax for IMPORT/EXPORT statements. Please refer .
Regards
Marcin
2011 Jul 20 8:13 AM
Above post is correct. Aside from that, maybe you try to pass data between objects in a way that isn't possible in general.
Check here:
http://help.sap.com/saphelp_470/helpdata/en/fc/eb3bc4358411d1829f0000e829fbfe/content.htm
Cheers,
Lukas
2011 Jul 20 9:20 AM
I agree. I even put my eye blind on fact that this obviously contravenes OO rulse, as she breaks encapsulation here. Anyhow first look at line
import lt_tkomv to lt_tkomv_old FROM MEMORY ID 'DTP_PRICES'.
tells us that she used statement incorrectly. That's why I focused only SYNTAX part.
Regards
Marcin
2011 Jul 20 9:55 AM
Dear Marcin,
Could you please what exactly is the wrong with statmenet below I used..
IMPORT lt_tkomv TO lt_tkomv_old FROM MEMORY ID 'DTP_PRICES'.
thanks
Natasha SS.
2011 Jul 20 10:04 AM
you import from a memory id.. not to a memory id..
You export 'To' a memory id..
So try
IMPORT lt_tkomv TO lt_tkomv_old FROM MEMORY ID 'DTP_PRICES'.
Edited by: Suzie on Jul 20, 2011 2:35 PM
2011 Jul 20 10:10 AM
Dear Suzie,
I tried the same...
IMPORT lt_tkomv FROM MEMORY ID 'DTP_PRICES'.
But still it didn't work..
Thanks
Natasha SS.
2011 Jul 20 10:20 AM
Dear Natasha,
First your export your LT_TKOMV table to memory and store it under name DTP_PRICES. So the system creates a area called DPT_PRICES in this memory and placed there your data.
EXPORT dtp_prices = lt_tkomv TO MEMORY ID 'DTP_PRICES'.
So if you want to import data back from this memory, you have to tell the system which area this data are stored, so there should be
IMPORT dtp_prices = lt_tkomv_old FROM MEMORY ID 'DTP_PRICES'.
instead of
IMPORT lt_tkomv TO lt_tkomv_old FROM MEMORY ID 'DTP_PRICES'.
as there is no area called LT_TKOMV in the memory, so system doesn't recognizes it.
Hope it is clear
Marcin
2011 Jul 20 11:45 AM
The syntax isn't the only point in my opinion. Your program might simply terminate the runtimeobject which ultimately exported the Data to Memory. Once this happens, the memory is thrashed by garbage collector and the data is gone. Then you try to import from something that isn't there.
Please Debug your code:
1. After Exporting to memory, go to a tab of the debugger where you have some space and choose "new tool". Choose "Special Tools" and "System Internal". There, in the tab "content" double click on "MEMORIES EXPORT/IMPORT memories". Now you can see all active memory IDs. Take a look whether yours is there. If it isn't, you failed exporting from the start. Take a look at what is says.
2. BEFORE importing go to the said tool again and take a look whether your memory ID still has its contents or whether it's null.
regards, Lukas
2011 Jul 20 1:57 PM
Hi Susie.
I've created two test programs like bellow and EXPORT/IMPORT can work in two different ways like you can see in T_EKKO and T_BKPF variables.
Follow:
REPORT y_test_1.
DATA: t_ekko TYPE STANDARD TABLE OF ekko.
DATA: t_bkpf TYPE STANDARD TABLE OF bkpf.
SELECT * FROM ekko INTO TABLE t_ekko.
SELECT * FROM bkpf INTO TABLE t_bkpf.
EXPORT t_ekko TO MEMORY ID 'T_EKKO'.
EXPORT bkpf_test = t_bkpf TO MEMORY ID 'BKPF_TEST'.
SUBMIT y_test_2.REPORT y_test_2.
DATA: t_ekko TYPE STANDARD TABLE OF ekko.
DATA: t_bkpf TYPE STANDARD TABLE OF bkpf.
IMPORT t_ekko FROM MEMORY ID 'T_EKKO'.
IMPORT bkpf_test = t_bkpf FROM MEMORY ID 'BKPF_TEST'.best regards.
Glauco
2011 Jul 20 11:48 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |