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

Read internal table in memory

Hello!! Is there a way to read an internal table that's not available in a program, but it's in the memory?... let's say i have a program with an internal table ITAB, in the program i call a function module where i need information from that internal table, but been the program standard i can't send the ITAB to the function module... is there a way to access that ITAB from the function module? i don't know if i can do it with field symbols or something like it...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jan 20, 2005 at 10:11 PM

    No, you can't access the internal table of a function module. Try looking, maybe there could be another function module within the function group that exported the internal table.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 20, 2005 at 10:28 PM

    Could you help clarify?

    You want to access an ITAB from a FM without passing the ITAB as a parameter? Doesn't this imply that you can change the FM? If you can change it, then you can add the ITAB as a parameter and mark it as optional if this is an issue with existing users of the FM.

    If there is some reason why you do not want to change the interface of the FM, you could EXPORT the ITAB from your program and IMPORT the table in the FM. Do help on EXPORT and see the EXPORT TO MEMORY option. This will export your ITAB to the ABAP Memory which is available across a program and the FMs that it calls.

    Does this help or have I misunderstood your problem?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I agree entirely with what Charles Folwell has written but if there is a reason you can not do any of the suggestions he has made then there is a technique that may work using field symbols. This allows you to get data which is not directly available but is stored somewhere within the memory stack, i.e. available in the calling program. The code to do this is as follows:

      • create field symbol

      FIELD-SYMBOLS: <f>.

      • Assign value of variable from calling prog to field symbol

      ASSIGN ('(SAPMM06E)RM06E-BSART') TO <f>.

      SAPMM06E being the program where the field exists and RM06E-BSART being the actual field name. <F> will now contain its value.

  • Posted on Jan 21, 2005 at 08:11 AM

    Yes you can read "out of context memory" in ABAP, although it is an unofficial feature - I believe. You construct a field symbol, but include the variable's owning program name.

    data: plnum_field(120) type c.
    field-symbols: <fs_plnum> type any.
    move '(SAPLBARM)RM61B-PLNUM' to plnum_field.
    assign (plnum_field) to <fs_plnum>.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 21, 2005 at 08:32 AM

    Hi Jesus,

    well... there is indeed another way to do so. You could try an "export itab to memory" to save the itab, and then "import itab from memory" to read it back.

    Hope it helps. BR,

    Alvaro

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 24, 2005 at 09:58 AM

    Dear Jesus,

    There is no way, in my knowledge to do so, as you are accessing standard function module. But you can do one thing, copy that standard function module and give it your name and add one parameter for that table in that and pass your table.

    Try it, if possible.

    Sandip

    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.