cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to change the partner of a opportunity in customBO?

63abapdeveloper
Explorer
0 Kudos
390

Hey guys,

I created a new custom BO. There I can read and change data from the customer like this:

 

lr_bezN = gp_von.Relationship.Where(n => n.NodeID == lv_node);
lr_bez = lr_bezN.GetFirst();
if (lr_bez.IsSet() == false){this.status = "3"; return; } //fehler beim verarbeiten
neueBez_NodeData.DistributionChannelCode.content = lr_bez.DistributionChannelCode.content ;
neueBez_NodeData.DivisionCode.content = lr_bez.DivisionCode.content;
neueBez_NodeData.RelationshipBusinessPartnerInternalID = lr_bez.RelationshipBusinessPartnerInternalID;
neueBez_NodeData.RelationshipBusinessPartnerUUID.content = lr_bez.RelationshipBusinessPartnerUUID.content;
neueBez_NodeData.RoleCode.content = lr_bez.RoleCode.content;
neueBez_NodeData.SalesOrganisationUUID.content = lr_bez.SalesOrganisationUUID.content;
var neueBez = gp_to.Relationship.Create(neueBez_NodeData);
if	(neueBez.IsSet()){
}else{
failure = true;
}

 

Now I read all opportunities from a customer

 

var x = gp_von.InternalID;
var OppyVon = Opportunity.QueryByElements;
var OppyVon_SelParams = OppyVon.CreateSelectionParams();
OppyVon_SelParams.Add(OppyVon.PartyPartyKey.PartyID.content, "I", "EQ", x);
var OppyVon_Results = OppyVon.Execute(OppyVon_SelParams);
//my Opportunity
var opportunity2 = OppyVon_Results.Where(n => n.NodeID == lv_node);

 

There are some results, but when I try to change the party from the opportunity..its read only.

When I try to create a opportunity, I got the failure with cross-deployment unit:

63abapdeveloper_0-1732722983839.png

Has anybody an idea how to change the customer from the opportunity?

By creating Instance, I got this errors:

63abapdeveloper_1-1732723314372.png

KR

 

Accepted Solutions (1)

Accepted Solutions (1)

dominik_g
Participant

Hi 63abapdeveloper ,

you need to assign your custom BO to a different deployment unit as shown in my screenshot

In fact, to the deployment unit of the Opportunity BusinessObject which is CustomerRelationshipManagement.

 

dominik_g_2-1732816310712.png

 

 

By default, the deployment unit of your custom BO is the deployment unit that you selected when you created the solution.

 

dominik_g_0-1732816214428.png

 

Add annotation [DeploymentUnit(CustomerRelationshipManagement)] in the .bo definition file.

 

As documented here https://help.sap.com/docs/SAP_CLOUD_APPLICATIONS_STUDIO/cbcebe3cfb1647a8b0322c18dbb0b481/7299254173e... 

63abapdeveloper
Explorer
Thank you very much. Now are the fields changeable.

Answers (0)