cancel
Showing results for 
Search instead for 
Did you mean: 

Validation Restricting Entry to One Cost Object

Former Member
0 Kudos

I am trying to create a validation in GGBO to restrict postings of Vendor Invoices (KR doc type) and journal entries (SA doc type) to only one cost object (cost center, internal order or WBS element) on expense account lines. I understand standard functionality limits posting to only one "real" object; however, getting the business to understand has proven difficult so I need a validation.

I have the following in the Prerequisite:

BKPF-BLART = 'KR' OR BKPF-BLART = 'SA' AND

BSEG-HKONT >= '700000' AND

BSEG-HKONT <= '799999'

For the check I have tried numerous ways, but below is one attempt:

BSEG-AUFNR <> ' ' AND BSEG-KOSTL = ' ' AND BSEG-PROJK = ' ' OR

BSEG-KOSTL <> ' ' AND BSEG-AUFNR = ' ' AND BSEG-PROJK = ' ' OR

BSEG-PROJK <> ' ' AND BSEG-AUFNR = ' ' AND BSEG-KOSTL = ' '

Nothing is working and I am getting frustrated. Any ideas?

Thank you in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You should write it as below:-


Pre-requisites:-
( BKPF-BLART = 'KR' OR BKPF-BLART = 'SA' ) AND
( BSEG-HKONT >= '0000700000' AND BSEG-HKONT <= '0000799999' )

Check:-
( BSEG-AUFNR NE ' ' AND BSEG-KOSTL EQ ' ' AND BSEG-PROJK EQ ' ' ) OR
( BSEG-AUFNR EQ ' ' AND BSEG-KOSTL NE ' ' AND BSEG-PROJK EQ ' ' ) OR
( BSEG-AUFNR EQ ' ' AND BSEG-KOSTL EQ ' ' AND BSEG-PROJK NE ' ' ) 

Message:-
As you need.

Regards,

Gaurav

Former Member
0 Kudos

Thank you, Gaurav, but it still allows two cost objects.

Former Member
0 Kudos

Got it working! Used BKPF-TCODE instead of BKPF-BLART. Created a set for the t-codes since there are many.