cancel
Showing results for 
Search instead for 
Did you mean: 

BP Customer Vendor Same

thobenjo1
Explorer
0 Kudos
986

Hi Experts,

I wanted to create a customer who is also our vendor ,but when I am trying to add the customer it says duplicate bp name,this is beacuase of the query in sql,but If i dissable this query we will be able to create duplicated vendors or customers ,how to change this and make the bp into both customer and vendor but not to have 2 same name in vendor/customer.

-If 1 < (SELECT count(T1.CardName) FROM OCRD T1

--where T1.CardName in (SELECT T0.CardName FROM OCRD T0 WHERE T0.CardCode=@list_of_cols_val_tab_del))

--Begin

--SET @error = 1

--SET @error_message = N'Business Partner Name cannot be duplicated.'

--End.

SAP b1

wojciech_wozniak
Participant

Add a condition to distinguish the type of BP, for example: T0.CardType = 'S' AND T0.CmpPrivate = 'C'

jbrotto
Active Contributor

May I suggest the same numbers but a different prefix such as a V and C.

Accepted Solutions (0)

Answers (3)

Answers (3)

OlehFabri
Participant

Hi Prakash,

You cannot add records to the Business Partner Master Data with identical BP Code value as this will violate the primary key CardCode on the OCRD table.

To achieve the desired effect you can use the Connected Vendor/Customer functionality as follows:

1. Create two records in Business Partner Master data for Customer and Vendor.

2. On the Accounting tab of the created Customer, in the Connected Vendor field, choose the CardCode of the created Vendor (or vice versa):

Having accomplished this, you can apply the connection in Dunning Wizard and Internal Reconciliation among others, as well as in Ageing Report:

former_member790399
Discoverer
0 Kudos

Hi Prakash

we can do this customer become vendor and same as vendor become the customer

just follow this steps:

Goto the transaction code BP

Then enter you customer or vendor number

Then click on edit option

mgregur
Active Contributor
0 Kudos

Hi,

as wojciech.wozniak said, you should also check based on CardType.

Before your code for comparison, define type as nvarchar(1) and do a SELECT "CardType" INTO type. Then you can concat CardName and Type to do the comparison and allow / deny creation of partner.

BR,

Matija