cancel
Showing results for 
Search instead for 
Did you mean: 

Validation for Cost Accounting not triggering for Purchase Requisitions.

Former Member
0 Kudos

Hello Friends,

I have added the following validation in Cost Account (OKC7) and have activated it as well, however validation is not triggering and it is allowing user to enter any GL-Cost center combination without restrictions while entering a purchase requisition.  I had this working earlier in Sandbox but unfortunately it was refreshed with production data and I am unable to get this validation working.

NOTE:  Also I have validation for FI Accounting and it is working fine when invalid combination of GL-Cost center is entered in a set of TCODES.

Here is what I have in my Cost Accounting validation:

Prerequisite:

COBL-SAKNR IN ZGL_5

Check:

COBL-KOSTL in ZCOSTCTR_5 OR COBL-KOSTL IN ZCOSTCTR_4

Message:

Invalid combination of GL <COBL-HKONT> and Cost Center <COBL-KOSTL>.

Also I tried changing the Pre-Requisite to "COBL-VORGN = 'RMBA' AND COBL-HKONT IN ZGL_5

I tried searching the blogs but couldn't find a clue that I could use to fix this issue.  Since I had this working in the past in Sandbox, I am still trying to see if this can be achieved without using any user-exits or BADI's (I saw suggestions in some blogs) since I am not familiar with using user-exits.

Thank you,

Devi

Accepted Solutions (1)

Accepted Solutions (1)

ajaycwa1981
Active Contributor
0 Kudos

Hi Devi

Use HKONT instead of SAKNR and see if it works

Br, Ajay M


Former Member
0 Kudos

Hi Ajay,

Thanks for your time!

I did create additional steps with the following validations in Prerequisite but still none of them are triggering (I activated trace).

SYST-TCODE = 'ME51N' AND COBL-SAKNR IN ZGL-5

COBL-VORGN = 'RMBA' AND COBL-HKONT IN ZGL-5

Also please note that Commitment Management active, which means just the validation should suffice and I don't need to work with BADI or user exits.

Thank you,

Devi

Former Member
0 Kudos

Hi Devi,

you can try for following logic.

Prerequisite:-

(SYST-TCODE = 'ME51N') AND (COBL-VORGN = 'RMBA') AND (COBL-HKONT IN ZGL-5).

Check:

(COBL-KOSTL in ZCOSTCTR_5 OR COBL-KOSTL IN ZCOSTCTR_4)

try to simulate the validation in OKC7 itself so that you can check it out the results.

Regards

Srinu

Former Member
0 Kudos

Hi Srinu,

Thanks for your suggestion! 

Though steps work as expected in simulation, validation doesn't at all when I create a PR using ME51N.  It is the same with the pre-requisite and the check you suggested (added as a new step).

I have defined it as Line Item validation (Call up Point 1) and it is activated as well.

COAr    Event         Validation                                                Active

2000        1           ZSBNA  Validations in Controlling            1

Devi.

Former Member
0 Kudos

Hi Devi,

Please try for below Logic.

Prerequisite:-

(SYST-TCODE = 'ME51N') AND (COBL-VORGN = 'RMBA')

Check:

(COBL-KOSTL in ZCOSTCTR_5 OR COBL-KOSTL IN ZCOSTCTR_4) AND (COBL-HKONT IN ZGL-5)

If it doesn't work you can try for User Exit with the Help of ABAPer.

Regards

Srinu

Former Member
0 Kudos

Hi Srinu, 

No luck with moving the GL set to the CHECK block.

Thank you,

Devi

Former Member
0 Kudos

Hi Devi,

It's working for me, Please check your validation.

Here the screen shots for the same.

which table you are using for Set for Cost Centre & GL Accounts.

Regards

Srinu

Former Member
0 Kudos

Hi Srinu,

I have logged off and re-logged into the system and the validation is triggering now correctly.  Not sure what was the problem.

Thanks a lot for your time and walking me through different scenarios.

Devi

Former Member
0 Kudos

Hi Srinu,

You could probably want to extend this validation for ME52N.

Thanks,

Szymon

Former Member
0 Kudos

Hi Szymon,

Ya, we don't required to give the Transaction Code if you specify the Activity Type  (COBL-VORGN = 'RMBA').

Regards

Srinu

Answers (0)