The programmers has many curious ways to verify if a temp-table has rows, but the most efficient way is using HAS-RECORDS attribute.

Example
In this example, only the temp-table ttMyOne has rows… the ttMyTwo hasn’t.

Code
DEFINE TEMP-TABLE ttMyOne NO-UNDO
FIELD cName   AS CHARACTER
FIELD cAdress AS CHARACTER.

DEFINE TEMP-TABLE ttMyTwo NO-UNDO
FIELD cName   AS CHARACTER
FIELD cAdress AS CHARACTER.

CREATE ttMyOne.
ASSIGN ttMyOne.cName   = ‘sl4v3r’
ttMyOne.cAdress = ‘my adress’.

IF TEMP-TABLE ttMyOne:HAS-RECORDS THEN
MESSAGE “Yes, ttMyOne has rows.” VIEW-AS ALERT-BOX.
ELSE
MESSAGE “No, ttMyOne hasn’t rows.” VIEW-AS ALERT-BOX.

IF TEMP-TABLE ttMyTwo:HAS-RECORDS THEN
MESSAGE “Yes, ttMyTwo has rows.” VIEW-AS ALERT-BOX.
ELSE
MESSAGE “No, ttMyTwo hasn’t rows.” VIEW-AS ALERT-BOX.

cya…😀