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: 

code to modify commodity code of a material

Former Member
0 Kudos

HI ,

Could any one send me the code( Parameters to be passed to the BAPI_MATERIAL_SAVEDATA) to modify only the commodity code of a material.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,


DATA:
  ls_marc  TYPE bapi_marc,
  ls_marcx TYPE bapi_marcx,
  ls_head  TYPE bapimathead.

ls_head-material = <matnr>.
ls_head-ind_sector = <ind_sect>.
ls_head-matl_type = <matl_type>.
ls_head-sales_view = 'X'.

ls_marc-plant = <plant>.
ls_marc-comm_code = <comm_code>.

ls_marcx-plant = <plant>.
ls_marcx-comm_code = 'X'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
  EXPORTING
    headdata = ls_head
    plant_data = ls_marc
    plant_datax = ls_marcx
...

Hope this helps (please reward me if it does).

Regards, Joerg

1 REPLY 1

Former Member
0 Kudos

Hi,


DATA:
  ls_marc  TYPE bapi_marc,
  ls_marcx TYPE bapi_marcx,
  ls_head  TYPE bapimathead.

ls_head-material = <matnr>.
ls_head-ind_sector = <ind_sect>.
ls_head-matl_type = <matl_type>.
ls_head-sales_view = 'X'.

ls_marc-plant = <plant>.
ls_marc-comm_code = <comm_code>.

ls_marcx-plant = <plant>.
ls_marcx-comm_code = 'X'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
  EXPORTING
    headdata = ls_head
    plant_data = ls_marc
    plant_datax = ls_marcx
...

Hope this helps (please reward me if it does).

Regards, Joerg