我正在比较
SELECT FOR ALL ENTRIES
和LOOP SELECT SINGLE
两者之间的区别,结果有很大的差异。请问有人可以帮我吗?这两种方式有何不同?SELECT ekko~ebeln
ekpo~ebelp
ekko~bstyp
ekko~bsart
ekko~lifnr
ekko~ekgrp
ekko~aedat
ekko~knumv
ekko~zterm
ekko~zbd1t
ekpo~matnr
ekpo~txz01
ekpo~menge
ekpo~meins
ekpo~netpr
ekpo~peinh
ekpo~knttp
ekpo~afnam
ekpo~wepos
INTO TABLE t_ekpo
FROM ekko
INNER JOIN ekpo ON
ekpo~ebeln EQ ekko~ebeln
WHERE ekko~lifnr IN s_lifnr
AND ekko~ekgrp IN s_ekgrp
AND ekko~ebeln IN s_ebeln
AND ekko~aedat IN s_aedat
AND ekko~bsart IN s_bsart
AND ekko~bstyp EQ 'F'
AND ekko~loekz EQ space
AND ekpo~matnr IN s_matnr
AND ekpo~ebelp IN s_ebelp
AND ekpo~loekz EQ space.
SELECT FOR ALL ENTRIES
返回 9,528 条记录
SELECT ebeln
ebelp
zekkn
vgabe
gjahr
belnr
buzei
budat
menge
shkzg
FROM ekbe
INTO TABLE t_ekbe
FOR ALL ENTRIES IN t_ekpo
WHERE ebeln EQ t_ekpo-ebeln
AND ebelp EQ t_ekpo-ebelp
AND vgabe IN ('1','2').
LOOP SELECT SINGLE
返回7,336条记录
LOOP AT t_ekpo INTO gs_ekpo.
CLEAR gs_ekbe.
SELECT SINGLE ebeln
ebelp
zekkn
vgabe
gjahr
belnr
buzei
budat
menge
shkzg
FROM ekbe
INTO gs_ekbe
WHERE ebeln EQ gs_ekpo-ebeln
AND ebelp EQ gs_ekpo-ebelp
AND vgabe IN ('1','2').
APPEND gs_ekbe TO T_ekbe.
ENDLOOP.