Samsung: The inventory department realizes they are running low on certain electronic components. They send the request to the purchasing department that they require certain items. The Purchasing department will create a purchase request (PR: Tcode: ME51N ) .

This PR may be then subjected to RFQ (Request for Quotation Tcode: ME41) and vendor selection. Basically they will decide from which company we need to buy the items from. They may select the Vendor (Seller) on basis of price, credit limit, reliability etc. etc. In some cases the seller has to send a quotation (Tcode: VA11 (Inquiry), VA21(Quotation) from Seller’s SAP system) having the price information so that Samsung can compare among all sellers.

VOFM routines are primarily used in SD, Billing area to alter the standard business processes. Ex: Determine the price of pricing condition dynamically etc. It can be considered as one of form of Enhancements.

VOFM routines can be used to propose/alter the business process and it can be triggered for particular condition. Ex: Pricing condition ZCIL which will trigger the routine whenever it’s used.
VOFM routines are created using TCODE VOFM

When you are looping a main table and getting entries from other table based on it , the performance gets hampered as we are doing loop inside a loop. There is one solution to reduce the performance burden. That is Parallel cursor.

Suppose you are displaying the delivery of SD items using LKIP and LIPS tables. In normal approach you will loop into LIKP (Delivery Header) and get the delivery items data (LIPS data)
The code will look like this:

LOOP AT it_likp INTO wa_likp. LOOP AT it_lips INTO wa_lips WHERE vbeln EQ wa_likp-vbeln. " Do Something ENDLOOP.ENDLOOP.

Now the problem is not with first loop. It’s with second loop. The search criteria wa_likp-vbeln will be scanned each time till it’s found in it_lips table.