Application Development 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: 

Problem in changing material master through BAPI_MATERIAL_SAVEDATA

Former Member
0 Kudos
448

Hi Gurus,

I am trying to update the custom field in accounting view, I am using BAPI_MATERIAL_SAVEDATA for this purpose. But apparantly, it is not working as desired. In last i am getting these value in returnmessages tab.

Trying to create: 00396 ____ ____ 0110 __________ ____ __ ___ ___

The material cannot be maintained since no maintainable data transferred

Trying to change: 00396 ____ ____ 0110 __________ ____ __ ___ ___

No changes made

Here is my code

ds_valuedata-VAL_AREA = t_final-bwkey.

ds_valuedata-VAL_TYPE = t_final-bwtar.

ds_valuedata-zzpromo = t_final-zzpromo. <<<<<<<< THIS FIELD I NEED TO UPDATE

ds_valuedatax-VAL_AREA = t_final-bwkey.

ds_valuedatax-VAL_TYPE = t_final-bwtar.

ds_valuedatax-zzpromo = 'X'.

ls_extensionin-structure = 'BAPI_TE_MBEW'.

ls_extensionin-valuepart1 = ds_valuedata.

APPEND ls_extensionin TO lt_extensionin.

ls_extensioninx-structure = 'BAPI_TE_MBEWX'.

ls_extensioninx-valuepart1 = ds_valuedatax.

APPEND ls_extensioninx TO lt_extensioninx.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = ds_headdata

IMPORTING

return = ds_bapiret2

TABLES

returnmessages = lt_returnmessages

extensionin = lt_extensionin

extensioninx = lt_extensioninx.

Please help me as i am badly stuck with this problem.

1 REPLY 1

former_member181995
Active Contributor
0 Kudos
53

after all use call

BAPI_TRANSACTION_COMMIT

Amit.