Skip to Content

Creating Custom BO Instance in ABSL from Standard BO Event

HI all,

am developing custom Business object which contains entries or records from Opportunity BO extended TAB.

i have created before-save event, and query on custom Bo to check the consistence.

var query_customer = CustomLG.QueryByElements;

var selparam = query_customer.CreateSelectionParams(); selparam.Add(query_customer.OpportunityID , "I", "EQ", this.ID.content);

var result = query_customer.Execute(selparam);

if (result.Count() == 0) {

var customerRoot : elementsof CustomLG;

customerRoot.OpportunityID = this.ID.content ;

customerRoot.LgStatus = "Requested" ;

customerRoot.LgAmountData.content = this.LgAmount.content ; customerRoot.LgAmountData.currencyCode = this.LgAmount.currencyCode ;

could you please suggest a solution to create statement which adds instance entry using this data??

best Regards,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 15, 2017 at 08:10 AM

    Hi,

    I'm not sure if I got your problem right but if your problem is to create an instance of CustomLG with the given data see the following line.

    var newCreatedInstance = CustomLG.Create(customerRoot);

    Best regards

    Tobias

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Motaz,

      based on the heading you want to create an instance of your custom BO CustomLG where the data is populated from the SAP BO Opportunity?

      Then this should do the work:

      var CustomLGRootData : elementsof CustomLG;
      CustomLGRootData.??? = this.???;
      ...
      var CustomLGRootNode = CustomLG.Create( CustomLGRootData );

      Please replace the "???" with the resp. elements of your CustomBO and the SAP BO.

      HTH,
      . Horst