Skip to Content
Preventing back-dated Invoice through Userexit. 

While creating invoice through VF01 transaction (or canceling through VF11) the user have the options to enter any date for the invoice. If the user do not enter any date then the system takes the posting date(in case of delivery or billing) or the document date (in case of sales order) of the reference document. This especially in case of invoice cancellation creates problem, since sometimes the invoice to be cancelled are quite old.

 

To prevent this situation and where the requirement is that the system always takes the current date as the billing date userexit can be used effectively. The userexit can be fine tuned to do this for specific billing type, user or date range.

 

Some of the SDN postings which gives similar scenario are given below.

 

https://forums.sdn.sap.com/click.jspa?searchID=7518381&messageID=2897663

https://forums.sdn.sap.com/click.jspa?searchID=7518381&messageID=3014735

https://forums.sdn.sap.com/click.jspa?searchID=7518381&messageID=2540691

https://forums.sdn.sap.com/click.jspa?searchID=7518093&messageID=4582830

https://forums.sdn.sap.com/click.jspa?searchID=7518381&messageID=3978986

   

For it we can use the include program for invoice RV60AFZC. The userexit USEREXIT_NUMBER_RANGE_INV_DATE we have to do the coding.

For using this userexit make sure that we are not using USEREXIT_NUMBER_RANGE for assigning internal number range to invoices of different plant/company code.

The following codes will make all invoices created (S1 or F2) take system date(ie current date) by default.

FORM USEREXIT_NUMBER_RANGE_INV_DATE USING US_RANGE_INTERN.

*{ INSERT DEVK906746
data : date type dats.
date = sy-datum.
vbrk-fkdat = date.
modify vbrk.

*} INSERT

ENDFORM.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Rauno M├╝ller
    hello
    in my opinion, this is the wrong place to add the coding.
    The right place would be in copy control delivery -> invoice or order -> invoice. You can create your own copy control form in Transaction VOFM and assign them in customizing to the appropriate document types.
    Regards
    Rauno
    (0) 

Leave a Reply