Skip to Content
avatar image
Former Member

Auto Increment Cardcode on BP in SAP Business One

Hi everyone, I´m looking to do the auto increment on the business partners cardcode. I found some code on this thread https://archive.sap.com/discussions/thread/3224396 and there´s this code that seems like what I need

If $[OCRD.CardType] in ('C' ,'L')
Select'C'+right(str(isnull(max(substring(T0.CardCode,2,5))+100001),5),'00001')
From OCRD T0
WHERE T0.CardCode LIKE 'C[0-9][0-9][0-9][0-9][0-9]'
else if $[OCRD.CardType] = 'S'
Select'V'+right(str(isnull(max(substring(T0.CardCode,2,5))+100001),5),'00001')
From OCRD T0
WHERE T0.CardCode LIKE 'V[0-9][0-9][0-9][0-9][0-9]' 

But where I´m supposed to put it? Also found this guide. https://es.scribd.com/document/329988517/How-to-Auto-Increment-Business-Partner-Code-for-SAP-Business-One-htm

But it looks like the code only works with numeric cardcode and I have mine like 'C00001' for clients and 'P0001' for suppliers Anyone knows how can I do the auto increment? or how could I implement the code above?

Best Regards!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 28, 2017 at 08:38 PM

    Hi Anderson,

    Did you try to setup Document Numbering for Business Partner?

    Go to -> Administration->System Initialization -> Document Numbering

    The two first lines is related to Business partners.

    Double click on the first column in first line. A new form will be opened.

    Set up your Series like the second line in the screenshot. After create new series click on the button "Set as Default".

    When you click on "Set as Default" button, SAP will ask you how to apply new configuration.

    Do the same thing for the second line (Business Partners - Vendor).

    The result:

    Hope it helps.

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded