Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Article creation using BAPI

Former Member
0 Likes
1,999

Hi Experts,

i am creating an article using bapi function module BAPI_MATERIAL_MAINTAINDATA_RT,

After uploading a file when i execute it is giving a error log.

if i see the error log it giving the error that 'No entry in key field of table MARM'

but i passed all the key fields from marm structure

please help me on this..

Narendra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,381

HI,

goto SE19 and implement BADI: ARTMAS_BAPI_EXTEND

goto method: MODIFY_BAPI_DATA and check hat your values are all in.

goto method: BAPI_ADDITIONAL_PROCESSING (after commit work) that all information is ok !

9 REPLIES 9
Read only

Former Member
0 Likes
1,382

HI,

goto SE19 and implement BADI: ARTMAS_BAPI_EXTEND

goto method: MODIFY_BAPI_DATA and check hat your values are all in.

goto method: BAPI_ADDITIONAL_PROCESSING (after commit work) that all information is ok !

Read only

0 Likes
1,381

do you have filled the "X" strucutres with the the keyfields and filled the changed fields with "X" ?

Read only

0 Likes
1,381

hi,

i have updated all the fields with 'x'.

narendra

Read only

0 Likes
1,381

post your structure values !

Read only

0 Likes
1,381

hi

CALL FUNCTION 'MATERIAL_NUMBER_GET_NEXT'

EXPORTING

materialart = st_article-matl_type

IMPORTING

materialnr = v_matnr

  • RETURNCODE =

EXCEPTIONS

no_internal_interval = 1

  • TYPE_NOT_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • st_bapie1mathead-function = '004'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = v_matnr

IMPORTING

output = v_matnr.

MODIFY it_article FROM st_article TRANSPORTING material.

st_bapie1mathead-material = v_matnr.

st_bapie1mathead-matl_type = st_article-matl_type.

st_bapie1mathead-matl_group = st_article-matl_group.

st_bapie1mathead-matl_cat = st_article-matl_cat.

st_bapie1mathead-char_prof = st_article-char_prof.

st_bapie1mathead-ref_matl = st_article-ref_matl.

st_bapie1mathead-ck_no_rnge = 'X'.

st_bapie1mathead-basic_view = 'X'.

st_bapie1mathead-list_view = 'X'.

st_bapie1mathead-sales_view = 'X'.

st_bapie1mathead-logdc_view = 'X'.

st_bapie1mathead-logst_view = 'X'.

st_bapie1mathead-pos_view = 'X'.

*

  • st_bapie1varkey-function = '004'.

  • st_bapie1varkey-material = st_article-material.

  • st_bapie1varkey-variant = st_article-variant.

  • APPEND st_bapie1varkey TO it_bapie1varkey.

*

  • st_bapie1ausprt-function = '004'.

st_bapie1ausprt-material = v_matnr.

st_bapie1ausprt-char_name = st_article-char_name.

st_bapie1ausprt-char_value = st_article-char_value.

APPEND st_bapie1ausprt TO it_bapie1ausprt.

  • st_bapie1ausprtx-function = '004'.

st_bapie1ausprtx-material = v_matnr.

st_bapie1ausprtx-char_name = st_article-char_name.

st_bapie1ausprtx-char_value = 'X'.

APPEND st_bapie1ausprtx TO it_bapie1ausprtx.

  • st_bapie1marart-function = '004'.

st_bapie1marart-material = v_matnr.

st_bapie1marart-old_mat_no = st_article-old_mat_no.

st_bapie1marart-base_uom = st_article-base_uom.

st_bapie1marart-base_uom_iso = st_article-base_uom_iso.

st_bapie1marart-po_unit = st_article-po_unit.

st_bapie1marart-pur_valkey = st_article-pur_valkey.

st_bapie1marart-net_weight = st_article-net_weight.

st_bapie1marart-stor_conds = st_article-stor_conds.

st_bapie1marart-trans_grp = '0001'. "ST_ARTICLE-TRANS_GRP.

st_bapie1marart-division = st_article-division.

st_bapie1marart-sup_source = st_article-sup_source.

st_bapie1marart-season = st_article-season.

st_bapie1marart-sh_mat_typ = st_article-sh_mat_typ.

st_bapie1marart-valid_from = sy-datum. "ST_ARTICLE-VALID_FROM.

st_bapie1marart-saeson_yr = st_article-saeson_yr.

st_bapie1marart-extmatlgrp = st_article-extmatlgrp.

st_bapie1marart-tax_class = st_article-tax_class.

st_bapie1marart-prprofvar = st_article-prprofvar.

st_bapie1marart-qual_dik = st_article-qual_dik.

st_bapie1marart-item_cat = 'NORM'. "ST_ARTICLE-ITEM_CAT.

APPEND st_bapie1marart TO it_bapie1marart.

  • st_bapie1marartx-function = '004'.

st_bapie1marartx-material = v_matnr.

st_bapie1marartx-old_mat_no = 'X'.

st_bapie1marartx-base_uom = 'X'.

st_bapie1marartx-po_unit = 'X'.

st_bapie1marartx-pur_valkey = 'X'.

st_bapie1marartx-net_weight = 'X'.

st_bapie1marartx-stor_conds = 'X'.

st_bapie1marartx-trans_grp = 'X'.

st_bapie1marartx-division = 'X'.

st_bapie1marartx-sup_source = 'X'.

st_bapie1marartx-season = 'X'.

st_bapie1marartx-sh_mat_typ = 'X'.

st_bapie1marartx-valid_from = 'X'.

st_bapie1marartx-saeson_yr = 'X'.

st_bapie1marartx-extmatlgrp = 'X'.

st_bapie1marartx-tax_class = 'X'.

st_bapie1marartx-prprofvar = 'X'.

st_bapie1marartx-qual_dik = 'X'.

st_bapie1marartx-item_cat = 'X'.

APPEND st_bapie1marartx TO it_bapie1marartx.

  • st_bapie1maw1rt-function = '004'.

st_bapie1maw1rt-material = v_matnr.

st_bapie1maw1rt-repl_list = '1'. "ST_ARTICLE-REPL_LIST.

st_bapie1maw1rt-pur_group = st_article-pur_group.

st_bapie1maw1rt-sales_unit = st_article-sales_unit.

st_bapie1maw1rt-issue_unit = st_article-issue_unit.

st_bapie1maw1rt-loadinggrp = '0001'. "ST_ARTICLE-LOADINGGRP.

st_bapie1maw1rt-assort_lev = '1'. "ST_ARTICLE-ASSORT_LEV.

st_bapie1maw1rt-li_proc_st = 'B1'. "ST_ARTICLE-LI_PROC_ST.

st_bapie1maw1rt-li_proc_dc = 'B1'. "ST_ARTICLE-LI_PROC_DC.

st_bapie1maw1rt-list_st_fr = sy-datum. "ST_ARTICLE-LIST_ST_FR.

st_bapie1maw1rt-list_st_to = '31129999'. "ST_ARTICLE-LIST_ST_TO.

st_bapie1maw1rt-list_dc_to = '31129999'. "ST_ARTICLE-LIST_DC_TO.

st_bapie1maw1rt-sell_st_fr = sy-datum. "ST_ARTICLE-SELL_ST_FR.

st_bapie1maw1rt-sell_dc_fr = sy-datum. "ST_ARTICLE-SELL_DC_FR.

st_bapie1maw1rt-sell_dc_to = '31129999'. " ST_ARTICLE-SELL_DC_TO.

st_bapie1maw1rt-val_class = st_article-val_class.

st_bapie1maw1rt-assortlist = 'X'. "ST_ARTICLE-ASSORTLIST.

APPEND st_bapie1maw1rt TO it_bapie1maw1rt.

  • st_bapie1maw1rtx-function = '004'.

st_bapie1maw1rtx-material = v_matnr.

st_bapie1maw1rtx-repl_list = 'X'.

st_bapie1maw1rtx-pur_group = 'X'.

st_bapie1maw1rtx-sales_unit = 'X'.

st_bapie1maw1rtx-issue_unit = 'X'.

st_bapie1maw1rtx-loadinggrp = 'X'.

st_bapie1maw1rtx-assort_lev = 'X'.

st_bapie1maw1rtx-li_proc_st = 'X'.

st_bapie1maw1rtx-li_proc_dc = 'X'.

st_bapie1maw1rtx-list_st_fr = 'X'.

st_bapie1maw1rtx-list_st_to = 'X'.

st_bapie1maw1rtx-list_dc_to = 'X'.

st_bapie1maw1rtx-sell_st_fr = 'X'.

st_bapie1maw1rtx-sell_dc_fr = 'X'.

st_bapie1maw1rtx-sell_dc_to = 'X'.

st_bapie1maw1rtx-val_class = 'X'.

st_bapie1maw1rtx-assortlist = 'X'.

APPEND st_bapie1maw1rtx TO it_bapie1maw1rtx.

  • st_bapie1maktrt-function = '004'.

st_bapie1maktrt-material = v_matnr.

st_bapie1maktrt-langu = 'EN'.

st_bapie1maktrt-matl_desc = st_article-matl_desc.

APPEND st_bapie1maktrt TO it_bapie1maktrt.

  • st_bapie1marcrt-function = '004'.

st_bapie1marcrt-material = v_matnr.

st_bapie1marcrt-plant = st_article-plant.

st_bapie1marcrt-mrp_type = st_article-mrp_type.

st_bapie1marcrt-mrp_ctrler = st_article-mrp_ctrler.

st_bapie1marcrt-plnd_delry = st_article-plnd_delry.

st_bapie1marcrt-lotsizekey = st_article-lotsizekey.

st_bapie1marcrt-proc_type = 'F'. "ST_ARTICLE-PROC_TYPE.

st_bapie1marcrt-reorder_pt = st_article-reorder_pt.

st_bapie1marcrt-safety_stk = st_article-safety_stk.

st_bapie1marcrt-max_stock = st_article-max_stock.

st_bapie1marcrt-loadinggrp = '0001'. "ST_ARTICLE-LOADINGGRP.

st_bapie1marcrt-sup_source = st_article-sup_source.

st_bapie1marcrt-auto_p_ord = 'X'. "ST_ARTICLE-AUTO_P_ORD.

st_bapie1marcrt-profit_ctr = st_article-profit_ctr.

st_bapie1marcrt-neg_stocks = st_article-neg_stocks.

st_bapie1marcrt-round_prof = st_article-round_prof.

st_bapie1marcrt-distr_prof = st_article-distr_prof.

st_bapie1marcrt-target_stock = st_article-target_stock.

APPEND st_bapie1marcrt TO it_bapie1marcrt.

  • st_bapie1marcrtx-function = '004'.

st_bapie1marcrtx-material = v_matnr.

st_bapie1marcrtx-plant = st_article-plant.

st_bapie1marcrtx-mrp_type = 'X'.

st_bapie1marcrtx-mrp_ctrler = 'X'.

st_bapie1marcrtx-plnd_delry = 'X'.

st_bapie1marcrtx-lotsizekey = 'X'.

st_bapie1marcrtx-proc_type = 'X'.

st_bapie1marcrtx-reorder_pt = 'X'.

st_bapie1marcrtx-safety_stk = 'X'.

st_bapie1marcrtx-max_stock = 'X'.

st_bapie1marcrtx-loadinggrp = 'X'.

st_bapie1marcrtx-sup_source = 'X'.

st_bapie1marcrtx-auto_p_ord = 'X'.

st_bapie1marcrtx-profit_ctr = 'X'.

st_bapie1marcrtx-neg_stocks = 'X'.

st_bapie1marcrtx-round_prof = 'X'.

st_bapie1marcrtx-distr_prof = 'X'.

st_bapie1marcrtx-target_stock = 'X'.

APPEND st_bapie1marcrtx TO it_bapie1marcrtx.

  • st_bapie1marmrt-function = '004'.

st_bapie1marmrt-material = v_matnr.

st_bapie1marmrt-alt_unit = st_article-alt_unit.

st_bapie1marmrt-alt_unit_iso = st_article-alt_unit_iso.

st_bapie1marmrt-numerator = st_article-numerator.

st_bapie1marmrt-denominatr = st_article-denominatr.

st_bapie1marmrt-ean_upc = st_article-ean_upc.

st_bapie1marmrt-ean_cat = st_article-ean_cat.

st_bapie1marmrt-length = st_article-length.

st_bapie1marmrt-width = st_article-width.

st_bapie1marmrt-height = st_article-height.

st_bapie1marmrt-unit_dim = st_article-unit_dim.

st_bapie1marmrt-gross_wt = st_article-gross_wt.

st_bapie1marmrt-unit_of_wt = st_article-unit_of_wt.

st_bapie1marmrt-sub_uom = st_article-sub_uom.

APPEND st_bapie1marmrt TO it_bapie1marmrt.

  • st_bapie1marmrtx-function = '004'.

st_bapie1marmrtx-material = v_matnr.

st_bapie1marmrtx-alt_unit = st_article-alt_unit.

st_bapie1marmrtx-alt_unit_iso = st_article-alt_unit_iso.

st_bapie1marmrtx-numerator = 'X'.

st_bapie1marmrtx-denominatr = 'X'.

st_bapie1marmrtx-ean_upc = 'X'.

st_bapie1marmrtx-ean_cat = 'X'.

st_bapie1marmrtx-length = 'X'.

st_bapie1marmrtx-width = 'X'.

st_bapie1marmrtx-height = 'X'.

st_bapie1marmrtx-unit_dim = 'X'.

st_bapie1marmrtx-gross_wt = 'X'.

st_bapie1marmrtx-unit_of_wt = 'X'.

st_bapie1marmrtx-sub_uom = 'x'.

APPEND st_bapie1marmrtx TO it_bapie1marmrtx.

  • st_bapie1meanrt-function = '004'.

st_bapie1meanrt-material = v_matnr.

st_bapie1meanrt-ean_upc = st_article-ean_upc.

st_bapie1meanrt-ean_cat = st_article-ean_cat.

APPEND st_bapie1meanrt TO it_bapie1meanrt.

  • st_bapie1mlanrt-function = '004'.

st_bapie1mlanrt-material = v_matnr.

st_bapie1mlanrt-depcountry = st_article-depcountry.

st_bapie1mlanrt-tax_type_1 = st_article-tax_type_1.

st_bapie1mlanrt-taxclass_1 = st_article-taxclass_1.

APPEND st_bapie1mlanrt TO it_bapie1mlanrt.

  • st_bapie1mbewrt-function = '004'.

st_bapie1mbewrt-material = v_matnr.

st_bapie1mbewrt-val_area = st_article-val_area.

APPEND st_bapie1mbewrt TO it_bapie1mbewrt.

  • st_bapie1mbewrtx-function = '004'.

st_bapie1mbewrtx-material = v_matnr.

st_bapie1mbewrtx-val_area = st_article-val_area.

APPEND st_bapie1mbewrtx TO it_bapie1mbewrtx.

  • st_bapie1mardrt-function = '004'.

st_bapie1mardrt-material = v_matnr.

st_bapie1mardrt-plant = st_article-plant.

st_bapie1mardrt-stge_loc = st_article-stge_loc.

APPEND st_bapie1mardrt TO it_bapie1mardrt.

  • st_bapie1mardrtx-function = '004'.

st_bapie1mardrtx-material = v_matnr.

st_bapie1mardrtx-plant = st_article-plant.

st_bapie1mardrtx-stge_loc = st_article-stge_loc.

APPEND st_bapie1mardrtx TO it_bapie1mardrtx.

  • st_bapie1mvkert-function = '004'.

st_bapie1mvkert-material = v_matnr.

st_bapie1mvkert-sales_org = st_article-sales_org.

st_bapie1mvkert-distr_chan = st_article-distr_chan.

APPEND st_bapie1mvkert TO it_bapie1mvkert.

  • st_bapie1mvkertx-function = '004'.

st_bapie1mvkertx-material = v_matnr.

st_bapie1mvkertx-sales_org = st_article-sales_org.

st_bapie1mvkertx-distr_chan = st_article-distr_chan.

APPEND st_bapie1mvkertx TO it_bapie1mvkertx.

these are the values i passed

Read only

0 Likes
1,381

i checked my coding and i have filled the following field,too.

UNIT_OF_WT_ISO

Read only

0 Likes
1,381

HI,

same problem is coming to me.

can u send me your code.

waiting for your response

thanks & regards..

narendra

Read only

0 Likes
1,381

Hi

can u send me your code .

thanks in advance

narendra

Read only

0 Likes
1,381

Hi,

when i checked in method MODIFY_BAPI_DATA , i found that\

it is showing 2 records of same in marm structure and in first record alt_unit is blank.But i am uploading only single record.

thanks in advance

Narendra