Hello,
I'm trying to create a validation rule through the application manage validation rules and I have some difficulties with my rule.
The rule is simple, a blocking error should appear if the document date is before 2016.
But I don't know if I have a problem with the date format but the rule is not working. Has someone already faced this issue ?

+
DEFINE VALIDATION DOC_DATE
IN CONTEXT FINS_ACC_CB_1
PARAMETERS POSTING0 : FIN_SUBSTNVALDTNCODINGBLOCK
PRECONDITION ( ( ( ( POSTING0-CompanyCode = 'FR01' ) ) ) )
CASE WHEN NOT ( ( ( ( POSTING0-DocumentDate < '20160101' ) ) ) )
THEN MESSAGE E007(FINRE_UI_01) 'DocumentDate', 'DOC_DATE', $RULE-ID.
END
Thanks
Grégory
Request clarification before answering.
Hi Grego, your validation rule is not defined correctly. You required the document date <20160101 to pass the rule (not fail the rule validation), so you have to define it as >= 20160101.
Btw, YYYYMMDD is the correct date format, and the BAdi mentioned in one answer is not compatible with the app.
Grace
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Grégory,
I don't know if you can use all operators on date fields, but have you already tried another date format ddmmyyyy?
Another option you can test is the operator "between" (e.g. between 19990101 - 20151231).
If it is not possible to use the "simple" formulas, you can write your logic in a BAdI: https://help.sap.com/viewer/0fa84c9d9c634132b7c4abb9ffdd8f06/2011.500/en-US/fed79813a60447669f096d9f...
Best Regards,
Henk Hoogerbrug
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 12 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.