cancel
Showing results for 
Search instead for 
Did you mean: 

Update user defined fields in MARA using bapi_material_savedata

Former Member
0 Kudos

Hi,

I have this problem:

I am creating materials from a Z table filled by another application (not SAP). I am using the bapi "bapi_material_savedata" to create the materials and it is working fine. But now I need to fill user defined fields in the MARA table from this Z table, and this fields, are not filled after using the bapi.

I am using the bapi tables "extensionin" and "extensioninx".

I have modified the BAPI_TE_MARA structure adding the ZZ fields of the MARA and the BAPI_TE_MARAX structure with the same fields but different data elements. So I have this structures/tables:

BAPI_TE_MARA:

MATERIAL - MATNR

ZZDIM1 - ZZCHDIM1

ZZDIM2 - ZZCHDIM2

ZZDIM3 - ZZCHDIM3

BAPI_TE_MARAX:

MATERIAL - MATNR

ZZDIM1 - BAPIUPDATE

ZZDIM2 - BAPIUPDATE

ZZDIM3 - BAPIUPDATE

MARA:

..(standard fields of the MARA)....

ZZDIM1 - ZZCHDIM1

ZZDIM2 - ZZCHDIM2

ZZDIM3 - ZZCHDIM3

Here is the code that i'm using to update the extensionin and extensioninx tables:

DATA x_bapi_te_mara TYPE bapi_te_mara.
  DATA x_bapi_te_marax TYPE bapi_te_marax.

  it_extensionin-structure = 'BAPI_TE_MARA'.
  it_extensioninx-structure = 'BAPI_TE_MARAX'.

* the internal table it_material contains the data of the
* ZZ fields
  MOVE-CORRESPONDING it_material TO x_bapi_te_mara.
  x_bapi_te_mara-material = it_material-matnr.

  x_bapi_te_marax-material = it_material-matnr.
  x_bapi_te_marax-zzdim1 = 'X'.
  x_bapi_te_marax-zzdim2 = 'X'.
  x_bapi_te_marax-zzdim3 = 'X'.

  it_extensionin-valuepart1 = x_bapi_te_mara.
  APPEND it_extensionin.

  it_extensioninx-valuepart1 = x_bapi_te_marax.
  APPEND it_extensioninx.

Also i have an entry in the table T130F that i'm not sure i need.

Please help me to fill this user defined fields !!

Regards,

Jesus

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi jesus maica,

i am having the same problem with bapi.can u please provide solution which u git.

Thanks

sai

Former Member
0 Kudos

Are you using this line:

x_bapi_te_marax-material = it_material-matnr.

or this line?

x_bapi_te_marax-matnr = it_material-matnr.

Former Member
0 Kudos

I'm using both,

x_bapi_te_mara-material = it_material-matnr.

x_bapi_te_marax-material = it_material-matnr.

The first line is from the x_bapi_te_mara structure and the second for the x_bapi_te_maraX.

Thanks

Former Member
0 Kudos

And your it_material also contains values in the same fieldnames like ZZDIM1, ZZDIM2 etc. (I mean your move-corresponding is working right?)

Former Member
0 Kudos

Thats right, my move-corresponding is working fine.

Former Member
0 Kudos

hi.. did you solve your problem with BAPI_MATERIAL_SAVEDATA ???

I have the same problem and can't solve it !!!!

thanks in advance...