Skip to Content

Issue while assign material to plant and create sales views

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.



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


return = ls_return


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.



Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.