<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: cmd_ei_api=&amp;gt;maintain_bapi adding contact to existing customer in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cmd-ei-api-gt-maintain-bapi-adding-contact-to-existing-customer/m-p/8378869#M1642665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem seems to be that the method does not get a new number for the PERNR field in the KNVK table.  I did the following which essentially, gets a new number and assigns it to the PERNR field.  Not ideal as I feel the method should be doing this for me as it does get a new seuqence number for the Customer Master Record.  We really need SAP or Alain Bacchi to answer.  Here is a snippet of code that I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;              nr_range_nr                   = 'AP'&lt;/P&gt;&lt;P&gt;              object                        = 'PARTNER'&lt;/P&gt;&lt;P&gt;              QUANTITY                      = '1'&lt;/P&gt;&lt;P&gt;              SUBOBJECT                     = ' '&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          TOYEAR                        = '0000'&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;         IGNORE_BUFFER                 = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;            IMPORTING&lt;/P&gt;&lt;P&gt;              NUMBER                        = PARNR&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          QUANTITY                      =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          RETURNCODE                    =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           EXCEPTIONS&lt;/P&gt;&lt;P&gt;              INTERVAL_NOT_FOUND            = 1&lt;/P&gt;&lt;P&gt;              NUMBER_RANGE_NOT_INTERN       = 2&lt;/P&gt;&lt;P&gt;              OBJECT_NOT_FOUND              = 3&lt;/P&gt;&lt;P&gt;              QUANTITY_IS_0                 = 4&lt;/P&gt;&lt;P&gt;              QUANTITY_IS_NOT_1             = 5&lt;/P&gt;&lt;P&gt;              INTERVAL_OVERFLOW             = 6&lt;/P&gt;&lt;P&gt;              BUFFER_OVERFLOW               = 7&lt;/P&gt;&lt;P&gt;              OTHERS                        = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add partner type 20&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            wa_contacts-task           = gc_insert.&lt;/P&gt;&lt;P&gt;            wa_contacts-data_key-parnr = PARNR.&lt;/P&gt;&lt;P&gt;            wa_contacts-data-pafkt     = '20'.&lt;/P&gt;&lt;P&gt;            wa_contacts-datax-pafkt    = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_contacts-address_type_1 = ''.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_contacts-address_type_2 = ''.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_contact_addr-fullname   = CUST-NAME.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            wa_contact_addr-firstname  = CONTACT-FIRSTNAME.&lt;/P&gt;&lt;P&gt;            wa_contact_addrx-firstname = 'X'.&lt;/P&gt;&lt;P&gt;            wa_contact_addr-lastname   = CONTACT-LASTNAME.&lt;/P&gt;&lt;P&gt;            wa_contact_addrx-lastname  = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Assign address data directly&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            wa_contacts-address_type_3-task  = gc_insert.&lt;/P&gt;&lt;P&gt;            wa_contacts-address_type_3-postal-data  = wa_contact_addr.&lt;/P&gt;&lt;P&gt;            wa_contacts-address_type_3-postal-datax = wa_contact_addrx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;e-mail address&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            wa_econtact-task = gc_insert.&lt;/P&gt;&lt;P&gt;            wa_econtact-data-std_no = 'X'.&lt;/P&gt;&lt;P&gt;            wa_econtact-data-e_mail = CONTACT-E_MAIL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_econtact-datax-std_no = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_econtact-datax-e_mail = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            wa_smtp-current_state = ' '.&lt;/P&gt;&lt;P&gt;            wa_smtp_st-contact = wa_econtact.&lt;/P&gt;&lt;P&gt;            append wa_smtp_st to wa_smtp-smtp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            wa_contacts-address_type_3-communication-smtp = wa_smtp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_contacts-contact_texts  = ''.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            append wa_contacts to it_contacts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2011 14:35:27 GMT</pubDate>
    <dc:creator>Stephen3</dc:creator>
    <dc:date>2011-11-18T14:35:27Z</dc:date>
    <item>
      <title>cmd_ei_api=&gt;maintain_bapi adding contact to existing customer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cmd-ei-api-gt-maintain-bapi-adding-contact-to-existing-customer/m-p/8378867#M1642663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the method cmd_ei_api=&amp;gt;maintain_bapi working and creating customers.  I have written a custom FM to wrap around maintain_bapi o add contact people to an existing customer.  I have it partially working.  I can add a contact but the KNVK-PERNR number is blank after adding the contact.  This means I cannot add a 2nd contact person.  If I add the contact to the customer using t-code XD02, the PERNR field is correctly filled in by SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to get the method to create a pernr number?  I have set the customer master task to 'M'odify and the contact task to 'I'.  When I set the customer master task to 'I', I correctly get an error that the customer already exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 22:27:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cmd-ei-api-gt-maintain-bapi-adding-contact-to-existing-customer/m-p/8378867#M1642663</guid>
      <dc:creator>Stephen3</dc:creator>
      <dc:date>2011-11-16T22:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: cmd_ei_api=&gt;maintain_bapi adding contact to existing customer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cmd-ei-api-gt-maintain-bapi-adding-contact-to-existing-customer/m-p/8378868#M1642664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Stephen Herlick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you solve your problem? I meet the same problem now. Can you share your solution. Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 04:11:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cmd-ei-api-gt-maintain-bapi-adding-contact-to-existing-customer/m-p/8378868#M1642664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-18T04:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: cmd_ei_api=&gt;maintain_bapi adding contact to existing customer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cmd-ei-api-gt-maintain-bapi-adding-contact-to-existing-customer/m-p/8378869#M1642665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem seems to be that the method does not get a new number for the PERNR field in the KNVK table.  I did the following which essentially, gets a new number and assigns it to the PERNR field.  Not ideal as I feel the method should be doing this for me as it does get a new seuqence number for the Customer Master Record.  We really need SAP or Alain Bacchi to answer.  Here is a snippet of code that I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;              nr_range_nr                   = 'AP'&lt;/P&gt;&lt;P&gt;              object                        = 'PARTNER'&lt;/P&gt;&lt;P&gt;              QUANTITY                      = '1'&lt;/P&gt;&lt;P&gt;              SUBOBJECT                     = ' '&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          TOYEAR                        = '0000'&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;         IGNORE_BUFFER                 = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;            IMPORTING&lt;/P&gt;&lt;P&gt;              NUMBER                        = PARNR&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          QUANTITY                      =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          RETURNCODE                    =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           EXCEPTIONS&lt;/P&gt;&lt;P&gt;              INTERVAL_NOT_FOUND            = 1&lt;/P&gt;&lt;P&gt;              NUMBER_RANGE_NOT_INTERN       = 2&lt;/P&gt;&lt;P&gt;              OBJECT_NOT_FOUND              = 3&lt;/P&gt;&lt;P&gt;              QUANTITY_IS_0                 = 4&lt;/P&gt;&lt;P&gt;              QUANTITY_IS_NOT_1             = 5&lt;/P&gt;&lt;P&gt;              INTERVAL_OVERFLOW             = 6&lt;/P&gt;&lt;P&gt;              BUFFER_OVERFLOW               = 7&lt;/P&gt;&lt;P&gt;              OTHERS                        = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add partner type 20&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            wa_contacts-task           = gc_insert.&lt;/P&gt;&lt;P&gt;            wa_contacts-data_key-parnr = PARNR.&lt;/P&gt;&lt;P&gt;            wa_contacts-data-pafkt     = '20'.&lt;/P&gt;&lt;P&gt;            wa_contacts-datax-pafkt    = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_contacts-address_type_1 = ''.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_contacts-address_type_2 = ''.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_contact_addr-fullname   = CUST-NAME.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            wa_contact_addr-firstname  = CONTACT-FIRSTNAME.&lt;/P&gt;&lt;P&gt;            wa_contact_addrx-firstname = 'X'.&lt;/P&gt;&lt;P&gt;            wa_contact_addr-lastname   = CONTACT-LASTNAME.&lt;/P&gt;&lt;P&gt;            wa_contact_addrx-lastname  = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Assign address data directly&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            wa_contacts-address_type_3-task  = gc_insert.&lt;/P&gt;&lt;P&gt;            wa_contacts-address_type_3-postal-data  = wa_contact_addr.&lt;/P&gt;&lt;P&gt;            wa_contacts-address_type_3-postal-datax = wa_contact_addrx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;e-mail address&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            wa_econtact-task = gc_insert.&lt;/P&gt;&lt;P&gt;            wa_econtact-data-std_no = 'X'.&lt;/P&gt;&lt;P&gt;            wa_econtact-data-e_mail = CONTACT-E_MAIL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_econtact-datax-std_no = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_econtact-datax-e_mail = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            wa_smtp-current_state = ' '.&lt;/P&gt;&lt;P&gt;            wa_smtp_st-contact = wa_econtact.&lt;/P&gt;&lt;P&gt;            append wa_smtp_st to wa_smtp-smtp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            wa_contacts-address_type_3-communication-smtp = wa_smtp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       wa_contacts-contact_texts  = ''.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            append wa_contacts to it_contacts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 14:35:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cmd-ei-api-gt-maintain-bapi-adding-contact-to-existing-customer/m-p/8378869#M1642665</guid>
      <dc:creator>Stephen3</dc:creator>
      <dc:date>2011-11-18T14:35:27Z</dc:date>
    </item>
  </channel>
</rss>

