Urgent help in coding of creating New Business partner?

Hi Friends,
I need urgent help on this.Please give me the solution.
This is the coding which i written for creating new BP.
FUNCTION ZCTS_NEW_CONTACT.
""Local interface:
*"  IMPORTING
*"     VALUE(BUSINESSPARTNER) LIKE  BAPIBUS1006_HEAD-BPARTNER
*"     VALUE(CNEWINFO) TYPE  ZCTS_CONTACTS
*"     VALUE(CDATA) LIKE  BAPIBUS1006_CENTRAL STRUCTURE
*"        BAPIBUS1006_CENTRAL
*"     VALUE(BUSPART1) LIKE  BAPIBUS1006_RELHEAD-BUSINESSPARTNER1
*"     VALUE(BUSPART2) LIKE  BAPIBUS1006_RELHEAD-BUSINESSPARTNER2
*"     VALUE(RELCAT) LIKE  BAPIBUS1006_RELHEAD-RELATIONSHIPCATEGORY
*"  EXPORTING
*"     VALUE(MESG) TYPE  CHAR100
DATA: lt_return like bapiret2 occurs 0 with Header line.
DATA: CTPERS  LIKE BAPIBUS1006_CENTRAL_PERSON OCCURS 0 WITH HEADER LINE.
DATA : PARTN_GRP TYPE BAPIBUS1006_HEAD-PARTN_GRP.
DATA : PARTN_CAT TYPE BAPIBUS1006_HEAD-PARTN_CAT.
DATA: BEGIN OF ADADD.
   INCLUDE STRUCTURE BAPIBUS1006_ADDRESS.
  DATA: END OF ADADD.
DATA: BEGIN OF ADTEL OCCURS 0.
   INCLUDE STRUCTURE BAPIADTEL.
  DATA: END OF ADTEL.
DATA: BEGIN OF ADSMP OCCURS 0.
   INCLUDE STRUCTURE BAPIADSMTP.
  DATA: END OF ADSMP.
CTPERS-FIRSTNAME  = CNEWINFO-FNAME.
CTPERS-LASTNAME   = CNEWINFO-LNAME.
PARTN_CAT = 1.
PARTN_GRP = 002.
ADADD-CITY = CNEWINFO-CITY .
telephone info **
  ADTEL-TELEPHONE = CNEWINFO-PHONE.
  ADTEL-CONSNUMBER = '001'.
  APPEND ADTEL.
  ADTEL-TELEPHONE = CNEWINFO-MOBILE.
  ADTEL-CONSNUMBER = '002'.
  APPEND ADTEL.
email information **
  ADSMP-E_MAIL = CNEWINFO-EMAIL .
  APPEND ADSMP.
CALL FUNCTION 'BAPI_BUPA_CREATE_FROM_DATA'
  EXPORTING
    PARTNERCATEGORY                    = PARTN_CAT
    CENTRALDATA                        = CDATA
    PARTNERGROUP                       = PARTN_GRP
    CENTRALDATAPERSON                  = CTPERS
    ADDRESSDATA                        = ADADD
IMPORTING
   BUSINESSPARTNER                    = BUsinessPartner
TABLES
    TELEFONDATA                        = ADTEL
    E_MAILDATA                         = ADSMP
    RETURN                             = lt_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
     WAIT = 'X'.
*PARTN_CAT = 1.
*PARTN_GRP = 002.
*ADADD-CITY = CNEWINFO-CITY .
telephone info **
ADTEL-TELEPHONE = CNEWINFO-PHONE.
ADTEL-CONSNUMBER = '001'.
APPEND ADTEL.
ADTEL-TELEPHONE = CNEWINFO-MOBILE.
ADTEL-CONSNUMBER = '002'.
APPEND ADTEL.
email information **
ADSMP-E_MAIL = CNEWINFO-EMAIL .
APPEND ADSMP.
CALL FUNCTION 'BAPI_BUPR_PFCT_CREATEFROMDATA'
      EXPORTING
        BUSINESSPARTNER1           = BUSPART1
        BUSINESSPARTNER2           = BUSPART2
        RELATIONSHIPCATEGORY       = RELCAT
     TABLES
       RETURN                     = lt_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
     WAIT = 'X'.
LOOP AT lt_return WHERE TYPE = 'E'.
    MESG = ' NOT CREATED NEW CONTACT'(020).
    EXIT.
  ENDLOOP.
ENDFUNCTION.
Early reply is highly appriciable.
Regards,
BONA

Hi,
Thanks for early reply.
When i tested created new BP.
Wheni check wether it is created or not its not created.
What is the problem.is there modifications i have to do int he coding.
Thanks,
BONA.

Similar Messages

  • Create new  Business Partner in Loan Area

    Hi friends,
    I am facing the problem following:
    I can not create a new Business Partner (main Loan Partner) in Loan area.
    From Create new contract in Loan area, I create a new Business Partner (Organization) -> Result: Display screen is Create new contract
    I don't know why? I check in customizing but I can't find which step I missed.
    Please help me fix error
    Thanks and Best regards
    Ms. Minh

    Hi friends,
    it's done if create a Business Partner from T.code BP then assign to loan contract.
    But I want to fix error why I can't search and create a Business Partner from Loan Contract
    Thanks and Best regards
    Ms.Minh

  • Error on Creating New Business Partner

    Hi All,
    We have client who are using SAP Business One 2007 A (8.00.181) SP:00 PL: 49; they have been using the system for more than three years perfectly good .Now they have started to face a problem of Creating new Business Partners and System is recurring with an error message that u201CThis entry is already exist on the following tables u2018Business Partnersu2019 (OCRD) (ODBC u2013 2085) [Message 131 u2013 183]u201D while there is no such kind of record exist on the system. So can any one help on this problem?
    Best Regards,

    Hi.........
    Please check OCRD and ACRD table.
    OCRD table is for whether the Business Partner Master is already present or not.
    And ACRD is for whether the Business Partner Created and Deleted from OCRD and logs manitained in ACRD.......
    Please check you get some Clue........
    Regards,
    Rahul

  • How to Create Approval for  New Business Partner Master Data

    Hello Experts,
    Is it possible for creation of an approval query such that while creation of New Business Partner:
    if
      a user forgets to add data in a field say TIN No. which is present in Tax Information,
    then
      the Business Partner Creation is withheld and sent for approval .
    Can someone please help me with creation of such an approval procedure ?
    Thanks and Regards,
    Manish Saluja

    Hello Manish...
    Sorry to say there is no way to create an approval template on master data (BP, item, etc).  However, we once had a similar problem and used the Alert Management to catch critical information that was missing during the creation process.  Everyone had to enter a credit limit with no exceptions.  I do not have the exact SQL in front of me, but it went something like this...
    Very simple...
    SELECT
    T0.CardCode,
    T0.CardName,
    T0.CreditLine
    FROM OCRD T0
    WHERE
    T0.CreditLine IS NULL
    Then we set an Alert Message to go off every minute and sent it to the Accounting Department.  Although it did not STOP them from adding the Business Partner, it sure did give someone the heads up to call the person who created it after looking at the Change Log.  Sort of a compromise...maybe that helps you???
    Take care - Zal

  • How to create a new business partner for notification with function module?

    Hello,
    I got a problem when I want to create a new Notification with its businiss partner (BAPI_ALM_NOTIF_CREATE). I can't find the proper way to create the new business partner. Anyone offer some help?
    Thanks a lot!
    Morgan

    when I look at the function you can transfer the partner in NOTIFPARTNR table.
    You must already have defined the appropiate partnerroll in customizing for you're businesspartner
    or do you have another problem with this function ?

  • BP: How to hide "Validity Period" on screen Create a new Business Partner

    Hi,
    On screen Create a new Business Partner, I want to hide field Validity Period
    -> Please tell me how to do in Customizing
    Thanks and Best regards
    Ms.Minh

    Hi,
    For each BP role, you can control the field status in configuration under BP-Role Settings. Please check whether validity period is available for field configuration or not.
    Regards
    Prasad AV

  • Create new business transaction for OBV3.

    Dear All
    In OBV3 how to create Business transactions as i want to create new
    business transactions for the same.
    Regards
    VG

    Dear All
    Business transactions are system defined .
    Thanks
    VG

  • Capture DB Table and column comments when creating new Business Area/Folder

    Does anyone know if it is possible to pull the DB table and column comments into Discoverer when creating new Business Area/Folders? Our developers take the time to put the information in the Db data dictionary and we would like to leverage it (reduce need for manually adding descriptions) ... has anyone done this?
    If there isn't a way to automatically do it, would there be any harm in using a sql script to populate the description fields from the DB data dictionary directly into the EUL tables appropriate?
    I have been searching through documentation and forums for information - with no luck at this point.
    Thanks!

    Hi Seymour
    You can add column comments to views as well, as this example will show:
    CREATE OR REPLACE FORCE VIEW MY_SEQUENCE
    (SEQ_ID, SEQ_NAME, SEQ_NEXTVAL)
    AS
    SELECT "SEQ_ID","SEQ_NAME","SEQ_NEXTVAL" FROM EUL5_SEQUENCES;
    COMMENT ON COLUMN MY_SEQUENCE.SEQ_NAME IS 'The sequence';
    So you could add the comments at the view level and then refresh Discoverer.
    Best wishes
    Michael

  • ERROR :APP-PER-289381  While Creating New Business Group

    Hello,
    When i am creating new business group in new fresh implementation i am find this error.
    APP-PER-289381: A business group with this name exists. Please enter a different name.
    I have only Default business group: 'Setup Business group'
    Please can any provide a solution for this.. Your early response will highly appreciated.
    Thanks
    Mohsin

    Hi Mohsin,
    whatever name you are trying just run the below query to check if it already exists or not.
    select * from apps.per_business_groups where name = 'Give here the name you are tyring'
    If this returns any row means name already exist in deed. You can rename the existing business group and then create new on. However, if name doesnt exist, wait for any other reply in the forum.
    Thanks,
    Avinash

  • Any inbuilt Function Module available in CRM to create a Business Partner

    Hi All,
    I need to create a business partner in CRM not manually through GUI. I need to develop a function module that will create a Business Partner in CRM.
    Can some one tell me if there is an in-built BAPI/Function Module availabe in CRM to create a business partner in CRM.
    When i researched i found that there is a BAPI BAPI_BUPA_FS_CREATE_FROM_DATA2 which can create a business partner in CRM.
    I dont know how to use this BAPI, can some one help me with some sample code.
    Also will the development of a function module differ in CRM when compared to ECC?

    Hello,
    Standard CRM PC UI application offers three options when you push 'New' button: 'Person', 'Organization' and 'Group' (combobox appears). In your case, 'Person' should be selected.
    p.s. If you don't see combobox mentioned above, it could be security issue.
    Kirill

  • Problem in adding a new business partner

    hi all
               iam getting an error like "Bank account is missing",when i add a new business partner..i think iam missing any mandatory field..can anybody help me..i have posted my add BP coding in the last...
    <?xml version="1.0" encoding="utf-8" ?>
    - <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
    - <env:Body>
    - <env:Fault>
    - <env:Code>
      <env:Value>env:Receiver</env:Value>
    - <env:Subcode>
      <env:Value>-5002</env:Value>
      </env:Subcode>
      </env:Code>
    - <env:Reason>
      <env:Text xml:lang="en">Bank account is missing</env:Text>
      </env:Reason>
    - <env:Detail>
      <Object>2</Object>
      <ObjectIndex>1</ObjectIndex>
      <Command>AddObject</Command>
      <SessionID>EE10Cu91-F252-CB47-58A6-9929L682316F</SessionID>
      </env:Detail>
      </env:Fault>
      </env:Body>
      </env:Envelope>
    the coding for adding a new business partner is,,
    <WebMethod()> Public Function QueryBP(ByVal SessionID As String, ByVal CardCode As String, ByVal CardName As String) As Xml.XmlDocument
            Dim DISnode As SBODI_Server.Node
            Dim strSOAPans, scmd As String
            Dim xmlDoc As Xml.XmlDocument
            xmlDoc = New Xml.XmlDocument
            DISnode = New SBODI_Server.Node
            sCmd = "<?xml version=""1.0"" encoding=""UTF-16""?> "
            sCmd += "<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/""> "
            sCmd += " <env:Header> "
            sCmd += "<SessionID>" & CStr(SessionID) & "</SessionID>"
            sCmd += " </env:Header> "
            sCmd += " <env:Body> "
            sCmd += "<dis:AddObject xmlns:dis=""http://www.sap.com/SBO/DIS"" > "
            sCmd += "<BOM>"
            sCmd += "<BO>"
            sCmd += "<AdmInfo>"
            scmd += "<Object>oBusinessPartners</Object> "
            scmd += "</AdmInfo> "
            scmd += "<QueryParams>"
            scmd += "<CardCode>" & CStr(CardCode) & "</CardCode>"
            scmd += "</QueryParams>"
            scmd += "<BusinessPartners>"
            scmd += "<row>"
            scmd += "<CardCode>" & CStr(CardCode) & "</CardCode>"
            scmd += "<CardName>" & CStr(CardName) & "</CardName>"
            scmd += "</row>"
            scmd += "</BusinessPartners>"
            sCmd += "</BO> "
            sCmd += "</BOM> "
            sCmd += "</dis:AddObject> "
            sCmd += " </env:Body> "
            sCmd += "</env:Envelope> "
            strSOAPans = DISnode.Interact(scmd)
            xmlDoc.LoadXml(strSOAPans)
            Return (RemoveEnv(xmlDoc))
        End Function

    Hi michael,
                       Even if i declare like below it's showing the bank account is missing..
    scmd += "<BusinessPartners>"
            scmd += "<row>"
            scmd += "<CardCode>" & CStr(CardCode) & "</CardCode>"
            scmd += "<CardName>" & CStr(CardName) & "</CardName>"
            scmd += "<BankCountry> </BankCountry>"
            scmd += "</row>"
            scmd += "</BusinessPartners>"

  • Change default CardType on adding a new business partner

    Hi everyone,
    I have a simple question, but I can't find the answer on the internet.
    I would like to change the default selected type on the form when I create a new business Partner.
    At the moment when I am in "add mode" the comboBox type ( corresponding to CartType in DB) has the value "Customer" selected by default. I want to change that default value by "Lead".  See attached image.
    Is it possible to do that?
    Thank you for your help!

    Hi,
    Not possible to change default value.Please refer below:
    Thanks & Regards,
    Nagarajan

  • Error while creating a business partner / sponsor

    Hi experts,
    I am getting the following error (same as the one posted by one of the other users) when i try to create a business partner in the 'sponsor' role:
    Sponsor does not have a customer associated with it.
    Because of this error I AM STUCK!!! and cannot move forward with the rest of the customization. I searched all the settings and researched this error - couldnt find anything useful.
    Can you guys PLEASE HELP???
    Thank you,
    Ajay

    Dear Ajay,
    The sponsor should have a customer number behind
    Please have a look at the online help:[http://help.sap.com/saphelp_erp60_sp/helpdata/en/8d/b6283b85b6666be10000000a114084/frameset.htm]
    See Customizing Grantee Management   ->GM-GTE Customizing: Master Data  -> GM-GTE Master Data Customizing: Sponsor
    You can adjust your customizing in a way to create the customer automatically at the time of creating the sponsor, or you can first create the sponsor and link it to a customer afterwards. This will depend on how the sponsor Role (Standard is PSSP01) is set.
    you can find it in the IMG> Master Data Synchronization> Customer/Vendor Integration> Business Partner Settings> Settings for Customer Integration> Set BP Role Category for Direction BP to Customer
    and check options 'Customer-based' or 'Optional for Customer'
    Hope this will help
    Kind regards
    Mar

  • CAM_ERROR while creating a Business Partner using SD_CUSTOMER_MAINTAIN_ALL

    Hello All,
    I was trying to create a Business Partner(Ship to Party) using function module SD_CUSTOMER_MAINTAIN_ALL. When I am executing this through SE37 transaction, its working fine &
    creating a KUNNR value along with new ADRNR number.
    But when the same data is passed inside the program, its throwing CAM_ERROR(sy-subrc = 22).
    If anyone used this FM, please suggest. Thank you.

    Hello Ragu,
    I am passing the data to function module as shown below.
    *KNA1 population
                      ls_kna1-mandt = sy-mandt.
                      ls_kna1-ktokd = 'ZN02'.
                      ls_kna1-land1 = ls_adrc-country.
                      ls_kna1-name1 = ls_adrc-name1.
                      ls_kna1-name2 = ls_adrc-name2.
                      ls_kna1-ort01 = ls_adrc-city1."City
                      ls_kna1-regio = ls_adrc-po_box_reg.
                      ls_kna1-pstlz = ls_adrc-post_code1.
                      ls_kna1-sortl = ls_adrc-sort_phn.
                      ls_kna1-stras = ls_adrc-house_num1.
                      ls_kna1-spras = ls_adrc-langu.
    *BAPIADDR1 population
                      ls_bapiaddr1-name          = ls_adrc-name1.
                      ls_bapiaddr1-name_2        = ls_adrc-name2.
                      ls_bapiaddr1-city          = ch_adrc_struc-city1.
                      ls_bapiaddr1-postl_cod1    = ch_adrc_struc-post_code1.
                      ls_bapiaddr1-street        = ch_adrc_struc-street.
                      ls_bapiaddr1-house_no      = ch_adrc_struc-house_num1.
                      ls_bapiaddr1-str_suppl1    = ch_adrc_struc-str_suppl1.
                      ls_bapiaddr1-str_suppl2    = ch_adrc_struc-str_suppl2.
                      ls_bapiaddr1-location      = ch_adrc_struc-location.
                      ls_bapiaddr1-country       = ch_adrc_struc-country.
                      ls_bapiaddr1-langu         = ch_adrc_struc-langu.
                      ls_bapiaddr1-sort1         = ch_adrc_struc-sort1.
                      ls_bapiaddr1-sort2         = ch_adrc_struc-sort2.
                      ls_bapiaddr1-langu_cr      = ch_adrc_struc-langu_crea.
    *KNVV Population
                      ls_knvv-vkorg              = '1000'.
                      ls_knvv-vtweg             = '01'.
                      ls_knvv-spart               = '01'.
                        CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'
                              EXPORTING
                                i_kna1                        = ls_kna1
                                i_knvv                        = ls_knvv
                                i_bapiaddr1                   = ls_bapiaddr1
                                i_maintain_address_by_kna1    = 'X'
                               i_no_bank_master_update       = 'X'
                               i_raise_no_bte                = 'X'
                                pi_postflag                   = 'X'
                               i_from_customermaster         = 'X'
                              IMPORTING
                                e_kunnr                       = lv_kunnr
                                o_kna1                        = ls_kna1_output
                              EXCEPTIONS
                                client_error                  = 1
                                kna1_incomplete               = 2
                                knb1_incomplete               = 3
                                knb5_incomplete               = 4
                                knvv_incomplete               = 5
                                kunnr_not_unique              = 6
                                sales_area_not_unique         = 7
                                sales_area_not_valid          = 8
                                insert_update_conflict        = 9
                                number_assignment_error       = 10
                                number_not_in_range           = 11
                                number_range_not_extern       = 12
                                number_range_not_intern       = 13
                                account_group_not_valid       = 14
                                parnr_invalid                 = 15
                                bank_address_invalid          = 16
                                tax_data_not_valid            = 17
                                no_authority                  = 18
                                company_code_not_unique       = 19
                                dunning_data_not_valid        = 20
                                knb1_reference_invalid        = 21
                                cam_error                     = 22
                                OTHERS                        = 23.
                            IF sy-subrc = 0.
                              EXPORT kunnr FROM lv_kunnr TO MEMORY ID 'Z_CUST_NUM'.
                              EXPORT adrnr FROM lv_adrnr TO MEMORY ID 'Z_ADDR_NUM'.
                            ENDIF.
    When I am executing this through SE37, its working perfectly. However when used in Sales Order Save exit, its throwing an error saying SY-Subrc = 22(CAM_ERROR).

  • Creating a business partner using data from a remote legacy system

    Hi Experts,
    I am trying to make an interface for creating a business partner in SAP CRM from customer data created in a remote legacy system. I want to map the fields in XI.
    But to create a customer I need a RFC or a BAPI or maybe an IDoc, that includes all fields for business partner creation and can create a new business partner from the data.
    I have identified an RFC that have the structure of the BDoc BUPA_MAIN. This RFC is called: CRM_BUPA_MAIN_CRM_IN
    But I am not sure if that RFC can be used for Business Partner creation.
    Can anyone tell me if that RFC can be used, or if there are other RFC's, BAPI's or IDoc's that can be used for remote creation of business partners (they have to include all fields of the Business Partner)??
    There are a few BAPI's that include some of the fields for BP creation, but making several calls to different BAPIs from XI to CRM is not an option (I thought the BAPI: BAPI_BUPA_FS_CREATE_FROM_DATA could have been used, but it lacks some of the data fields needed for creating BPs).
    Thanks in advance,
    Torsten
    Edited by: Torsten Sander on Apr 22, 2008 2:48 PM

    Hi Experts,
    I am trying to make an interface for creating a business partner in SAP CRM from customer data created in a remote legacy system. I want to map the fields in XI.
    But to create a customer I need a RFC or a BAPI or maybe an IDoc, that includes all fields for business partner creation and can create a new business partner from the data.
    I have identified an RFC that have the structure of the BDoc BUPA_MAIN. This RFC is called: CRM_BUPA_MAIN_CRM_IN
    But I am not sure if that RFC can be used for Business Partner creation.
    Can anyone tell me if that RFC can be used, or if there are other RFC's, BAPI's or IDoc's that can be used for remote creation of business partners (they have to include all fields of the Business Partner)??
    There are a few BAPI's that include some of the fields for BP creation, but making several calls to different BAPIs from XI to CRM is not an option (I thought the BAPI: BAPI_BUPA_FS_CREATE_FROM_DATA could have been used, but it lacks some of the data fields needed for creating BPs).
    Thanks in advance,
    Torsten
    Edited by: Torsten Sander on Apr 22, 2008 2:48 PM

Maybe you are looking for