Skip to Content
avatar image
Former Member

How to get data from a standar BO(Customer) in a custom BO (embedded component)

Hi SAP Community.

I have a Custom BO :    Invoices.bo

Inside this BO  i have an association to to Customer

Association ToCustomer to Customer;

I have my custom BO. embedded in the customer BO.

I need the basic data from Customer in my evento - after modify in my custom BO  "invoices"

This is what i'm trying but i'm getting no data.

Thanks a lot for your help

001.jpg (72.7 kB)
002.jpg (36.0 kB)
003.jpg (58.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 02, 2015 at 08:27 AM

    Hi Ivan

    Unfortunatelly I need more information about what you are doing.

    How is the BO loaded or initialized in your embedded component?

    For the time being, I assume that the Invoices' CustomerID is filled initially when creating the Invoices-Innstance in the Embedded Component.

    In that case, your AfterModify need to look somewhat like this:

    if (this.CustomerID.IsInitial()) {

         this.ToCustomer.Reset();

    } else if (!this.ToCustomer.IsSet() || this.CustomerID != this.ToCustomer.ID) {

         this.ToCustomer = Customer.Retrieve(this.CustomerID);

    }

    Hope to help,

    Ludger

    --

    Custom development with all4cloud.de

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Rei Kasai!!!

      Thanks for you reply.

      following your suggestions i did something like this:

      and in my event i have this code:

      But i'm still having problems with the "initial value of customer id"

      and related to your suggestion:

      "1. In your Target store some some sort of key to get the Source BO. In your case will be either the UUID or Internal ID of the customer."

      the main question is ¿How to store the key of the source BO or from where can i take the key value? in order to have the id to execute the query and get the data from the customer.

      thanks again for your valuable help.

      😊

      001.jpg (77.9 kB)
      002.jpg (84.2 kB)