Berikut merupakan sample code program SAP ABAP untuk create Assets menggunakan Function Module BAPI_FIXEDASSET_CREATE1, semoga membantu
REPORT yupload_assets_wahyu.
DATA :
"local variable
lv_cc TYPE bapi1022_1-comp_code,
lv_asset TYPE bapi1022_1-assetmaino,
lv_subnumber TYPE bapi1022_1-assetsubno,
lv_assetcreated TYPE bapi1022_reference,
"local TABLES
ls_key TYPE bapi1022_key, "assest details
ls_return TYPE bapiret2,
ls_gd TYPE bapi1022_feglg001, "general DATA
ls_gdx TYPE bapi1022_feglg001x, "general DATA fields updating
ls_time TYPE bapi1022_feglg003, "time dependent
ls_timex TYPE bapi1022_feglg003x, "time dependent FIELDS updating
ls_allo TYPE bapi1022_feglg004, "allocation DATA
ls_allox TYPE bapi1022_feglg004x, "allocation DATA fields updating
ls_dep TYPE bapi1022_dep_areas, "depreciation areas
ls_depx TYPE bapi1022_dep_areasx, "depreciation areas FIELDS update
"local Internal Table
lt_dep TYPE STANDARD TABLE OF bapi1022_dep_areas, "depreciation areas
lt_depx TYPE STANDARD TABLE OF bapi1022_dep_areasx.
ls_key-companycode = '1000'.
ls_gd-assetclass = 'Z4100'.
ls_gd-descript = 'test 1'.
ls_gd-quantity = 1.
ls_gd-base_uom = 'ST'.
ls_gd-main_descript = 'Asset Test'.
ls_gdx-assetclass =
ls_gdx-descript =
ls_gdx-quantity =
ls_gdx-base_uom =
ls_gdx-main_descript = abap_true.
ls_time-bus_area = ''.
ls_time-costcenter = '0000103200'.
ls_time-plant = '1303'.
ls_time-location = ''.
ls_timex-bus_area =
ls_timex-costcenter =
ls_timex-plant =
ls_timex-location = abap_true.
CALL FUNCTION 'BAPI_FIXEDASSET_CREATE1'
EXPORTING
key = ls_key
generaldata = ls_gd
generaldatax = ls_gdx
timedependentdata = ls_time
timedependentdatax = ls_timex
allocations = ls_allo
allocationsx = ls_allox
IMPORTING
companycode = lv_cc
asset = lv_asset
subnumber = lv_subnumber
assetcreated = lv_assetcreated
return = ls_return
TABLES
depreciationareas = lt_dep
depreciationareasx = lt_depx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
MESSAGE ls_return-message TYPE 'I'.
Ketika dijalankan akan seperti ini: