Hi Trond,
I had a similar problem when I was trying to declare my local table in the first line of the prodedure; the create procedure;
CREATE PROCEDURE myProcedure (OUT ONTIME tt_mytable)
I would get error that SYSTEM.tt_mytable does not exist.
The solution was that I had to setup my table in the LOCAL TABLE TYPES tab of the procedure like this;
CREATE type tt_mytable as table (
PO nvarchar(10),
POLINE nvarchar(2),
MYDATE nvarchar(8),
MYFLAG nvarchar(1))
Then in the body of my main procedure I set the value of ONTIME output variable like this;
ONTIME = select PO, POLINE, DATECONF, MYDATE, MYFLAG from "#MYTEMPTABLE"
Not sure if this is the same exact problem you are facing but it does sound similar so figured I would reply. Hope it helps.
-Patrick