I've to maintain a simple validation at line item level for a FI for T-codes FB60/FV60/F-41/F-43/F-90/F-02 and doc type KA, KG,KN,KP,KR,KZ,ML,RA,RB,RE,RK,RL,RN,AA to restrict user to post any third party vendor payment document.
So i've maintained BKPF-BLART = 'KR' (for testing) and so on in pre-requisite and in check i've created a user exit U905 and written following code
FORM u905 USING b_result.
DATA: WA_KTOKK TYPE KTOKK.
RANGES : R_LIFNR FOR LFA1-LIFNR.
R_LIFNR-OPTION = 'BT'.
R_LIFNR-SIGN = 'I'.
R_LIFNR-LOW = '2000000000'.
R_LIFNR-HIGH = '2999999999'.
SELECT SINGLE KTOKK INTO WA_KTOKK FROM LFA1
WHERE LIFNR = BSEG-LIFNR.
IF WA_KTOKK = 'TRUV' AND BSEG-LIFNR IN R_LIFNR AND ( BSEG-BSCHL = '25' OR BSEG-BSCHL = '31' ).
b_result = B_FALSE.
after that i've maintained Error message in message section.
in SM30 i've assigned application area GBLR for view V_T80D
now i am facing following problem. Kindly confirm or suggest the alternatives.
1) in OB28, there is already another validation is maintained for the company code and line item with active status, hence system do not allow me to maintain my validation viz. "ZVPOST". Is it not required to maintain my validation as there is already a validation defined ?
2) This validation never gets called for any transaction. (I did put a break-point in the program)
Please guide me on the above whether i am missing any steps or my ussumption on point 1 is wrong.