Application Development and Automation 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: 
Read only

regarding import and export statement

Former Member
0 Likes
513

hi experts,

how to import and export the internal table between programs...

Nice solutins with maximum points.....

3 REPLIES 3
Read only

Sougata
Active Contributor
0 Likes
479

Example of a program exporting an internal table to ABAP memory.

Prog 1


parameters: pa_vbeln like vbak-vbeln.
data: itab type standard table of vbak.
* get data to fill the table
select * from vbak into table itab
            where vbeln = pa_vbeln.
* now store the internal table to ABAP memory
export itab to Memory ID 'table''.

* here we call another program, prog 2
submit prog2 and return.

Prog 2 -> This imports the internal table exported by prog 1 and writes the content of the internal table to a list


data: jtab type standard table of vbak,
       wa_vbak type vbak.

* importing the itab that was exported by prog1
import itab to jtab from memory id 'table'.

loop at jtab into wa_vbak.
 write:/ wa_vbak-vbeln,
        wa_vbak-erdat.
endloop.

* clear the specific memory id after required processing is complete
free memory id 'table'

Hope this solves your problem.

Cheers,

Sougata.

Subas,

Copy/paste your code, I'll have a look. First check if data is being selected before Export command.

Edited by: Sougata Chatterjee on Jan 11, 2008 12:31 PM

Also make sure you create prog2 as an executable program. Then, run prog1 with a valid Sales Order number. To understand it more clearly run it in debugging mode and step through. It should work fine in any system.

Edited by: Sougata Chatterjee on Jan 11, 2008 12:42 PM

Read only

Former Member
0 Likes
479

i use the same code what u given above but still

no data is exporting between the programs.

Read only

Former Member
0 Likes
479

Are those Type 1 programs ? Since SUBMIT will work only for those programs.

regards,

Satya