Skip to Content
avatar image
Former Member

Validation Rule for Accounting Document type

Hello Experts

I have an requirement to block certain accounting doc type to get vendor line item post in that. For that I tried to block direct through OBA7 but not be able to also can't delete number range as it is shared by another doc type. My last option is Validation rule but i never work on this ,so any suggest how to create validation rule " To Block Accounting Doc type SO THAT THERE WILL NOT BE ANY line item posting occur in that doc type.

Regards.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 09, 2012 at 09:02 PM

    ok sure. OB28 callpoint 1. Create a step under this callpoint.

    1) Prerequisite is as follows: note XXXX is your company code and ZZ is your doc type.

    BKPF-BUKRS = 'XXXX' AND

    BKPF-BLART = 'ZZ'

    2) Then you need to enter the check. Here you can just put FALSE.

    3) The last part is to create your message. Message type E so they get an error and then create a message number in the class that you choose and give it a description:

    Document Type 'ZZ' is not allowed

    Save it and wah lah!

    Let me know how it goes.

    Thanks,

    Jes

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Woohoo! Glad to be of help. just found out about this forum yesterday and been consulting for years. 😊 What a wonderful way to share knowledge.

  • avatar image
    Former Member
    Feb 10, 2012 at 01:50 AM

    Hi,

    Do you intend to restrict the usage of the docuemnt type for one particualr company code or at client level. If it is at client level then you don't need to write any validation for that. Within the docuemnt type configuration (OBA7) you can unflag all account types allowed and the system won't allow you to post anything using this document type.

    Hope this helps you!

    Regards,

    Prasad

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 10, 2012 at 02:02 AM

    Hi,

    I dont think it will work that way.You need to put co code or any t code (in which you want to restrict this doc type) at pre-requisite level and document type at check level and then assign an error message to it. You can do it all using GGB0, once you are done with it assign the validation in OB28. Hope it will work .

    Regards

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      If this validation rule is not specific to Company code and it is at client level, simply follow as per Prasad suggestions

      Reg

      Vishnu

  • avatar image
    Former Member
    Feb 09, 2012 at 08:41 PM

    Hi,

    If you no longer want to use a specific document type for en entire company code, then why don't you just change the number range so the last number used is the last number in that range (the to range). When posting, they will receive an error that the document number was already used. I hope this helps. If not, I can help you write the validation.

    For example, doc type BC uses range 1 through 20. Current number is 15. Change 20 to 15.

    Thanks,

    Jes

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank You Jessica

      I can't change the number range as I said before number range is shared with another doc type. So if you can help me with validation rule it will be a gr8 help.