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.