we have sold to party with multiple ship to parties,
The ship to parties are assigned to the sold to party master data.
But when creating the sales oder we enter ship to party and the sold to party is found automatically,
But the system is allowing to enter ship to party from some other sold to party.
Hence the order is having different sold to party and different ship to party which is wrong
Edited by: Raeesuddin Mohammed on Jun 21, 2011 12:27 PM
I had a similar requirement wherein we had more that 1000 ship-to parties for a sold-to and had to validate that the same sold-to is determined when a particular ship-to is entered in the order. This is how I had resolved it.
1. First, create a new partner function for eg. ZL having the account group of the sold-to.
2. Assign this partner function ZL (sold-to) in each of the ship-to's (customer master) you have.
3. Then you need to write a code in the user exit MV45AFZZ with the logic as; READ the table KNVP to get the sold-to with the ship-to party; the sales area (you should be getting this as it is in the save user exit) and the partner function= ZL.
4. If sy-subrc=0; then read the KNPV with the sold-to got above, partner function = ZL, sales area and the ship-to.
5. If sy-subrc=0; the display a error message "the ship-to party does not relate to the sold-to party".
6. Else, the sold-to got is related to the ship-to and the normal logic proceeds further.
This way I think you can restrict only those ship-to's to be used related to the particular sold-to.
Edited by: Sampat Vijay Sadalge on Jun 21, 2011 1:25 PM
Thanks for your valuable suggestion,
Will try and implement your solution and revert back to you.
here the issue is in sales order when we enter ship to party and solt to party is determined ,after this determination if the user is entering another ship to party and the system is accepting it wthout redetermining the new sold to party.
Hope this is clear