cancel
Showing results for 
Search instead for 
Did you mean: 

Accounting validation for posting key and GL code combination

Former Member
0 Kudos

Dear Expert

I am writing a FI validation. The logic is:-

With Posting Key 50 one GL code 100301 can not be posted with a line item for F-02 transaction.

In Ob28 I am writing as:-

Prequisite:-

SYST-TCODE = 'F-02' AND BSEG-BSCHL = '50' AND BKPF-BLART = 'KZ'

Check:-

BSEG-HKONT = '100301'

Message:- Error

Pl advise where I am wrong

Regards,

Alok

Accepted Solutions (1)

Accepted Solutions (1)

suma_mani
Active Contributor
0 Kudos

Hi Alok,

Prerequisite :-

( BSEG-HKONT = '40050020' ) AND ( BSEG-SHKZG = 'H' )

AND ( BKPF-BLART = 'KZ' )

Check

( BKPF-TCODE = 'F-02' )

Assign error message.

Change GL account > Better you can use SETS instead of GL hardcode.

Solution with set :-

Create SET with GS01 as BANKGL

Select SKB1 table > Enter SAKNR as field > Enter all required GL account which are to be control for KZ credit entries.

In Validation

Prerequisite :-

( BSEG-HKONT IN BANKGL' ) AND ( BSEG-SHKZG = 'H' )

AND ( BKPF-BLART = 'KZ' )

Check

( BKPF-TCODE = 'F-02' )

Assign error message.

Regards

Mani Kumar

Former Member
0 Kudos

It is working fine. But for more than one GL codes (HKONTS) to be blocked should we use OR / AND, please advise.

I have used both or and And logic, its not working

Regards,

Alok

suma_mani
Active Contributor
0 Kudos

Hi Alok,

Use sets logic, which i mentioned above thread. You have to create one set ,which is through GS01 > maintain all respective GL accounts as master data and assign the same in to Validation as above mentioned.

Solution with set :-

Create SET with GS01 as BANKGL

Select SKB1 table > Enter SAKNR as field > Enter all required GL account which are to be control for KZ credit entries.

In Validation

Prerequisite :-

( BSEG-HKONT IN BANKGL' ) AND ( BSEG-SHKZG = 'H' )

AND ( BKPF-BLART = 'KZ' )

Check

( BKPF-TCODE = 'F-02' )

Assign error message.

According your query ,it should be OR.

Regards

Mani Kumar

Answers (1)

Answers (1)

narasimhulu_konnipati
Active Contributor
0 Kudos

Hi Alok,

Please be note that, the foreground t-code and background t-code might be different.

F-02 reads the background t-code as FB01

More over, it is not suggested to involve FB01 and Document type in Validation rule.

Try to do testing on all enjoy transactions once you activate the validation in OB28.

Follow the Manikumar's suggestion for rule.

Thanks