Temp-Table Fieldname

boutl

New Member
Hello,

I would like to get the Fieldnames from a temptable.
How can I get the names from the temp-table.
Can anyone help me.

Best regards
Christian
 
DEFINE TEMP-TABLE ttMyTable NO-UNDO
FIElD Field1 AS CHARACTER
FIELD Field2 AS CHARACTER
FIELD Field3 AS CHARACTER.

DEFINE VARIABLE iField AS INTEGER NO-UNDO.

DEFINE VARIABLE hTT AS HANDLE NO-UNDO.
DEFINE VARIABLE hField AS HANDLE NO-UNDO.

hTT = TEMP-TABLE ttMytable:DEFAULT-BUFFER-HANDLE.

DO iField = 1 TO hTT:NUM-FIELDS:
hField = hTT:BUFFER-FIELD(iField).
MESSAGE hField:NAME view-as alert-box.
END.

Enjoy,
Gordon
 
Now I have a another problem.
I want to use the following code:

cdummy = "tmpBelege." + hField:NAME.
RUN addArrayText (INPUT cdummy, INPUT-OUTPUT iCounter).

Now contains cdummy e.g. tmpBelege.Satzart.
But in the RUN addArrayText i need cdummy as referenze to a temptablefield.

How can i solve this problem, now cdummy is a string, but i need a referenze to a temp-table.

best regards
christian
 
I don't get what you are saying? But if you are looking to get the value of a field from the temp-table then just use the hField:BUFFER-VALUE to obtain the data stored within the field.
 
Now I have another Problem. This solution works under Progress 9.1D, but under 8.1a it doesn't.
Can anyone help me, that that solution works under Progress 8.1a.

The error message is:

** Nach "hTT = TEMP-TABLE" unverständlich. (247)
** Kann Zeile 380 nicht verstehen. (198)
Unbekanntes Attribut NUM-FIELDS in Widget:Attribute-Phrase benutzt. (3406)
** Kann Zeile 381 nicht verstehen. (196)

The same code works under 9.1D correctly

Best regards.
Christian
 
Back
Top