Note
The SELECT COUNT( * ) FROM ... statement returns a result table containing a single line with the result 0 if there are no records in the database table that meet the selection criteria. In an exception to the above rule, SY-SUBRC is set to 4 in this case, and SY-DBCNT to zero.
eg:
SELECT COUNT( * ) INTO LV_COUNT FROM ZIEBL
WHERE YBLDOC IN R_YBLDOC AND YBLNO IN R_YBLNO.
本文介绍ABAP中SELECT COUNT(*)语句的使用方法,当没有符合选择条件的记录时,该语句将返回结果0,并设置SY-SUBRC为4及SY-DBCNT为0。示例代码展示了如何在指定条件下计数数据库表中的记录。

被折叠的 条评论
为什么被折叠?



