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

code to modify commodity code of a material

Former Member
0 Likes
892

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
Read only

Former Member
0 Likes
738

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
Read only

Former Member
0 Likes
739

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