Skip to Content
0
Former Member
Mar 22, 2011 at 09:52 AM

Problems function BAPI_MATERIAL_SAVEDATA with Z-FIELDS

677 Views

Hello,

I am a problem with the function BAPI_MATERIAL_SAVEDATA. I want to fill the Z-FIELDS but the function fill the field with space and i don't understand the problem.

My code is:

  • Header

bapi_head-material = et_datos-matnr.

bapi_head-mrp_view = 'X'.

bapi_marc-plant = et_datos-werks.

bapi_marcx-plant = et_datos-werks.

bapi_marc-abc_id = et_datos-maabc.

bapi_marcx-abc_id = 'X'.

bapi_marc-mrp_type = et_datos-dismm.

bapi_marcx-mrp_type = 'X'.

bapi_marc-mrp_ctrler = et_datos-dispo.

bapi_marcx-mrp_ctrler = 'X'.

bapi_marc-lotsizekey = et_datos-disls.

bapi_marcx-lotsizekey = 'X'.

bapi_marc-reorder_pt = et_datos-minbe.

bapi_marcx-reorder_pt = 'X'.

bapi_marc-fixed_lot = et_datos-bstfe.

bapi_marcx-fixed_lot = 'X'.

bapi_marc-minlotsize = et_datos-bstmi.

bapi_marcx-minlotsize = 'X'.

bapi_marc-maxlotsize = et_datos-bstma.

bapi_marcx-maxlotsize = 'X'.

bapi_marc-mrp_group = et_datos-disgr.

bapi_marcx-mrp_group = 'X'.

bapi_marc-round_val = et_datos-bstrf.

bapi_marcx-round_val = 'X'.

bapi_marc-proc_type = et_datos-beskz.

bapi_marcx-proc_type = 'X'.

bapi_marc-spproctype = et_datos-sobsl.

bapi_marcx-spproctype = 'X'.

bapi_marc-iss_st_loc = et_datos-lgpro.

bapi_marcx-iss_st_loc = 'X'.

bapi_marc-sloc_exprc = et_datos-lgfsb.

bapi_marcx-sloc_exprc = 'X'.

bapi_marc-backflush = et_datos-rgekz.

bapi_marcx-backflush = 'X'.

bapi_marc-inhseprodt = et_datos-dzeit.

bapi_marcx-inhseprodt = 'X'.

bapi_marc-plnd_delry = et_datos-plifz.

bapi_marcx-plnd_delry = 'X'.

bapi_marc-sm_key = et_datos-fhori.

bapi_marcx-sm_key = 'X'.

bapi_marc-serv_level = et_datos-lgrad.

bapi_marcx-serv_level = 'X'.

bapi_marc-period_ind = et_datos-perkz.

bapi_marcx-period_ind = 'X'.

bapi_marc-plan_strgp = et_datos-strgr.

bapi_marcx-plan_strgp = 'X'.

bapi_marc-consummode = et_datos-vrmod.

bapi_marcx-consummode = 'X'.

bapi_marc-fwd_cons = et_datos-vint2.

bapi_marcx-fwd_cons = 'X'.

bapi_marc-bwd_cons = et_datos-vint1.

bapi_marcx-bwd_cons = 'X'.

bapi_marc-mixed_mrp = et_datos-miskz.

bapi_marcx-mixed_mrp = 'X'.

bapi_marc-alt_bom_id = et_datos-altsl.

bapi_marcx-alt_bom_id = 'X'.

bapi_marc-repmanprof = et_datos-sfepr.

bapi_marcx-repmanprof = 'X'.

bapi_marc-rep_manuf = et_datos-sauft.

bapi_marcx-rep_manuf = 'X'.

bapi_te_marc-plant = et_datos-werks.

bapi_te_marc-zzenvsip = et_datos-zzenvsip.

bapi_te_marcx-plant = et_datos-werks.

bapi_te_marcx-zzenvsip = 'X'.

it_bapiparex-structure = 'BAPI_TE_MARC'.

it_bapiparex-valuepart1 = bapi_te_marc.

APPEND it_bapiparex.**

it_bapiparexx-structure = 'BAPI_TE_MARCX'.

it_bapiparexx-valuepart1 = bapi_te_marcx.

APPEND it_bapiparexx.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = bapi_head

plantdata = bapi_marc

plantdatax = bapi_marcx

IMPORTING

return = bapi_return

TABLES

extensionin = it_bapiparex

extensioninx = it_bapiparexx.

IF bapi_return-type EQ 'E' OR r_test = 'X' OR p_p_modo = 'TEST'.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

ENDIF.

I have completed the structure BAPI_TE_MARC and BAPI_TE_MARCX with Z-FIELDS of MARC.

The material is created but the Z-FIELD no have a value.

Any idea???.