Skip to Content
author's profile photo Former Member
Former Member

Issue creating Customer BO instance

I had the Customer.Create() method released to one of my client's test tenants.

I'm almost done with a full-blown integration to their platform, but I can't get the Customer.Create() method to work.

query_customer = Customer.QueryByIdentification; query_customer_selparam = query_customer.CreateSelectionParams(); query_customer_selparam.Add(query_customer.InternalID , "I", "EQ", this.UserID); query_customer_result = query_customer.Execute(query_customer_selparam);

if (query_customer_result.Count() == 0) { CustomerBO = Customer.Create(); CustomerBO.InternalID = this.UserID; CustomerBO.CurrentCommon.Organisation.Name.FirstLineName = this.UserName.content; }

What am I missing to create the customer? Is it the CategoryCode?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 06, 2012 at 10:29 PM

    CategoryCode didnt help. Still crashes.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 07, 2012 at 07:34 PM

    Hi Judson,

    as of FP3.5 we have a PSM docu that includes example ABSL scripts for all BO that are write enabled. Please check out the PSM docu in the business center: https://wiki.sme.sap.com/wiki/display/AMI/Help+Content+for+the+SAP+Business+ByDesign+Public+Solution+Model

    In your Customer the type code is missing, it is mandantory:

    import AP.FO.BusinessPartner.Global;

    import AP.FO.Address.Global;

    // define root node

    var elCustomerRoot: elementsof Customer;

    var newCustomer;

    // define common node - person

    var elCustomerPerson: elementsof Customer.Common.Person;

    //create root instance and set parameter CategoryCode.

    // CategoryCode = "1" = Person,

    // CategoryCode = "2" = Organization.

    elCustomerRoot.CategoryCode = "1";

    newCustomer = Customer.Create(elCustomerRoot);

    Please find the complete script in the PSM docu.

    A comment on Billys comment above: There are BOs in the PSM that are write-enabled, other BOs are read-enabled only.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Thomas Schneider

      This thread is a perfect Example of a BO that is "Write Enabled" however Create is not allowed... and the PSM documentation does not inform you of such... and Why I suggest adopting more of a CRUD schema for telling Developers what is and is not allowed.

      http://scn.sap.com/thread/3227149

      If something is not "completely write-enabled" then shouldn't the documentation reflect such limitations. It really makes it hard to scope a customization or add-on without proper knowledge of the Actual Status of a BO in the PSM

  • author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2012 at 02:35 PM

    also try

    DistributionChannelCode

    SalesOrganisationID

    I will see if I have time to do a sample program to test this out.. I too have had issues with the Customer BO..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.