SAP B46_CREATE_ASSET Function Module for driver for meta_create_asset
B46_CREATE_ASSET is a standard b46 create asset SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for driver for meta_create_asset 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 b46 create asset FM, simply by entering the name B46_CREATE_ASSET into the relevant SAP transaction such as SE37 or SE38.
Function Group: BBP_BD_DRIVER_46A
Program Name: SAPLBBP_BD_DRIVER_46A
Main Program: SAPLBBP_BD_DRIVER_46A
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function B46_CREATE_ASSET 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 'B46_CREATE_ASSET'"driver for meta_create_asset.
EXPORTING
ASSET_CLASS = "
COMP_CODE = "Buchungskreis
QUANTITY = "
* TXT50 = "
* ACC_RECORD = "Kontierung
TABLES
ASSET_TAB = "
* CONTROL_RECORD = "
* RETURN = "Returnparameter
EXCEPTIONS
ASSET_NOT_CREATED = 1 ASSET_CLASS_NOT_VALID = 2 COMPANY_CODE_NOT_VALID = 3 CREATE_ERROR = 4
IMPORTING Parameters details for B46_CREATE_ASSET
ASSET_CLASS -
Data type: CHAR8Optional: No
Call by Reference: No ( called with pass by value option)
COMP_CODE - Buchungskreis
Data type: BUKRSOptional: No
Call by Reference: No ( called with pass by value option)
QUANTITY -
Data type: BAPIEBKN-PREQ_QTYOptional: No
Call by Reference: No ( called with pass by value option)
TXT50 -
Data type: CHAR50Optional: Yes
Call by Reference: No ( called with pass by value option)
ACC_RECORD - Kontierung
Data type: BBP_PDS_ACCOptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for B46_CREATE_ASSET
ASSET_TAB -
Data type: BBP_ACR_COOptional: No
Call by Reference: No ( called with pass by value option)
CONTROL_RECORD -
Data type: BBP_CONTROL_RECORDOptional: Yes
Call by Reference: No ( called with pass by value option)
RETURN - Returnparameter
Data type: BAPIRET2Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
ASSET_NOT_CREATED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ASSET_CLASS_NOT_VALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
COMPANY_CODE_NOT_VALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CREATE_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for B46_CREATE_ASSET 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: | ||||
lt_asset_tab | TYPE STANDARD TABLE OF BBP_ACR_CO, " | |||
lv_asset_class | TYPE CHAR8, " | |||
lv_asset_not_created | TYPE CHAR8, " | |||
lv_comp_code | TYPE BUKRS, " | |||
lt_control_record | TYPE STANDARD TABLE OF BBP_CONTROL_RECORD, " | |||
lv_asset_class_not_valid | TYPE BBP_CONTROL_RECORD, " | |||
lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
lv_quantity | TYPE BAPIEBKN-PREQ_QTY, " | |||
lv_company_code_not_valid | TYPE BAPIEBKN, " | |||
lv_txt50 | TYPE CHAR50, " | |||
lv_create_error | TYPE CHAR50, " | |||
lv_acc_record | TYPE BBP_PDS_ACC. " |
  CALL FUNCTION 'B46_CREATE_ASSET' "driver for meta_create_asset |
EXPORTING | ||
ASSET_CLASS | = lv_asset_class | |
COMP_CODE | = lv_comp_code | |
QUANTITY | = lv_quantity | |
TXT50 | = lv_txt50 | |
ACC_RECORD | = lv_acc_record | |
TABLES | ||
ASSET_TAB | = lt_asset_tab | |
CONTROL_RECORD | = lt_control_record | |
RETURN | = lt_return | |
EXCEPTIONS | ||
ASSET_NOT_CREATED = 1 | ||
ASSET_CLASS_NOT_VALID = 2 | ||
COMPANY_CODE_NOT_VALID = 3 | ||
CREATE_ERROR = 4 | ||
. " B46_CREATE_ASSET |
ABAP code using 7.40 inline data declarations to call FM B46_CREATE_ASSET
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 PREQ_QTY FROM BAPIEBKN INTO @DATA(ld_quantity). | ||||
Search for further information about these or an SAP related objects