我希望使用下面的语句来显示每个文档的最大版本号,但是,DOKVR的值是空白的。有人可以帮忙吗?
SELECT DOKNR MAX( DOKVR ) FROM DRAT
WHERE DOKNR IN S_DOKNR
AND DOKAR IN S_DOKAR.
WRITE:/ DOKNR, 'H', DOKVR.
ENDSELECT.
答案 0 :(得分:0)
您需要指定数据进入的变量。我相信以下代码会输出您正在寻找的内容:
DATA: doknr TYPE doknr,
dokvr TYPE dokvr.
SELECT dokar MAX( dokvr ) FROM drat
INTO (doknr, dokvr)
GROUP BY dokar.
WRITE:/ doknr,'H', dokvr.
ENDSELECT.
输出:
PTE H 21
ITS H 09
CMR H 04
L01 H 00
GRI H 00
CUM H 00
FHD H 00
RMS H 03
SCE H 03
SLD H 02
RE H 00
GRA H 00
(and so on)