G_SET_TREE_GENERATE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name G_SET_TREE_GENERATE into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
GSGF
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'G_SET_TREE_GENERATE' "
* EXPORTING
* client = SPACE " sy-mandt Client
* langu = SPACE " sy-langu Language of Hierarchy
* tolerate_ambiguity = SPACE " sy-datar Suppress Uniqueness Check
* create_top_node_only = SPACE " sy-datar Test Temp. Sets !!! Do Not Use !!!
TABLES
set_hierarchy = " sethier Table of Sets
set_values = " setvalues Table of Set Values
EXCEPTIONS
BAD_FORMULA = 1 " Error in a Formula
DOUBLE_FIELD = 2 " Field used Repeatedly in the Set
ENTRY_NOT_FOUND = 3 " Unknown entry
HIERARCHY_NOT_CORRECT = 4 " Incorrect Hierarchy Table
NOT_UNIQUE = 5 " Set is not unique, although required
OLD_SET_HAS_WRONG_DATA_ELEMENT = 6 " Set with same name but different set data element
OLD_SET_HAS_WRONG_TYPE = 7 " Set with same name but different type
SET_IS_RECURSIVE = 8 " Subset used contains the highest set
SETNAME_TOO_LONG = 9 " Set name is too long for a temporary set
SUBSET_HAS_WRONG_CLASS = 10 " Subset used has a Different Class
SUBSET_HAS_WRONG_DATA_ELEMENT = 11 " Subset used has a Different Set Data Element
SUBSET_HAS_WRONG_TYPE = 12 " Subset used has Incorrect Type
TEMPORARY_IN_PERMANENT_SET = 13 " Set contains temporary set
VARIABLE_DOES_NOT_EXIST = 14 " Variable used does not exist
VARIABLE_HAS_WRONG_DATA_ELEM = 15 " Variable used has a different set data element
VARIABLE_HAS_WRONG_TABLE = 16 " Set variable belongs to wrong table
VARIABLE_HAS_WRONG_TYPE = 17 " Variable used has incorrect type
WRONG_INTERVAL = 18 " Interval with From value > To Value
WRONG_SETCLASS = 19 " Incorrect set class (for M/D general sets only)
. " G_SET_TREE_GENERATE
The ABAP code below is a full code listing to execute function module G_SET_TREE_GENERATE including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).
| it_set_hierarchy | TYPE STANDARD TABLE OF SETHIER,"TABLES PARAM |
| wa_set_hierarchy | LIKE LINE OF it_set_hierarchy , |
| it_set_values | TYPE STANDARD TABLE OF SETVALUES,"TABLES PARAM |
| wa_set_values | LIKE LINE OF it_set_values . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_client | TYPE SY-MANDT , |
| it_set_hierarchy | TYPE STANDARD TABLE OF SETHIER , |
| wa_set_hierarchy | LIKE LINE OF it_set_hierarchy, |
| ld_langu | TYPE SY-LANGU , |
| it_set_values | TYPE STANDARD TABLE OF SETVALUES , |
| wa_set_values | LIKE LINE OF it_set_values, |
| ld_tolerate_ambiguity | TYPE SY-DATAR , |
| ld_create_top_node_only | TYPE SY-DATAR . |
This function module creates or changes the sets in the hierarchy
structure transferred with the tables 'SET_HIERARCHY' and 'SETVALUES'.
...See here for full SAP fm documentation
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name G_SET_TREE_GENERATE or its description.