SAP Function Modules

BM_BAC_STRUCTURE_CREATE SAP Function module







BM_BAC_STRUCTURE_CREATE 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 BM_BAC_STRUCTURE_CREATE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SBM_BAC01
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM BM_BAC_STRUCTURE_CREATE - BM BAC STRUCTURE CREATE





CALL FUNCTION 'BM_BAC_STRUCTURE_CREATE' "
  EXPORTING
    i_struct_text =             " c             Structure name
*   i_object_id =               " bmobject-id   Object ID
*   i_language = SY-LANGU       " sy-langu      SAP R/3 System, Current Language
  IMPORTING
    e_structure =               " ttree         Definition Table for Structures
    e_struct_text =             " ttreet-text   Explanatory text
* TABLES
*   struct_nodes =              " hier_iface
*   struct_refs =               " hier_ref
*   struct_texts =              " hier_texts
  EXCEPTIONS
    NO_AUTHORITY = 1            "
    ERROR_OCCURRED = 2          "
    .  "  BM_BAC_STRUCTURE_CREATE

ABAP code example for Function Module BM_BAC_STRUCTURE_CREATE





The ABAP code below is a full code listing to execute function module BM_BAC_STRUCTURE_CREATE 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).

DATA:
ld_e_structure  TYPE TTREE ,
ld_e_struct_text  TYPE TTREET-TEXT ,
it_struct_nodes  TYPE STANDARD TABLE OF HIER_IFACE,"TABLES PARAM
wa_struct_nodes  LIKE LINE OF it_struct_nodes ,
it_struct_refs  TYPE STANDARD TABLE OF HIER_REF,"TABLES PARAM
wa_struct_refs  LIKE LINE OF it_struct_refs ,
it_struct_texts  TYPE STANDARD TABLE OF HIER_TEXTS,"TABLES PARAM
wa_struct_texts  LIKE LINE OF it_struct_texts .

DATA(ld_i_struct_text) = 'Check type of data required'.

DATA(ld_i_object_id) = some text here
DATA(ld_i_language) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_struct_nodes to it_struct_nodes.

"populate fields of struture and append to itab
append wa_struct_refs to it_struct_refs.

"populate fields of struture and append to itab
append wa_struct_texts to it_struct_texts. . CALL FUNCTION 'BM_BAC_STRUCTURE_CREATE' EXPORTING i_struct_text = ld_i_struct_text * i_object_id = ld_i_object_id * i_language = ld_i_language IMPORTING e_structure = ld_e_structure e_struct_text = ld_e_struct_text * TABLES * struct_nodes = it_struct_nodes * struct_refs = it_struct_refs * struct_texts = it_struct_texts EXCEPTIONS NO_AUTHORITY = 1 ERROR_OCCURRED = 2 . " BM_BAC_STRUCTURE_CREATE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

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_e_structure  TYPE TTREE ,
ld_i_struct_text  TYPE C ,
it_struct_nodes  TYPE STANDARD TABLE OF HIER_IFACE ,
wa_struct_nodes  LIKE LINE OF it_struct_nodes,
ld_e_struct_text  TYPE TTREET-TEXT ,
ld_i_object_id  TYPE BMOBJECT-ID ,
it_struct_refs  TYPE STANDARD TABLE OF HIER_REF ,
wa_struct_refs  LIKE LINE OF it_struct_refs,
ld_i_language  TYPE SY-LANGU ,
it_struct_texts  TYPE STANDARD TABLE OF HIER_TEXTS ,
wa_struct_texts  LIKE LINE OF it_struct_texts.

ld_i_struct_text = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_struct_nodes to it_struct_nodes.

ld_i_object_id = some text here

"populate fields of struture and append to itab
append wa_struct_refs to it_struct_refs.
ld_i_language = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_struct_texts to it_struct_texts.

Contribute (Add Comments)

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 BM_BAC_STRUCTURE_CREATE or its description.