‎2007 Nov 21 7:11 AM
Hi,
I need to transfer an Internal Table from one FM to another. I've tried the statements IMPORT IT from Memory ID and EXPORT IT to Memory ID, but this is not working. I think the reason is different session or diff LUW, I can not use SET and GET Parametr syntax, as I will not be able to pass Internal Tables through it.
Can any1 please give a solution on this?
Cheers
Abhishek
‎2007 Nov 21 7:17 AM
Hi abhishek,
Use IMPORT IT from Memory ID and EXPORT IT to Memory ID & free memory id.
It will work.
Do reward if it is helpfull.
Regards
Srimanta
‎2007 Nov 21 7:17 AM
Hi abhishek,
Use IMPORT IT from Memory ID and EXPORT IT to Memory ID & free memory id.
It will work.
Do reward if it is helpfull.
Regards
Srimanta
‎2007 Nov 21 7:30 AM
Hi Srimanta,
As written, I've already tried it and it is not working eventhough the table names used are the same in both the FMs, the reason is that there is no interlink between the FMs like a SUBMIT program or something like that, hence the same LUW is not there and that is why I am unable to get the IT data.
Regards
Abhishek
‎2007 Nov 21 7:37 AM
If IMPORT/EXPORT isn't working as you say, because the two FM are in different memory sessions, then you'll need to write/read the data to/from a db table. If you're feeling brave, you could use the persistent object framework.
matt
‎2007 Nov 21 7:53 AM
Hello,
How did you write the import / export statements ?
Use this code
" in the calling program / function
DATA: wa_indx TYPE indx.
EXPORT tab = itab TO DATABASE indx(xy)
FROM wa_indx
CLIENT sy-mandt
ID 'DETAILLIST'.
" in the called program / function
DATA wa_indx LIKE indx.
* imports from database the list sent by the calling program
IMPORT tab = itab FROM DATABASE indx(xy) TO wa_indx CLIENT sy-mandt
ID 'DETAILLIST'.
* deletes the data to save wastage of memory
DELETE FROM DATABASE indx(xy)
CLIENT sy-mandt
ID 'DETAILLIST'." note that the declaration of itab must be present in both programs
‎2007 Nov 21 8:55 PM
Hi there. Are these custom function modules or standard ones? If they are custom ones, could you just add a table to the "Tables" tab of your function module (whichever one you need to pass it to) and pass the values directly to the second function module?
- April King
‎2007 Nov 22 2:54 AM
I'd agree with April that the easiest way to pass data directly from FM1 to FM2 is via "tables", but what is your overall code structure i.e. are you going:
Program
Call Function FM1
back to Program
Call Function FM1or are you going:
Program
Call Function FM1
Call Function FM2 from FM1?
In either case, I would expect the export / import to be working fine, at least it seem to when I tried it using:
export lt_data from lt_data to memory id 'Z:1234'.&
import lt_data to lt_data from memory id 'Z:1234'.Jonathan