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: 

How to transfer data across two different tasks in SAP

Former Member
0 Kudos
206

Hello,

Can you please tell me how can I export and import data across two different LUWs? We have a program which generates another dynamic program and then executes this dynamic program in a separate task. (SAP does not allow to SUBMIT generated program with the clause EXPORTING LIST TO MEMORY).

This generated program generates a list which is retrieved using RECEIVE RESULTS statement. But somehow my program hangs at this stage and I am not able to receive a list from the second task to my first task.

Thanks a lot for all the help

Regards

Priyanka

3 REPLIES 3

Former Member
0 Kudos
128

Hi ,

first trance the task ,then u will come to know whats happening ?

dynamic means ?

      submit (t_repid) using selection-set 'EMAIL'
                              with s_werks eq yplant-pplnt
                              with s_budat in s_budat
                              exporting list to memory and return.

*   and read list from memory into table
      call function 'LIST_FROM_MEMORY'
        tables
          listobject = listobject
        exceptions
          others     = 1.

      if sy-subrc <> 0.
        message id '61' type 'E' number '731'
        with 'LIST_FROM_MEMORY'.
      endif.

regards

Prabhu

dani_mn
Active Contributor
0 Kudos
128

HI,

you can use export and import to do this.

<b>In calling program for export</b>

data: it_bkpf type table of bkpf with header line.

SELECT * FROM bkpf into table it_bkpf.

<b>EXPORT it_bkpf[] TO MEMORY ID 'MID'.</b>

<b>In called program for import</b>

data: it_bkpf type table of bkpf with header line.

<b>IMPORT it_bkpf[] FROM MEMORY ID 'MID'.</b>

LOOP AT It_bkpf.

write:/ it_bkpf-belnr, 'found' color col_positive.

ENDLOOP.

Regards,

uwe_schieferstein
Active Contributor
0 Kudos
128

Hello Priyanka

You could save the required data from the submitted report persistently, e.g.:

EXPORT <data> TO DATABASE indx(<ar>) ID <key>.

In your submitting report you can now import these data:

IMPORT <data> FROM DATABASE indx(<ar>) ID <key>.

If you need a link between both reports you could add the <key> as an additional parameter to your submitted report.

Regards

Uwe