Skip to Content
author's profile photo Former Member
Former Member

Transferring an Internal table from one Function Module to another

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 FM1

      or 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.