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

Internal table refreshing

Hi Experts,

I copyed the me2k(RM06EK00) program to Zprogram and doing some

modification.

My problem is I declared the internal table and some values are populating to

the internal table in the subroute PERFORM ekpo_ausgabe(sapfm06l).

(This is last perform statement before END-OF-Selection),

when it comes out of the perform statement and before End-of- selection my internal table values are refreshed automatically, I didn't refreshed the internal table.

Pls help me to get the values without refreshing my IT.

Thanks in advance

karthik

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Aug 30, 2007 at 03:32 PM

    The problem is that the internal table that is being fill in the PERFORM, is not the same memory area as the internal table in your calling program, you would need to pass this internal table back to the caller either by using the TABLES interface of the PERFORM, or using the EXPORT/IMPORT statements to pass it thru memory. You would EXPORT the internal table in the PEFORM, and IMPORT in the calling program. I gues this is an issue for you since, the PERFORM actually is in program sapfm06l which you probably don't want to modify, right?

    Maybe we can access via a field symbol.

    Regards,

    RIch Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • For example, lets look at program ZRICH_0001, here I am calling a PERFORM which is in program ZRICH_0002 and then pulling that internal table out of the memory stack.

      
      report  zrich_0001.
      
      types: tt001 type table of t001.
      
      field-symbols: <it001> type tt001.
      
      data: pointer_string type string.
      data: xt001 like line of <it001>.
      
      start-of-selection.
      
      * Call the perform in other program
        perform fill_up_it001 in program zrich_0002.
      
      * Assign an internal table
        pointer_string = '(ZRICH_0002)IT001[]'.
        assign (pointer_string) to <it001>.
      
        loop at <it001> into xt001.
          write: / xt001-bukrs, xt001-butxt..
        endloop.
      
      

      And the code for the second program.

      
      report zrich_0002 .
      
      data: it001 type table of t001.
      
      *---------------------------------------------------------------------*
      *       FORM fill_up_it001                                            *
      *---------------------------------------------------------------------*
      form fill_up_it001.
      
        select * into table it001 from t001.
      
      endform.
      
      

      Now I think this will work for you, but the internal table from the PERFORM must be global variable in the main program, not local to the FORM, if it is local to the FORM, then this will not work.

      Regards,

      Rich Heilman

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 03:31 PM

    HI,

    May be this internal table local to that perform.. check and see...and also i see that you are using perform to call a subroutine that is part of other program... ensure that you have this internal table global to the entire program.

    Thanks

    Mahesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 03:33 PM

    Hi Karthik,

    Did you declare the internal table in the subroutine???

    If so, please declare the internal table globally.. When a subroutine is complete, the local variables of the subroutine are not accessible..

    Thanks and Best Regards,

    Vikas Bittera.

    **Reward if useful**

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 30, 2007 at 03:34 PM

    Hi,

    Define your internal table in the include FM06LCEK. I think that will solve your issue

    Add a comment
    10|10000 characters needed characters exceeded

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.