To cancel a proforma invoice in the foreground, we perform below steps:
1. Go to VF02 first screen, provide the document number(don't press enter).
2. On the same screen go to top BILLING DOCUMENT->COMPLETE.
3. Completing a proforma invoice sets it to CANCELED.
Now I need to achieve this in the background using my program but I am unable to find any FM or a BAPI to achieve it.
I could find the BAPI to cancel a billing document but it does not work in case of Proforma Invoice since there is no cancellation document type attached to it.