SAP Function Modules

META_CREATE_ASSET SAP Function module - meta bapi used to create an asset at the core-side







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

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


Pattern for FM META_CREATE_ASSET - META CREATE ASSET





CALL FUNCTION 'META_CREATE_ASSET' "meta bapi used to create an asset at the core-side
  EXPORTING
    asset_class =               " char8         class of asset to be created
    comp_code =                 " bukrs         company code
    quantity =                  " bapiebkn-preq_qty  number of items (--> no. of assets)
*   txt50 =                     " char50        description (char 50, optional)
*   logical_system =            " bbp_backend_dest-log_sys
*   acc_record =                " bbp_pds_acc   Kontierung
  TABLES
    asset_tab =                 " bbp_acr_co
    return =                    " bapiret2
*   control_record =            " bbp_control_record
  EXCEPTIONS
    ASSET_NOT_CREATED = 1       "               func. module returned no asset
    ASSET_CLASS_NOT_VALID = 2   "               wrong asset class specified
    COMPANY_CODE_NOT_VALID = 3  "               wrong company code specified
    CREATE_ERROR = 4            "               func. module returned 'message id type e'
    .  "  META_CREATE_ASSET

ABAP code example for Function Module META_CREATE_ASSET





The ABAP code below is a full code listing to execute function module META_CREATE_ASSET 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:
it_asset_tab  TYPE STANDARD TABLE OF BBP_ACR_CO,"TABLES PARAM
wa_asset_tab  LIKE LINE OF it_asset_tab ,
it_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return ,
it_control_record  TYPE STANDARD TABLE OF BBP_CONTROL_RECORD,"TABLES PARAM
wa_control_record  LIKE LINE OF it_control_record .

DATA(ld_asset_class) = 'Check type of data required'.
DATA(ld_comp_code) = 'Check type of data required'.

DATA(ld_quantity) = Check type of data required
DATA(ld_txt50) = 'Check type of data required'.

SELECT single LOG_SYS
FROM BBP_BACKEND_DEST
INTO @DATA(ld_logical_system).

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

"populate fields of struture and append to itab
append wa_asset_tab to it_asset_tab.

"populate fields of struture and append to itab
append wa_return to it_return.

"populate fields of struture and append to itab
append wa_control_record to it_control_record. . CALL FUNCTION 'META_CREATE_ASSET' EXPORTING asset_class = ld_asset_class comp_code = ld_comp_code quantity = ld_quantity * txt50 = ld_txt50 * logical_system = ld_logical_system * acc_record = ld_acc_record TABLES asset_tab = it_asset_tab return = it_return * control_record = it_control_record EXCEPTIONS ASSET_NOT_CREATED = 1 ASSET_CLASS_NOT_VALID = 2 COMPANY_CODE_NOT_VALID = 3 CREATE_ERROR = 4 . " META_CREATE_ASSET
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 ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "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_asset_class  TYPE CHAR8 ,
it_asset_tab  TYPE STANDARD TABLE OF BBP_ACR_CO ,
wa_asset_tab  LIKE LINE OF it_asset_tab,
ld_comp_code  TYPE BUKRS ,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return,
ld_quantity  TYPE BAPIEBKN-PREQ_QTY ,
it_control_record  TYPE STANDARD TABLE OF BBP_CONTROL_RECORD ,
wa_control_record  LIKE LINE OF it_control_record,
ld_txt50  TYPE CHAR50 ,
ld_logical_system  TYPE BBP_BACKEND_DEST-LOG_SYS ,
ld_acc_record  TYPE BBP_PDS_ACC .

ld_asset_class = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_asset_tab to it_asset_tab.
ld_comp_code = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_return to it_return.

ld_quantity = Check type of data required

"populate fields of struture and append to itab
append wa_control_record to it_control_record.
ld_txt50 = 'Check type of data required'.

SELECT single LOG_SYS
FROM BBP_BACKEND_DEST
INTO ld_logical_system.

ld_acc_record = 'Check type of data required'.

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