2008 Jul 11 7:35 AM
Hi All,
Please see the cide below.
DATA : lv_num1 TYPE i VALUE '10',
lv_num2 TYPE i.
DATA : id TYPE c LENGTH 10 VALUE 'TEST'.
EXPORT lv_num1 TO MEMORY ID id.
IMPORT lv_num2 FROM MEMORY ID id.
WRITE 😕 lv_num2.
why I am not getting 10 in lv_num2?
Regards,
Jeetu
2008 Jul 11 8:22 AM
Hi jeetu,
The problem is, when u r exporting lv_num1 to memory id, the value will get exported but it will be identified as "lv_num1" in the memory space. so when u r trying to import with the name "lv_num2" the name is not available in memory..
try this piece of code and it will work...
data: A TYPE I,
B TYPE I.
a = 2222.
EXPORT A FROM A TO MEMORY ID 'ZAVPTEST'.
IMPORT A TO B FROM MEMORY ID 'ZAVPTEST'.
WRITE B.
Here when i am importing, i am importing the value that was stored with the name "B'. SAP has provided this option so that u can export multiple values to the same memory id and then import from there. so for importing the values to the correct variables, u need this option..
Regards,
Anoop V Panackal
Hi All,
Please see the cide below.
DATA : lv_num1 TYPE i VALUE '10',
lv_num2 TYPE i.
DATA : id TYPE c LENGTH 10 VALUE 'TEST'.
EXPORT lv_num1 TO MEMORY ID id.
IMPORT lv_num2 FROM MEMORY ID id.
WRITE 😕 lv_num2.
why I am not getting 10 in lv_num2?
Regards,
Jeetu
2008 Jul 11 7:38 AM
hiiii
because here first you are sending value 10 to memory id ID.then by using IMPORT statement you are fetching value of memory id ID so you will get 10 value only as you are sending value of lv_num1 to memory id & its value is 10 only..
regards
twinkal
2008 Jul 11 7:47 AM
hi,
Add TO DATABASE as in this statement:-
EXPORT v_time
FROM sy-uzeit
TO DATABASE indx(xy)
ID c_time.
EXPORT v_date
FROM sy-datum
TO DATABASE indx(xy)
ID c_date.
give it as indx(xy) only..
c_time, c_date i declared were constants.. the Actual Statement was:
EXPORT v_time
FROM sy-uzeit
TO DATABASE indx(xy)
ID 'IN_8081_TIME'.
Tell me if your problem is solved,, i will tell you why it was not displaying..
2008 Jul 11 7:48 AM
IMPORT v_time
TO v_lastruntime
FROM DATABASE indx(xy)
ID c_time.
for the Previous Export,, this is the Import..
2008 Jul 11 7:58 AM
Hi Jeetu,
you are not getting any value in lv_num2 as there is no value for it in memory id, you are exporting for lv_num1 so you will get 10 for lv_num1 only. try this you can import this in some other report program.
DATA : lv_num1 TYPE i VALUE '10',
lv_num2 TYPE i.
DATA : id TYPE c.
EXPORT lv_num1 TO MEMORY ID id.
IMPORT lv_num1 FROM MEMORY ID id.
WRITE :/ lv_num2, lv_num1.refer to the link below:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3bde358411d1829f0000e829fbfe/content.htm
With Luck,
Pritam.
Edited by: Pritam Ghosh on Jul 11, 2008 9:00 AM
2008 Jul 11 8:22 AM
Hi jeetu,
The problem is, when u r exporting lv_num1 to memory id, the value will get exported but it will be identified as "lv_num1" in the memory space. so when u r trying to import with the name "lv_num2" the name is not available in memory..
try this piece of code and it will work...
data: A TYPE I,
B TYPE I.
a = 2222.
EXPORT A FROM A TO MEMORY ID 'ZAVPTEST'.
IMPORT A TO B FROM MEMORY ID 'ZAVPTEST'.
WRITE B.
Here when i am importing, i am importing the value that was stored with the name "B'. SAP has provided this option so that u can export multiple values to the same memory id and then import from there. so for importing the values to the correct variables, u need this option..
Regards,
Anoop V Panackal
2008 Jul 11 10:04 AM
Hi Jeetu,
What I observed is you are exporting lv_num1 to memory id 'ID' and importing the value of lv_num2 from memory id 'ID'. So just change the code as below.
EXPORT lv_num1 TO MEMORY ID id.
IMPORT lv_num1 FROM MEMORY ID id.
WRITE 😕 lv_num1.
If you want the value to be in lv_num2 also just write as :
lv_num2 = lv_num1. after you import the value.
Regards,
Swapna.
2008 Jul 11 10:09 AM
Hi,
Write this,
EXPORT lv_num1 TO MEMORY ID id.
IMPORT lv_num1 to lv_num2 FROM MEMORY ID id.
Write:
lv_num2.
Regards,
Sujit
2008 Jul 11 10:15 AM
Hi,
have a look.
you mention in your code.
MEMORY ID id.
but you have to mention like
MEMORY ID 'ID'.
try like this.
regards.
sriram.
2008 Jul 11 10:32 AM
DATA : lv_num1 TYPE i VALUE '10',
lv_num2 TYPE i.
DATA : id TYPE c LENGTH 10 VALUE 'TEST'.
EXPORT lv_num1 TO MEMORY ID id.
IMPORT lv_num1 FROM MEMORY ID id.WRITE 😕 lv_num2.
You should use the same name and type when you are using import.
2008 Jul 11 10:37 AM
Hi jeetu,
DATA : lv_num1 TYPE i VALUE 10,
lv_num2 TYPE i LENGTH 10 VALUE 'TEST'.
.
DATA : id TYPE c .
EXPORT lv_num1 to MEMORY ID id.
IMPORT lv_num1 to lv_num2 from MEMORY ID id.
WRITE: lv_num2.
Regards,
Sravanthi
2008 Jul 11 10:54 AM
Hi
In your code you use
MEMORY ID id.
But try with
MEMORY ID 'ID'.
Hope it will solve your problem
Thanks & Regards
Nikunj shah
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |