Creating BusinessPartner with both mail to and bill to address

Hi,
I am having problem creating a business partner with both mail to and bill to address. I want to create two instances (lines) in BPAddresses; one with mial to address and another with bioll to address. But I still get the error code -5002 with the message "Address is empty [OCRD: CardCode} line:1"
Below is my code in C#:
SAPbobsCOM.BusinessPartners bp = (SAPbobsCOM.BusinessPartners) conn.InternalConnection.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners);
               bp.CardName = "Test Tester";
               bp.CardType = SAPbobsCOM.BoCardTypes.cCustomer;
               bp.CardCode = "TEST29";
               bp.Address = "1305 Blue Raven Blvd";
               bp.City = "Citrus Height";
               bp.Country = "US";
               bp.BillToState = "CA";
               bp.ContactPerson = "Peter Snicker";
               bp.Currency = "USD";
               bp.ZipCode ="94521";
               string errMsg;
               int errCode;
               int returnval = bp.Add();               
               if(0 != returnval){
                    conn.InternalConnection.GetLastError(out errCode, out errMsg);
                    Console.WriteLine(errMsg);
                    return;
               string cardCode;
               conn.InternalConnection.GetNewObjectCode(out cardCode);
               //Console.WriteLine("Added BP successfully",cardCode);
               bp.GetByKey(cardCode);
               bp.Addresses.Add();
               bp.Addresses.SetCurrentLine(1);
               bp.Addresses.AddressType = SAPbobsCOM.BoAddressType.bo_ShipTo;
               returnval = bp.Update();
               if(0 != returnval){
                    conn.InternalConnection.GetLastError(out errCode, out errMsg);
                    Console.WriteLine(errMsg);
                    return;
I would appreciate if anyone can help me with this problem.
Thank you in advance,
Sunny

Hi Sunny,
The reason for your error is that you're trying to add a blank ship to address.
bp.Addresses.AddressType = SAPbobsCOM.BoAddressType.bo_ShipTo;
returnval = bp.Update();
you are just specifying a type and then trying to update. If you want to add another line, you have to set some properties, like:
bp.Addresses.AddressType = SAPbobsCOM.BoAddressType.bo_ShipTo;
bp.Addresses.AddressName = "My Address";
etc...
etc...
returnval = bp.Update();
Hope it helps,
Adele

Similar Messages

  • How Create infotypes with both transaction pm01 and ppci

    HI Gurus,
    I need create custem  infotypes by using the pm01 and ppci .
    requirement is  i need to create two custem  infotypes  with subtyeps in personal administration and personal planing .
    1.can any provide step by step in to create the custem infotypes in pm01 and ppci.
    2. how to create sub types also.
    Regards
    Ramesh.
    Thanks in advance

    Steps to create a HR Infotype:
    1) Go to Transaction PM01.
    2) Enter the custom Infotype number which you want to create (Should be a 4 digit number, start with 9).
    3) Select the 'Employee Infotype' radio button.
    4) Select the 'PS Structure Infotype'.
    5) Click on Create... A separate table maintenance window appears...
    6) Create a PS structure with all the fields you want on the Infotype
    7) Save and Activate the PS structure
    8) Go back to the initial screen of PM01.
    9) Click on 'All' push button. It takes a few moments.
    10) Click on 'Technical Characteristics'. Infotype list screen appears
    11) Click on 'Change'(pencil) button
    12) Select your Infotype and click on 'Detail' (magnifying glass) button
    13) Give 'T591A' as subtype table
    14) Give 'T591S' as subtype txt tab
    15) Give your subtype field as subtype field
    16) Save and come back to PM01 initial screen
    17) Click on 'Infotype Characteristics' ... Infotype list screen appears
    18) Click on 'Change' (pencil) button
    19) Click on 'New Entries'
    20) Enter your Infotype number and short text
    21) Here we have to set different Infotype Characteristics as per the requirement. (Better open another session with some standard Infotype's infotype characteristics screen and use as the reference to fill yours)
    22) Save your entries.
    23) Now the Infotype is created and ready to use.
    24) If you want to change the layout of the Infotype as per your requirement...
    25) In the PM01 initial screen...Select 'Screen' radio button and give 2000 as the screen name, then click on edit.
    26) In the next screen.. Select 'Layout Editor' and click 'Change'.
    27) Screen default layout appears...here you can design/modify the screen..change the attributes of the fields..etc.
    28) Save and activate. (Don't forget to 'Activate at every level)

  • Synchronizing n900 with Google Mail, Calendar, and...

    I was unable to find any instructions on how to sync Google Mail, Calendar, and Contacts with my n900.  So, I tried using the instructions for the Symbian v3/v5 phones.  Two of three were successful.  One of the successes does have a catch.  So others don't have to spend the time I did experimenting here are the instructions for synchronizing Google Mail, Calendar, and Contacts with the n900 firmware v1.2009.42.11.
    Gmail sync settings can be created on the n900 by either:
    A.  Activating the mail wizard by clicking on the "email" icon for the first time.
    or
    B.   Within the "Settings" menu in the "Email" submenu press on the top status bar with "E-mail" pulldown and another submenu with a "New account" button will appear.
    After you input your Gmail e-mail address most of the fields will populate themselves.  In fact, almost ALL the fields will automatically populate themselves (finally effortless mail!). Just in case, check these settings:
    For incoming server: port 993
    For outgoing server: port 465
    Calendar AND contacts sync settings can be created by:
    1st  Open settings menu.
    2nd  Open "Email for Exchange" submenu.
    3rd  Filling in the fields as:
    a. Server: m.google.com
    b. Port: 443
    c. Secure connection: check yes
    d. Conflict resolution: your choice
    e. User name:  [email protected]
    f. Password: your password
    g. Domain: leave blank
    h. Synchronize e-mail:  leave unchecked.
    i. Synchronize calendar and tasks: check yes.
    k. Calendar:  N900 (to populate existing calendar) or create a new one
    j. Synchronize calendar back:  your choice
    k. Synchronize completed tasks:  your choice
    l. Synchronize contacts:  check yes
    m. First synchronization: your choice
    A note of caution:  For this sync to work your calendar must be empty.  If you have already used the synchronization tool to transfer the calendar data from your old phone to your n900 it will not allow you to write the Google calendar data from the server into it. The n900 calendar will remain as a local, unsynchronized calendar and you must create another calendar for synchronization purposes.  However, I believe this is not the best way to go.  Instead, if you have already transferred your calendar data from your old phone open the n900's calendar, select all, and delete.  Then the Google server will synchronize its data with the N900 calendar.

    There you go. notice that email address and password are not real ones in this description
    Here's what is happening with google
    Page 1
    E-mail address: [email protected]
    User name: [email protected]
    Password: mycorrectgooglepassword
    Domain:
    ...next...
    Page 2
    Server: m.google.com
    Port: 443
    Secure connection: checked
    ...next...
    ERROR. EITHER EXCHANGE SERVER REQUIRES SECURE CONNECTION OR ACCOUNT IS DISABLED
    Here's what is happening with nuevasync
    Page 1
    E-mail address: [email protected]
    User name: mynuevasyncusername
    Password: mycorrectnuevasyncassword
    Domain:
    ...next...
    Page 2
    Server: www.nuevasync.com
    Port: 443
    Secure connection: checked
    ...next...
    ERROR. EITHER EXCHANGE SERVER REQUIRES SECURE CONNECTION OR ACCOUNT IS DISABLED
    My guess is that the result will be always the same
    Message Edited by laroma on 20-Dec-2009 08:58 PM

  • Can I use my iPod with BOTH a Mac and PC???

    Might be an odd question and forgive me if it is an obvious answer. I just got a 30 gigger and connnected it up and charged it with my Mac mini at home last night. I have lots of music on my iTunes on my home Mac mini and I have some music on my work Dell Laptop(with iTunes). What would be the best way to sync up my two iTunes libraries (one on my Mac, the other on the Dell lapper) to the iPod, or is it even possible to use it interchangeably with both the Mac and PC??

    Yes, you can.
    Read through the following article, and make sure your iPod is Windows-formatted using the iPod Updater utility on Windows.
    http://docs.info.apple.com/article.html?artnum=61675

  • Airport Utility `install failed' error with both 6.0 and 6.1

    Hi folks
    I am running Mac OS X Lion 10.7.4 (11E53) and cannot get the Airport Utility to run at all. [5.5.3] The application icon flickers as though it is about to launch and then nothing happens.
    I have tried other 5.x downloads and they all fail because I am running OS X Lion 10.7.4.
    Doing a standard Software Update or using a download of 6.x from the Apple Support site, the installer comes up with an `install failed' error with both 6.0 and 6.1, having gotten through the complete process and looking like they were `successful'.
    It's the only time in two years and many updates later that i have come across this issue, so I am unsure how to start to tackle it.
    Any ideas or suggestions please?
    Thanks in advance.

    Welcome to Apple Communities
    Backup your files and try this:
    1. Reboot from recovery partition (or as in my case USB recovery drive)
    2. Select Re-install Mac OS X
    3. Allow the process to run through multiple restarts
    4. When reinstall process is complete run software update (side note, my software update would not launch as long as my USB recovery stick was plugged in, weird)
    5. Run all updates saving the Airport Utility 6.0 until last.
    6. Install the airport utility from software update.

  • My keyboard and mouse are connected via bluetooth to my iMac, both work. but under network preferences bluetooth PAN is showing with a yellow dot and no ip address. is this normal?

    my keyboard and mouse are connected via bluetooth to my iMac, both work. but under network preferences bluetooth PAN is showing with a yellow dot and no ip address. is this normal?

    Yes.
    Bluetooth PAN refers to a BT personal area network
    http://en.wikipedia.org/wiki/Personal_area_network
    Barry

  • Customer with same Sold to and Bill to

    Hello Friends,
                           Is there a table in SAP which tells if given customer is both Sold to and Bill to  ? I want to know the SAP table which tells me if a given cusotmer is both Sold to and Bill to .
    Thank you

    Customer partners are maintained in table KNVP.
    thanks,

  • MOVED: [Athlon64] Failed Bios update with both Live Update and Dos version = badchecksum shutdown

    This topic has been moved to AMD64 nVidia Based board.
    [Athlon64] Failed Bios update with both Live Update and Dos version = badchecksum shutdown

    Sometimes bios recovery is a long shot .
    But the award bios v.6 is supposed to be able to do it if the bootblock is still intact.
    Best way seems to be to strip it down to minimal configuration , disconnect all drives except floppy , one ram module , perhaps without video card also .
    Look here :
    http://pages.sbcglobal.net/jefn/bootblock.html

  • HT4898 What happens to my "Dock"?  I use that every time I open my computer(s), along with various mail accounts, and even the Widgets?.

    What happens to my "Dock"?  I use that every time I open my computer(s), along with various mail accounts, and even the Widgets?.  Thanks.

    Using iCloud will not affect your dock or your widgets. If you upgrade to iCloud, your MobileMe mail account will be updated to an iCloud account, but that is all that will happen. What exactly is it that you are worried about.

  • Could a 2012 macbook pro from the factory been loaded by the factory with both Snow Leopard AND OSX Lion?

    could a 2012 macbook pro from the factory been loaded by the factory with both Snow Leopard AND OSX Lion?

    I think MBPs stopped coming with Snow Leopard installed as of the late-2011 models. That's when OS X Lion started being pre-installed on MBPs. Some earlier MBP models (2010, early-2011) had a firmware update to allow Internet Recovery (command+option+r) which would allow a reinstall of OS X Lion (purchased from the App Store) with the purchaser's AppleID/password.
    I don't believe SL would even install on a 2012 MBP.

  • Audio sounds damaged. I have tried with both built in and external speakers.

    Audio sounds damaged. I have tried with both built in and external speakers. I think its a problem with a driver or something.

    Try a PRAM reset:
    http://support.apple.com/kb/HT1379
    Ciao.

  • My iphone is not syching at itunes. Everytime it says your iphone as been diconnected whenever I try to synch it, while logo on phone and itunes says it is still connected. help I have this problem with both my Iphone4 and Iphone5 with backup as well

    My iPhone is not synching at iTunes. Every time it says your iPhone as been disconnected whenever I try to synch it, while logo on phone and iTunes says it is still connected. help I have this problem with both my Iphone4 and Iphone5. This problem is with the back up as well.

    Hi singhgurwinder79,
    The article linked below provides details that can help troubleshoot this error and get your iPhone to sync correctly with iTunes.
    iTunes: Resolve USB-related alerts
    http://support.apple.com/en-us/HT203843
    Regards,
    Allen

  • Ship to and bill to address

    Hi experts
    I am newly installed sap bone 2005B version.I using OEC computers.I creadted one customer with ship to and bill to address. but in that address is not come in print lay out.
    I selected database and given Bill to address in respective area.
    what is the reason?
    pls tell me
    regards

    Hi
    1. yes
    2. system PLD also
    3. yes i changed my PLD but it will not come
    Now i understood the correct one, the customer bill to address not come in the invoice logistics part.
    I create the customer this also not come in the Logistics bill to address part as well as ship to address.
    what should i do?
    regards

  • Restricting SHIP TO and BILL TO address in VD02

    Hi
    Does anybody have idea on how we can restrict accessing certain user community to change Ship to and Bill To address in VD02. Any thoughts on this will be helpfull.
    Thanks
    KV

    Alex
    <b>Thanks for your input.</b>
    After creating a Field Grp in IMG how can associate the Field Grp to the <b>F_KNA1_AEN</b> auth object. I have create the field Group in SPRO (IMG) via Financial Accounting -> Accounts Payable and Accounts Receivable -> Customer Accounts -> Master Data -> Prepare Changes to Customer Master Data -> Define Field Groups for Customer Master Data.
    Please let me know your thougts on this if this is correct what im doing.
    Thanks
    KV

  • HT201342 Can is use both the @icloud and @me email addresses?

    Can is use both the @icloud and @me email addresses?

    Yes, your previous @me email will continue to function as before.

Maybe you are looking for