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

'bapi_material_savedata' ,custom fields

Former Member
0 Likes
371

hi ,

i've a program in which a material data is completely copied into another material.

it calls 'bapi_material_savedata', i've 3 customer specified fields to be copied , which i am passing into bapi_extin ,bapi_extinx. structures.

but only one field is getting copied, what are the things i've to check

to rectify this.

1 REPLY 1
Read only

Former Member
0 Likes
331

hello experts!

i have the same issue with this FM, where i wish to use it to update a Z-field (customer field) from table mara. I know i have to use the EXTENSIONIN & EXTENSIONINX tables, but i don't know where to specify the fieldname (MARA-ZZPRODFAM) that will be updated, plus the value to be assigned to this field... below is a snippet of my codes. also, when am i supposed to use the table field extensionout?

DATA: headdata TYPE bapimathead,

return type BAPIRET2,

  • clientdata TYPE bapi_mara,

  • clientdatax TYPE bapi_marax,

lt_EXTENSIONIN TYPE STANDARD TABLE OF BAPIPAREX,

wa_EXTENSIONIN TYPE BAPIPAREX,

lt_EXTENSIONINX TYPE STANDARD TABLE OF BAPIPAREXX,

wa_EXTENSIONINX TYPE BAPIPAREXX.

loop at gt_data into wa_data.

headdata-material = wa_data-matnr.

headdata-forecast_view = 'X'.

wa_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MARA'.

wa_EXTENSIONINX-STRUCTURE = 'BAPI_TE_MARAX'.

wa_EXTENSIONIN-VALUEPART1 = 'MARA-ZZPRODFAM'.

wa_EXTENSIONIN-VALUEPART2 = wa_data-zzprodfam.

wa_EXTENSIONINX-VALUEPART1 = 'X'.

APPEND wa_EXTENSIONIN TO lt_EXTENSIONIN.

APPEND wa_EXTENSIONINX TO lt_EXTENSIONINX.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = headdata

IMPORTING

return = return

TABLES

EXTENSIONIN = lt_EXTENSIONIN

EXTENSIONINX = lt_EXTENSIONINX.

endloop.