Hello Justice,
As Florian said it would be best to use the calculation view to implement your logic. Hence I don't know what exactly your requirement just thought of sharing your code in HANA structure. Can you have a look and try expanding ?
CREATE PROCEDURE 'your schema name'.STAFF_RPORT (IN Prjcode1 DATE, IN prjcode2 DATE)
DEFAULT SCHEMA 'your schema name'
AS
tab_exists smallint := 0;
BEGIN
SELECT COUNT(1) INTO tab_exists
FROM TABLES
WHERE SCHEMA_NAME = 'your schema name' AND TABLE_NAME = 'test_table';
IF :tab_exists > 0 THEN
EXEC 'DROP TABLE ' || 'your schema name' || '.' || '"test_table"' ;
END IF;
--- add your create table logic
-- for taking the output as a table you can create a table type and assign the result into it
END;