Once you have invoked all the methods that you need to fully define the temp-table fields and indexes, you must use the TEMP-TABLE-PREPARE() method to finalize the definition before you use the temp-table. You must pass an argument to the method that gives the temp-table a name, as in this example:
DEFINE VARIABLE hTT AS HANDLE NO-UNDO.
CREATE TEMP-TABLE hTT.
hTT:CREATE-LIKE("Customer","Name").
hTT:ADD-FIELDS-FROM("SalesRep","MonthQuota").
hTT:ADD-LIKE-FIELD("Area", "SalesRep.Region").
hTT:ADD-NEW-FIELD("Sequence", "INTEGER",0,"9999",1000).
hTT:ADD-LIKE-INDEX("CustNum","CustNum","Customer").
hTT:ADD-NEW-INDEX("SeqIndex", YES).
hTT:ADD-INDEX-FIELD("SeqIndex", "Sequence").
hTT:TEMP-TABLE-PREPARE("CustSequence").

Once you have invoked this method, the temp-table is in the prepared state. You can now begin to use it, creating and deleting records in the temp-table, opening queries on the table, and so forth. You cannot use the temp-table in any way until you prepare it. After you use the TEMP-TABLE-PREPARE() method, you cannot invoke any of the other methods to change its definition except the CLEAR method discussed next.