一、利用内表缓冲减少数据库访问次数
REPORT zmmi003.
data: it_vbap type table of vbap,
wa_vbap type vbap,
it_makt type table of makt,
wa_makt type makt.
perform process.
perform process_using_cursor.
*&---------------------------------------------------------------------*
*& Form process
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM process .
DATA: t1 TYPE i,
t2 TYPE i,
tmin TYPE i.
get run time field t1.
select * into wa_vbap
up to 10000 rows
from vbap .
select single * into wa_makt
from makt
where matnr = wa_vbap-matnr.
* write:/ wa_makt-MAKTX.
endselect.
get run time field t2.
tmin = t2 - t1.
write:/ '------------------------------------------------------------------'.
wri