内存数据簇和数据库数据簇使用实例

 TABLES: SFLIGHT.
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.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值