Ну где-то так (вызов не отформатирован и не подготовлен как тест, выдрал по быстрому из программы, создавал не складируемый материал вида DIEN):
* FOR w_mathead
w_mathead-material = tmatnr-matnr.
if n_mtart is initial.
w_mathead-ind_sector = 'M'.
w_mathead-matl_type = 'DIEN'.
move: 'X' to w_mathead-basic_view,
'X' to w_mathead-sales_view,
'X' to w_mathead-purchase_view,
'X' to w_mathead-account_view.
* FOR w_bapimara
w_bapimara-matl_group = tmatnr-matkl.
w_bapimara-base_uom = tmatnr-meins.
w_bapimara-item_cat = 'NORM'.
* FOR w_bapimarax
move: 'X' to w_bapimarax-matl_group,
'X' to w_bapimarax-base_uom,
'X' to w_bapimarax-item_cat.
* FOR w_bapimarc
w_bapimarc-plant = 'XXXX'.
* FOR w_bapimarcx
w_bapimarcx-plant = 'XXXX'.
* FOR w_bapimbew
w_bapimbew-val_area = 'XXXX'.
w_bapimbew-price_ctrl = 'V'.
w_bapimbew-val_class = '3200'.
* FOR w_bapimbewx
w_bapimbewx-val_area = 'XXXX'.
move: 'X' to w_bapimbewx-price_ctrl,
'X' to w_bapimbewx-val_class.
* FOR marm
marm-alt_unit = tmatnr-meins.
marm-gross_wt = 1.
marm-volume = 1.
marm-volumeunit = 'M3'.
append marm.
* FOR marmx
marmx-alt_unit = tmatnr-meins.
move: 'X' to marmx-gross_wt,
'X' to marmx-volume,
'X' to marmx-volumeunit.
append marmx.
endif.
* FOR material
material-langu = sy-langu.
material-matl_desc = tmatnr-maktx.
append material.
* FOR mlongtext
mlongtext-applobject = 'MATERIAL'.
mlongtext-text_name = tmatnr-matnr.
mlongtext-text_id = 'GRUN'.
mlongtext-langu = sy-langu.
i = strlen( tmatnr-mtext ).
if i =< 70.
mlongtext-format_col = '*'.
mlongtext-text_line = tmatnr-mtext.
append mlongtext.
endif.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
headdata = w_mathead
clientdata = w_bapimara
clientdatax = w_bapimarax
plantdata = w_bapimarc
plantdatax = w_bapimarcx
valuationdata = w_bapimbew
valuationdatax = w_bapimbewx
importing
return = w_bapireturn
tables
materialdescription = material
unitsofmeasure = marm
unitsofmeasurex = marmx
materiallongtext = mlongtext
exceptions
others = 1.