Skip to Content
0
Oct 04, 2009 at 10:46 PM

EXPORT / IMPORT

17 Views

Hi all,

I'm working with import and export. I have to export to memory ID one variable and one internal table, i wrote this:

REPORT z_abap_memoria_export.

TYPES: BEGIN OF ty_vuelos.

INCLUDE STRUCTURE ztabla_vuelos.

TYPES: END OF ty_vuelos.

DATA: v_pais(3) TYPE c VALUE 'BR'.

DATA: v_tabla(9) TYPE c VALUE 'ti_vuelos'.

DATA: ti_vuelos TYPE STANDARD TABLE OF ty_vuelos.

SELECT *

INTO CORRESPONDING FIELDS OF TABLE ti_vuelos

FROM ztabla_vuelos.

EXPORT v_pais ti_vuelos TO MEMORY ID 'Z_MEMORIA2'.

IF sy-subrc EQ 0.

WRITE:/10 'Memoria exportada'.

ELSE.

WRITE:/(10) 'Memoria NO exportada'.

ENDIF.

Then, I wanted to IMPORT those valus, but I couldn't. Can someone explain to me what can be wrong here?

REPORT z_abap_memoria_import.

TYPES: BEGIN OF ty_vuelos.

INCLUDE STRUCTURE ztabla_vuelos.

TYPES: END OF ty_vuelos.

DATA: ti_vuelos TYPE STANDARD TABLE OF ty_vuelos.

DATA: st_vuelos TYPE ty_vuelos.

DATA: v_pais(3) TYPE c.

IMPORT v_pais ti_vuelos FROM MEMORY ID 'Z_MEMORIA2'.

IF sy-subrc EQ 0.

WRITE:/ v_pais.

LOOP AT ti_vuelos INTO st_vuelos.

WRITE st_vuelos.

ENDLOOP.

ELSE.

WRITE:/ 'no se pudo'.

ENDIF.

Thanks!

Gaby