Skip to Content
0
Sep 27, 2010 at 11:05 AM

Validation and substitution

122 Views

Hi GURUs,

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'.

APPEND R_LIFNR.

BREAK-POINT 'JMUNSHI'.

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.

endif.

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.

Thanks,

Janisar