Skip to Content
0

Issue while assign material to plant and create sales views

Dec 15, 2017 at 02:07 PM

34

avatar image
Former Member

Hello Guys,

I am facing issue while creating sales views data for a material which got created while creating Compatible units( CUs).

When CU got created, a material is creating with same name and using badi "/C*M/BADI_CU_MASTER" to copy CU characters to material and created basic views ( it will trigger while click on CU -SAVE ).

I am using "BAPI_MATERIAL_SAVEDATA" to create sales org data by passing

ls_headdata-material = wa-matnr.

ls_headdata-ind_sector = lv_mbrsh.

ls_headdata-matl_type = lv_mtart.

ls_headdata-sales_view = abap_true.

ls_headdata-account_view = abap_true.

ls_plantdata-plant = wa-werks.

ls_plantdatax-plant = wa-werks.

ls_plantdata-countryori = 'GBP'.

ls_plantdatax-countryori = abap_true.

ls_valuationdata-val_area = wa-werks.

ls_valuationdata-val_class = wa-bklas.

ls_valuationdata-std_price = wa-stprs.

ls_valuationdata-price_ctrl = 'S'.

and related ls_valuationdatax fields with abap_true..

ls_clientdata-old_mat_no =wa-matnr.

ls_clientdata-division = wa-spart.

ls_clientdatax-division = abap_true.

ls_clientdata-item_cat = wa-mtpos.

ls_clientdatax-item_cat = abap_true.

ls_clientdatax-old_mat_no = abap_true.

ls_clientdata-base_uom = lv_meins.

ls_clientdatax-base_uom = abap_true.

ls_salesdata-sales_org = wa-vkorg.

ls_salesdata-distr_chan = wa-vtweg.

ls_salesdata-matl_stats = wa-versg.

ls_salesdata-comm_group =wa-provg.

ls_salesdata-item_cat = wa-mtpos.

ls_salesdata-delyg_plnt =wa-dwerk.

ls_salesdata-acct_assgt = wa-ktgrm.

and respective ls_salesdatax fields with abap_true.

and tax details.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = ls_headdata

clientdata = ls_clientdata

clientdatax = ls_clientdatax

plantdata = ls_plantdata

plantdatax = ls_plantdatax

valuationdata = ls_valuationdata

valuationdatax = ls_valuationdatax

salesdata = ls_salesdata

salesdatax = ls_salesdatax

IMPORTING

return = ls_return

TABLES

taxclassifications = lt_taxclassifications

unitsofmeasure = lt_unitsofmeasure1.

But, its throwing error message that ' The material 'xxxxx' is not assigned to plant 'xxx'.

and some times "MG 046 field 1000 has been transferred inconsistently or blabk"

am i missing any fields or Is there an way to create sales org data.

Please throw some clues.

Regards,

PS.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers