Custom fields in sales order to fetch details from quotation
We have a requirement. We will first be creating a quotation. the quotation can have any number of line items. We will then create a stand alone sales order (with out ref to quot ).
In the sales order, we will have two custom fields on the screen at In the first custom field at item level. we will enter the quotation number and the quotation item number for which we are creating a sales order (we can create the SO with ref to Quot but we do not want to due to business reasons )
1) We want, as soon as user enters the quotation number and quotation item number in sales order custom fields above, we want system to check whether the material number in sales order line item matches with that of the material number in the quotation. How to achieve this ? Do we need to use BAPI to call Quotation ? I mean how to call quotation on entering quotation number in custom fields from sales order create mode ? if BAPI needs to be called, then can BAPI be called during sales order create mode only when entering information in custom fields from quotation ?
2) We want to compare some data in quotation with that of the sales order being created. How to enhance this ?
3) As soon as we enter the quotation number/item in sales order custom field, we want that the qty in sales order item be subtracted from the quotation qty ? for eg, if quotation is of 100 kg, then when sales order is created for 30 kg. Then the balance left in quotation should be 70 kg ?