Auto plant determination in a sales order.
When I create a sales order for a material, the plant is automatically determined. I have 2 plants, US05 and US06.
If a material XYZ is marked for deletion in plant US05, VA01 should automatically take US06. This is done in userexit_move_field_to_vbap (Include MV45AFZZ). So, when I save the sales order, the plant is getting overwritten.
Now, when I save the sales order, for the material XYZ, it has plant US06, but the remaining plant master data like Strategy group, requirement type is still from US05. To copy these two fields I have used 2 function modules 'MATERIAL_READ' and 'RV_SCHEDULING_TYPE_DETERMINE'.
Now the problem is: it is copying Plant, Strategy group, and requirement correctly, but for some materials, sales order application is giving some messages and for some other, it is done correctly. VA01 is not consistent for all the materials.
Is there any way to copy the entire plant master data for a material. i.e, if material XYZ is marked for deletion in US05, I need to copy the entire plant master data of US06 and then create a sales order...
Points will be awarded...........