SAP BM_STRUCTURE_CREATE Function Module for Create a Structure









BM_STRUCTURE_CREATE is a standard bm structure create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create a 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 create FM, simply by entering the name BM_STRUCTURE_CREATE into the relevant SAP transaction such as SE37 or SE38.

Function Group: SF05
Program Name: SAPLSF05
Main Program: SAPLSF05
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function BM_STRUCTURE_CREATE 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_CREATE'"Create a Structure
EXPORTING
STRUCTURE_TYPE = "Structure type
* STRUCTURE_TEXT = ' ' "Explanatory text
* TOPNODE_TYPE = ' ' "Valid Node Types in Structure Repository
* LANGUAGE = SY-LANGU "
* PARENT_ID = ' ' "GUID for Structure

IMPORTING
STRUCT_HEADER = "
STRUCT_TEXT = "Explanatory text
MESSAGE = "

CHANGING
* DEVCLASS = ' ' "Package
* TRANSPORT_ORDER = ' ' "Request/Task

TABLES
* USER_PARAMETERS = "

EXCEPTIONS
CANCELLED = 1
.



IMPORTING Parameters details for BM_STRUCTURE_CREATE

STRUCTURE_TYPE - Structure type

Data type: TTREE-TYPE
Optional: No
Call by Reference: No ( called with pass by value option)

STRUCTURE_TEXT - Explanatory text

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TOPNODE_TYPE - Valid Node Types in Structure Repository

Data type: HIER_IFACE-NODE_TYPE
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LANGUAGE -

Data type: SY-LANGU
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

PARENT_ID - GUID for Structure

Data type: TTREE-ID
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BM_STRUCTURE_CREATE

STRUCT_HEADER -

Data type: TTREE
Optional: No
Call by Reference: Yes

STRUCT_TEXT - Explanatory text

Data type: TTREET-TEXT
Optional: No
Call by Reference: Yes

MESSAGE -

Data type: HIER_MESS
Optional: No
Call by Reference: Yes

CHANGING Parameters details for BM_STRUCTURE_CREATE

DEVCLASS - Package

Data type: DEVCLASS
Default: SPACE
Optional: Yes
Call by Reference: Yes

TRANSPORT_ORDER - Request/Task

Data type: TRKORR
Default: SPACE
Optional: Yes
Call by Reference: Yes

TABLES Parameters details for BM_STRUCTURE_CREATE

USER_PARAMETERS -

Data type: STREEPROP
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

CANCELLED -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for BM_STRUCTURE_CREATE 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_devclass  TYPE DEVCLASS, "   SPACE
lv_cancelled  TYPE DEVCLASS, "   
lv_struct_header  TYPE TTREE, "   
lv_structure_type  TYPE TTREE-TYPE, "   
lt_user_parameters  TYPE STANDARD TABLE OF STREEPROP, "   
lv_struct_text  TYPE TTREET-TEXT, "   
lv_structure_text  TYPE C, "   SPACE
lv_transport_order  TYPE TRKORR, "   SPACE
lv_message  TYPE HIER_MESS, "   
lv_topnode_type  TYPE HIER_IFACE-NODE_TYPE, "   SPACE
lv_language  TYPE SY-LANGU, "   SY-LANGU
lv_parent_id  TYPE TTREE-ID. "   SPACE

  CALL FUNCTION 'BM_STRUCTURE_CREATE'  "Create a Structure
    EXPORTING
         STRUCTURE_TYPE = lv_structure_type
         STRUCTURE_TEXT = lv_structure_text
         TOPNODE_TYPE = lv_topnode_type
         LANGUAGE = lv_language
         PARENT_ID = lv_parent_id
    IMPORTING
         STRUCT_HEADER = lv_struct_header
         STRUCT_TEXT = lv_struct_text
         MESSAGE = lv_message
    CHANGING
         DEVCLASS = lv_devclass
         TRANSPORT_ORDER = lv_transport_order
    TABLES
         USER_PARAMETERS = lt_user_parameters
    EXCEPTIONS
        CANCELLED = 1
. " BM_STRUCTURE_CREATE




ABAP code using 7.40 inline data declarations to call FM BM_STRUCTURE_CREATE

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.

DATA(ld_devclass) = ' '.
 
 
 
"SELECT single TYPE FROM TTREE INTO @DATA(ld_structure_type).
 
 
"SELECT single TEXT FROM TTREET INTO @DATA(ld_struct_text).
 
DATA(ld_structure_text) = ' '.
 
DATA(ld_transport_order) = ' '.
 
 
"SELECT single NODE_TYPE FROM HIER_IFACE INTO @DATA(ld_topnode_type).
DATA(ld_topnode_type) = ' '.
 
"SELECT single LANGU FROM SY INTO @DATA(ld_language).
DATA(ld_language) = SY-LANGU.
 
"SELECT single ID FROM TTREE INTO @DATA(ld_parent_id).
DATA(ld_parent_id) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!