TABLES: SFLIGHT.标签:flight,carrid,ZHOU,type,sflight,indx,实例,内存,数据 From: https://blog.51cto.com/u_15903986/5916067
types: begin of ty_sflight,
carrid type sflight-carrid,
connid type sflight-connid,
fldate type sflight-fldate,
planetype type sflight-planetype,
seatsmax type sflight-seatsmax,
seatsocc type sflight-seatsocc,
end of ty_sflight.
data: i_flight type standard table of ty_sflight,
wa_flight like line of i_flight.
data: g_flight type standard table of ty_sflight with header line.
start-of-selection.
select carrid connid fldate planetype seatsmax seatsocc
from sflight
into table i_flight.
IF sy-subrc <> 0.
write: 'There were no fields found in sflight.'.
exit.
ENDIF.
*EXPORT i_flight TO DATABASE indx(bb) ID 'G.ZHOU'.
*import i_flight to g_flight from database indx(bb) id 'G.ZHOU'.
*delete from database indx(AA) ID 'G.ZHOU'.
*delete from database indx(BB) ID 'G.ZHOU'.
*delete from database indx(YY) ID 'G.ZHOU'.
export i_flight to memory id 'G.ZHOU'.
import i_flight to g_flight from memory id 'G.ZHOU'.
free memory id 'G.ZHOU'.
IF sy-subrc <> 0.
message e001(operation_failed) with text-001.
stop.
ENDIF.
LOOP AT g_flight.
write: / g_flight-carrid.
ENDLOOP.
end-of-selection.