Swati,
You will have to go the User exit route to achieve your reqt.
Check the user exits in the program SAPLV60B (interface to FI- accounting).
The thread posted by Mr JP contains the logic that might help you.
Is there any specific reason you want to simulate the customer invoice before posting? Just trying to understand the value of doing it.
Thanks,
Ravin