Create method: Tree Structure class
Syntax
Create(StructId, Type)
Description
The Create method creates a tree structure with the name StructId, and of the type Type. Both parameters take a string value.
Note:
If the tree structure already exists, it is overwritten with the newly created tree structure.
The Create method can be used only with a closed tree structure, it cannot be used on an open tree structure. Before you use the Create method, you must explicitly close any open tree structure objects (with the Close method.) You receive an error if there are any open tree structures.
The new tree structure must be saved (using the Save method) for this structure to be saved to the database.
After you create a new tree structure, you can open it with the Open method.
The values for Type are:
-
"D": create a detail tree structure.
-
"S": create a summary tree structure.
Currently, only the value of "D" is supported for the Type parameter. You can specify an empty string for Type. If you need to create a summary structure follow the example below:
&MYSTRUCT=&SESSION.GETSTRUCTURE();
IF ALL( &MYSTRUCT) THEN
&RETVALUE=&MYSTRUCT.CREATE('DEPARTMENT_SUM',' ');
IF NONE(&RETVALUE) THEN
&MYSTRUCT.TYPE = 'S';
END-IF;
&RETVALUE=&MYSTRUCT.SAVE();
&RETVALUE=&MYSTRUCT.CLOSE();
END-IF;