Skip to Content
0
Former Member
May 01, 2009 at 02:39 PM

Passing Dynamic Internal Tables to Memory

880 Views

I have a bit of a conundrum right now that I can't seem to correct. I am working on adding an ALV report to an existing report program. I was able to write a simple helper program that builds a custom object that I defined that translates my raw data into two seperate dynamic tables, and then builds an ALV grid and outputs it. The reason I wrote this in a simple helper program was so that I could use SUBMIT ... EXPORTING LIST TO MEMORY from my primary report program and capture the input so I can later write it out under our company's standard ABAP list format as if I were using WRITE statements.

The output of the report itself is working beautifully. We have included functionality to automatically take the output, produce an HTML file from it, and then FTP it directly to a webserver so our clients can get easy access to it. What I want to be able to do though is give the clients two tab-delimited files that contain the raw data that was used to build the report. We have an interface in place to do that, but I somehow need to be able to pass these two dynamic internal tables which I have field-symbols to reference back to my calling program.

Here is what I am trying to do:

CALL METHOD OBJ_ALV_MR_EST_REASONS->PRODUCE_ESTIMATION_REPORT
    IMPORTING
      RPT_DATA_BY_REASON   = ref_it_estreason
      RPT_DATA_BY_DISTRICT = ref_it_district.

*   Assign the field symbols
  ASSIGN ref_it_estreason->* TO <it_estreason>.
  ASSIGN ref_it_district->* TO <it_district>.

* Export the two internal tables to memory so they can be
* retrieved by the calling program
  EXPORT reason = <it_estreason>[]
         district = <it_district>[]
  TO MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.

As you can see, my method returns two references to dynamic internal tables. I have used the memory debugger to see that these tables are being correctly written to the ABAP memory.

However, back in my parent program when I try to do the following,

CREATE DATA ref_it_estreason TYPE REF TO DATA.
      CREATE DATA ref_it_district TYPE REF TO DATA.
      ASSIGN ref_it_estreason->* TO <it_estreason>.
      ASSIGN ref_it_district->* TO <it_district>.
      IMPORT reason = <it_estreason>
             district = <it_district>
      FROM MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.

I get the REFS_NOT_SUPPORTED_YET exception which says that "For the statement Export/Import ..." object references, interface references, and data references are currently not supported".

I have tried multiple other ways of defining my field-symbols or my reference pointers but they all result in exceptions of some sort. Is there any way for me to get this data passed back? It seems like there must be a way to get the data from memory since I know it's being correctly stored there.

Thanks in advance.