Create another BP based on an existing BP
For CRM 2007 I want to create a BP based on a the details of a BP selected by a user.
How would this be done? I haven't found any useful threads on this subject.
Stephen is very right about this - there is no way to copy a business partner.
However, we have tried in the past to develop this functionality - and also the functionality to change the category after copying.This is some info that will help you while creating a copy program -
1. The easiest way is to use APIs. Start by calling BUPA_CENTRAL_GET_DETAIL usign the BP number. THis will give you all the central data for the BP - e.g. name, etc. Now, merely feed the output of this module into the module BUPA_CREATE_FROM_DATA. This will create a new BP with the same data of the old BP.
2. Now that the main BP is ready, you need to start copying the individual datasets - addresses, bank details, roles, Id, industry,etc. This is tricky - the ADD apis - BUPA_ADDRESS_ADD, BUPA_ROLE_ADD, etc can only create one record in a call. So, you need to first get the data of the reference BP using the GET_DETAIL api e.g. : BUPA_ADDRESS_GET_DETAIL, then loop at each returned record, and pass that into the correspinding ADD BAPI.
3. Be sure to call BAPI_TRANSACTION_COMMIT at the end to commit the data to the DB.
I hope this helps you.