Skip to Content
author's profile photo
Former Member


Hi experts,

can you give me sapmle program for material creation using BAPI_MATERIAL_SAVEDATA?


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 05:34 AM
    • Define BAPI data.

    data: mathead type bapimathead,

    mara_data type bapi_mara,

    mara_datax type bapi_marax,

    wa_bapi_te_mara type bapi_te_mara,

    wa_bapi_te_marax type bapi_te_marax,



    t_extin type table of bapiparex,

    t_extinx type table of bapiparexx,

    d_extin type bapiparex,

    d_extinx type bapiparexx,

    ret type bapiret2.

    • Fill header structure.

    mathead-material = l_matnr.

    mathead-basic_view = 'X'.

    • Fill Bespoke Input view fields for change.

    wa_bapi_te_mara-material = l_matnr.

    wa_bapi_te_marax-material = l_matnr.

    wa_bapi_te_mara-zz_eflpkta = l_fptype.

    wa_bapi_te_marax-zz_eflpkta = 'X'.

    wa_bapi_te_mara-zz_eflpkt = l_fpoint.

    wa_bapi_te_marax-zz_eflpkt = 'X'.

    • Fill remainder of structure/s.

    wa_valuepart = wa_bapi_te_mara.

    d_extin-structure = 'BAPI_TE_MARA'.

    d_extin-valuepart1 = wa_valuepart(240).

    d_extin-valuepart2 = wa_valuepart+240(240).

    d_extin-valuepart3 = wa_valuepart+480(240).

    d_extin-valuepart4 = wa_valuepart+720(240).

    wa_valuepartx = wa_bapi_te_marax.

    d_extinx-structure = 'BAPI_TE_MARAX'.

    d_extinx-valuepart1 = wa_valuepartx(240).

    d_extinx-valuepart2 = wa_valuepartx+240(240).

    d_extinx-valuepart3 = wa_valuepartx+480(240).

    d_extinx-valuepart4 = wa_valuepartx+720(240).

    append d_extin to t_extin.

    append d_extinx to t_extinx.

    • Update record via BAPI.

    call function 'BAPI_MATERIAL_SAVEDATA'


    headdata = mathead

    clientdata = mara_data

    clientdatax = mara_datax


    return = ret


    extensionin = t_extin

    extensioninx = t_extinx.

    reward points please.....

    Add comment
    10|10000 characters needed characters exceeded