Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Internal table refreshing

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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**

former_member194669
Active Contributor
0 Kudos

Hi,

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