Skip to Content
0

Auto Increment Cardcode on BP in SAP Business One

Jan 28, 2017 at 07:45 PM

226

avatar image

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!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
DIEGO LOTHER Jan 28, 2017 at 08:38 PM
0

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


img1.png (27.7 kB)
img2.png (76.4 kB)
img3.png (28.0 kB)
img4.png (19.2 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Wow, that´s way easier! Thanks a lot Diego!

0