Skip to Content
-1

BADI/Exit for VF04

Mar 10, 2017 at 04:31 PM

129

avatar image
Former Member

Hi,

I did some research on this & could not find the solution so asking in this forum..

We have requirement to do some validation on invoices ( VF01/VF04/VF11) on dates and some other validations. Now i could not find the BADI/Exit which is called just before Save.

So we are using RV60AFZZ ( USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN) to validate the data. This exit is called per Billing ( for each line item) and we loop at XVBRP and validates the dates and other line items..

Since there is no parameter to set the error ( like in some case of BADI we have), what we do is if the error comes, we raise a message via below code

MESSAGE e002(zxxx) WITH lv_frm_prd 'and' lv_to_prd DISPLAY LIKE lc_msgtyp_e. " Billing Date cannot be outside the periods

SET SCREEN syst-dynnr.

LEAVE SCREEN.

This works good for one billing document. However, when we process multiple documents( Via VF04) and if the first document has error, then system stops the whole processing there itself and does not move forward to next ( although next doc is good).

We would like to check each document individually and only raise message for those and keep moving so the batch of VF04 can be completed.

Please advice the strategy and solution for this as it looks like LEAVE SCREEN is stopping the process and without which the wrong document is also getting saved.

Thanks for your time!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jelena Perfiljeva
Mar 10, 2017 at 09:02 PM
0

TLDR but such questions have been asked on SCN numerous times. SAP does not create any new functionality for this, so whatever is available has already been mentioned on SCN in the last 10 years.

In general, it's too late for validations when you reach the point of billing. Do the validations in the preceding documents or change the process so that such validations become not needed. There are no BADIs/user exits because it is way too late to check anything at that stage.

I've seen errors put in the VOFM routines in the copy control (I think) but this is not a good practice either.

P.S. SAP standard already checks if posting period is open or not. Don't want postings in a period - don't open it. As if VF04 is the only place where postings could happen. Quite silly...

Share
10 |10000 characters needed characters left characters exceeded