Skip to Content

Duplication of Customer Ref No

Dear Experts,

I'm using SAP B1 Version 9.2.

The standard standard system behavior is, if I set warning at document setting

for duplicate Ref No, the system will prompt the alert/warning only after I click add if there is duplicate Ref No. This also apply to approval procedure.

My concern is, sometimes I have a long list of items in my documents, and it waste my time to key in all the items and after that when click add, I noticed that the Ref No I used at the header is duplicate with other documents.

Is there any way for the alert to pop out after I key in the Ref No, I mean before I key in the row details. I know, this actually can be done using previous version, below 9.0, but why current version cannot?

I went trough the forum, and found out below solutions, but seems i could not understand them because of little experience in SAP.

1) SP Notification,

2) Formatted search

3)Store procedure

Maybe someone can explain to me?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 28, 2018 at 02:25 PM


    In general, the customer reference is unique and it will not be same for all customer/vendors. But some times, due to adding of new items under same reference number is possible. So system prompt an warning message or blocking message while adding the document.

    System does not know until to add the document. If I am not wrong, old version is also works with same logic.

    SP Notification & Stored procedure--> Adding query in SQL server management studio to block the adding/updating of document. Using this, system allows user to enter all lines and it will block only while adding the document.

    Formatted search--> Using this Formatted Search Query, we can display those orders with same reference before adding lines. But, it will not block the adding document.



    Add comment
    10|10000 characters needed characters exceeded

    • Dear Nagarajan.

      Thank You so much.

      I understand your explanation.

      Let say, I want to ignore the item level or I do not have items under same reference number, so, i want the alert prompt before I key in the Item.

      Can I perform that action?

      Thank You

  • Jan 29, 2018 at 08:19 AM


    The best option is the stored procedure.

    You can define the validations here, and before adding the new document you can verify in the table ADOC if exists any document with the same reference number for BP and fiscal period for example.

    If your conditions are true, the stored procedure will block the document.

    Kind regards


    Add comment
    10|10000 characters needed characters exceeded

    • MD Amall Agustin Marcos Cividanes

      Dear Agustin,

      Thank you so much.

      Looks like it is impossible to create the blocking function immediately after user key in duplicate Ref No, unless i have enough knowledge about SP.

      I will stick to FMS for a while and try to understand the SP writing process first

      thank you so much

  • Jan 30, 2018 at 08:33 AM


    As Agustin Marcos Cividanes mentioned, you do not loose your data. You do not have to enter all the items again, al you have to do is change the reference.

    However, you can also create a FMS to automatically give you a unique reference number. For example:


    which you trigger at the change of CardCode.



    Add comment
    10|10000 characters needed characters exceeded