Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Programmatically writing Involved Parties in ABSL Code

Hi Community,

we are focusing on the task of writing dinamically new Involved Parties in the ABSL Code for an Opportunity document (namespace: http://sap.com/xi/AP/CRM/Global), in a Sales Scenario. The Party Role has been correctly defined in the Business Configuration (custom code: ZSALES0100) and in the Involved Parties Configuration for the Opportunities. If we try to add manually (via UI) the Partner to the Involved Parties of an open Opportunity, that works fine.

Our question is then how to achieve the same result dinamically in the ABSL Code. For this purpose, we tried the following code:

var opportunity:BusinessObject::Opportunity;

var refOrgParty:BusinessObject::Opportunity.Party;

var elOppParty:elementsof opportunity.Party;


opportunity = Opportunity.Retrieve(this.OpportunityID);


if (bp.IsSet()) {

       elOppParty.RoleCode = "ZSALES0100";

       refOrgParty = opportunity.Party.Create(elOppParty);

       refOrgParty.Party.BusinessPartner.InternalID = bp.InternalID;

  }

but unfortunately that code leads to an exception, because the node refOrgParty.Party.BusinessPartner seems to be null. Nevertheless, we are not even able to write in the same node, because seems to be also Read Only.

Do you have any hint on how to get the desired result? It has been correct to consume the object refOrgParty?

Thanks a lot for your support.

Cheers,

Davide

Tags:
Former Member
Former Member replied

Hi Luca,

Try this:

var opportunity:BusinessObject::Opportunity;

var refOrgParty:BusinessObject::Opportunity.Party;

var elOppParty:elementsof opportunity.Party;


opportunity = Opportunity.Retrieve(this.OpportunityID);


if (bp.IsSet()) {

       elOppParty.RoleCode = "ZSALES0100";

       elOppParty.PartyKey.PartyID.content = bp.InternalID;

       refOrgParty = opportunity.Party.Create(elOppParty); 

  }
0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question