关于for all entries in性能方面的解释网络上已经很多了,我只说一个在实际工作中遇到的问题。
IF NOT Z_VBELN[] IS INITIAL.
SELECT * INTO CORRESPONDING FIELDS OF TABLE ITLIKP FROM LIKP
WHERE VBELN IN Z_VBELN.
ENDIF.
Z_VBELN为一个RANGE。
Z_VBELN的条目数为2100条,运行程序时,报dump错误,通过ST22错误分析:
The SAP Open SQL statement concerned must be divided into several smaller units.
If the problem occurred due to the use of an excessively large table in an IN itab construct, you can use FOR ALL ENTRIES instead.
When you use this addition, the statement is split into smaller units according to the restrictions of the database system used.
根据此提示改为:
IF NOT Z_VBELN[] IS INITIAL.
SELECT * INTO CORRESPONDING FIELDS OF TABLE ITLIKP FROM LIKP
FOR ALL ENTRIES IN Z_VBELN
WHERE VBELN = Z_VBELN-LOW.
ENDIF.
15000行没有问题。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9859323/viewspace-617064/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9859323/viewspace-617064/