SAP BM_STRUCTURE_MAINTAIN Function Module for Maintain structure
BM_STRUCTURE_MAINTAIN is a standard bm structure maintain SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Maintain structure processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for bm structure maintain FM, simply by entering the name BM_STRUCTURE_MAINTAIN into the relevant SAP transaction such as SE37 or SE38.
Function Group: SF01
Program Name: SAPLSF01
Main Program: SAPLSF01
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function BM_STRUCTURE_MAINTAIN pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'BM_STRUCTURE_MAINTAIN'"Maintain structure.
EXPORTING
* I_STRUCTURE_ID = "Object key
* I_INITIAL_SCREEN = ' ' "
* I_SCREEN = ' ' "
* I_POPUP = ' ' "
* I_STARTING_AT_X = 2 "
* I_STARTING_AT_Y = 2 "
* I_ACTIVE_TAB = "
* I_POSITION_ON_NODE = ' ' "Node ID
* I_MSG_SEND = '0' "
* I_CICO_DIALOG = 'X' "
* I_CICO_REQNO = "Transfer Order Number
* I_PARENT_STRUCT_ID = "
* _DELETION_CHECK = 'X' "(internal)
* I_STRUCTURE_TYPE = "
* I_TOPNODE_TYPE = ' ' "Valid Node Types in Structure Repository
* I_OCCNODE = "Information on Occurrence
* I_DEVCLASS = "Development Class
* I_LANGUAGE = SY-LANGU "Language
* I_MODE = 'SHOW' "
* I_EXTENSION = ' ' "Structure enhancement ID
IMPORTING
E_EXIT = "
E_CANCELLED = "
E_CICO_REQNO = "Request/Task
CHANGING
* R_STREE = "Structure overview
TABLES
* T_FIELDCAT = "
* T_FCODE_EXCL = "
* T_USER_PARAMS_TO_STACK = "Hierarchy Maintenance Display Attribute
EXCEPTIONS
ERROR_OCCURRED = 1
IMPORTING Parameters details for BM_STRUCTURE_MAINTAIN
I_STRUCTURE_ID - Object key
Data type: BMSTREE-IDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_INITIAL_SCREEN -
Data type: BMT_FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SCREEN -
Data type: BMT_FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_POPUP -
Data type: BMT_FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_STARTING_AT_X -
Data type: IDefault: 2
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_STARTING_AT_Y -
Data type: IDefault: 2
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ACTIVE_TAB -
Data type: CXTAB_TABSTRIP-ACTIVETABOptional: Yes
Call by Reference: No ( called with pass by value option)
I_POSITION_ON_NODE - Node ID
Data type: HIER_IFACE-NODE_IDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSG_SEND -
Data type: CDefault: '0'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CICO_DIALOG -
Data type: BMT_FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CICO_REQNO - Transfer Order Number
Data type: RPYGSGF-CICO_REQNOOptional: Yes
Call by Reference: No ( called with pass by value option)
I_PARENT_STRUCT_ID -
Data type: BMSTREE-IDOptional: Yes
Call by Reference: No ( called with pass by value option)
_DELETION_CHECK - (internal)
Data type: BMT_FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_STRUCTURE_TYPE -
Data type: BMSTREE-TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TOPNODE_TYPE - Valid Node Types in Structure Repository
Data type: BMSTREE-TOPNODETYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_OCCNODE - Information on Occurrence
Data type: BMOCCNODEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_DEVCLASS - Development Class
Data type: DEVCLASSOptional: Yes
Call by Reference: No ( called with pass by value option)
I_LANGUAGE - Language
Data type: SY-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MODE -
Data type: RPYGSGF-MODEDefault: 'SHOW'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_EXTENSION - Structure enhancement ID
Data type: HIER_IFACE-EXTENSIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BM_STRUCTURE_MAINTAIN
E_EXIT -
Data type: BMT_FLAGOptional: No
Call by Reference: No ( called with pass by value option)
E_CANCELLED -
Data type: BMT_FLAGOptional: No
Call by Reference: No ( called with pass by value option)
E_CICO_REQNO - Request/Task
Data type: TRKORROptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for BM_STRUCTURE_MAINTAIN
R_STREE - Structure overview
Data type: BMSTREEOptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BM_STRUCTURE_MAINTAIN
T_FIELDCAT -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
T_FCODE_EXCL -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
T_USER_PARAMS_TO_STACK - Hierarchy Maintenance Display Attribute
Data type: STREEPROPOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
ERROR_OCCURRED - Errors occurred
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BM_STRUCTURE_MAINTAIN Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_e_exit | TYPE BMT_FLAG, " | |||
| lv_r_stree | TYPE BMSTREE, " | |||
| lt_t_fieldcat | TYPE STANDARD TABLE OF BMSTREE, " | |||
| lv_error_occurred | TYPE BMSTREE, " | |||
| lv_i_structure_id | TYPE BMSTREE-ID, " | |||
| lv_i_initial_screen | TYPE BMT_FLAG, " SPACE | |||
| lv_i_screen | TYPE BMT_FLAG, " SPACE | |||
| lv_i_popup | TYPE BMT_FLAG, " SPACE | |||
| lv_i_starting_at_x | TYPE I, " 2 | |||
| lv_i_starting_at_y | TYPE I, " 2 | |||
| lv_i_active_tab | TYPE CXTAB_TABSTRIP-ACTIVETAB, " | |||
| lv_i_position_on_node | TYPE HIER_IFACE-NODE_ID, " SPACE | |||
| lv_i_msg_send | TYPE C, " '0' | |||
| lv_i_cico_dialog | TYPE BMT_FLAG, " 'X' | |||
| lv_i_cico_reqno | TYPE RPYGSGF-CICO_REQNO, " | |||
| lv_e_cancelled | TYPE BMT_FLAG, " | |||
| lt_t_fcode_excl | TYPE STANDARD TABLE OF BMT_FLAG, " | |||
| lv_i_parent_struct_id | TYPE BMSTREE-ID, " | |||
| lv__deletion_check | TYPE BMT_FLAG, " 'X' | |||
| lv_e_cico_reqno | TYPE TRKORR, " | |||
| lv_i_structure_type | TYPE BMSTREE-TYPE, " | |||
| lt_t_user_params_to_stack | TYPE STANDARD TABLE OF STREEPROP, " | |||
| lv_i_topnode_type | TYPE BMSTREE-TOPNODETYP, " SPACE | |||
| lv_i_occnode | TYPE BMOCCNODE, " | |||
| lv_i_devclass | TYPE DEVCLASS, " | |||
| lv_i_language | TYPE SY-LANGU, " SY-LANGU | |||
| lv_i_mode | TYPE RPYGSGF-MODE, " 'SHOW' | |||
| lv_i_extension | TYPE HIER_IFACE-EXTENSION. " SPACE |
|   CALL FUNCTION 'BM_STRUCTURE_MAINTAIN' "Maintain structure |
| EXPORTING | ||
| I_STRUCTURE_ID | = lv_i_structure_id | |
| I_INITIAL_SCREEN | = lv_i_initial_screen | |
| I_SCREEN | = lv_i_screen | |
| I_POPUP | = lv_i_popup | |
| I_STARTING_AT_X | = lv_i_starting_at_x | |
| I_STARTING_AT_Y | = lv_i_starting_at_y | |
| I_ACTIVE_TAB | = lv_i_active_tab | |
| I_POSITION_ON_NODE | = lv_i_position_on_node | |
| I_MSG_SEND | = lv_i_msg_send | |
| I_CICO_DIALOG | = lv_i_cico_dialog | |
| I_CICO_REQNO | = lv_i_cico_reqno | |
| I_PARENT_STRUCT_ID | = lv_i_parent_struct_id | |
| _DELETION_CHECK | = lv__deletion_check | |
| I_STRUCTURE_TYPE | = lv_i_structure_type | |
| I_TOPNODE_TYPE | = lv_i_topnode_type | |
| I_OCCNODE | = lv_i_occnode | |
| I_DEVCLASS | = lv_i_devclass | |
| I_LANGUAGE | = lv_i_language | |
| I_MODE | = lv_i_mode | |
| I_EXTENSION | = lv_i_extension | |
| IMPORTING | ||
| E_EXIT | = lv_e_exit | |
| E_CANCELLED | = lv_e_cancelled | |
| E_CICO_REQNO | = lv_e_cico_reqno | |
| CHANGING | ||
| R_STREE | = lv_r_stree | |
| TABLES | ||
| T_FIELDCAT | = lt_t_fieldcat | |
| T_FCODE_EXCL | = lt_t_fcode_excl | |
| T_USER_PARAMS_TO_STACK | = lt_t_user_params_to_stack | |
| EXCEPTIONS | ||
| ERROR_OCCURRED = 1 | ||
| . " BM_STRUCTURE_MAINTAIN | ||
ABAP code using 7.40 inline data declarations to call FM BM_STRUCTURE_MAINTAIN
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single ID FROM BMSTREE INTO @DATA(ld_i_structure_id). | ||||
| DATA(ld_i_initial_screen) | = ' '. | |||
| DATA(ld_i_screen) | = ' '. | |||
| DATA(ld_i_popup) | = ' '. | |||
| DATA(ld_i_starting_at_x) | = 2. | |||
| DATA(ld_i_starting_at_y) | = 2. | |||
| "SELECT single ACTIVETAB FROM CXTAB_TABSTRIP INTO @DATA(ld_i_active_tab). | ||||
| "SELECT single NODE_ID FROM HIER_IFACE INTO @DATA(ld_i_position_on_node). | ||||
| DATA(ld_i_position_on_node) | = ' '. | |||
| DATA(ld_i_msg_send) | = '0'. | |||
| DATA(ld_i_cico_dialog) | = 'X'. | |||
| "SELECT single CICO_REQNO FROM RPYGSGF INTO @DATA(ld_i_cico_reqno). | ||||
| "SELECT single ID FROM BMSTREE INTO @DATA(ld_i_parent_struct_id). | ||||
| DATA(ld__deletion_check) | = 'X'. | |||
| "SELECT single TYPE FROM BMSTREE INTO @DATA(ld_i_structure_type). | ||||
| "SELECT single TOPNODETYP FROM BMSTREE INTO @DATA(ld_i_topnode_type). | ||||
| DATA(ld_i_topnode_type) | = ' '. | |||
| "SELECT single LANGU FROM SY INTO @DATA(ld_i_language). | ||||
| DATA(ld_i_language) | = SY-LANGU. | |||
| "SELECT single MODE FROM RPYGSGF INTO @DATA(ld_i_mode). | ||||
| DATA(ld_i_mode) | = 'SHOW'. | |||
| "SELECT single EXTENSION FROM HIER_IFACE INTO @DATA(ld_i_extension). | ||||
| DATA(ld_i_extension) | = ' '. | |||
Search for further information about these or an SAP related objects