cancel
Showing results for 
Search instead for 
Did you mean: 

How to Pass Value from Element in XBO to ExtenSion field Created in Adaptation Mode?

Former Member
0 Kudos

Dear SAP,

I am actually working on a Webservice for Contract Creation

I Would also like to load new Extension Fields in the Customer Contract.

The purpose of that matter is that I Would like to keep a standard Adaptation Mode liste where values would be maintened in the system. We assume that same values will be pushed with the Webservice.

I have for that added some Elements in a Business Object Extension like below :

I would now like to make an After-Modify Event, Where this.(Nameofextensionfield) = this.extensionelement zone.

Here is a sample of Code that I have started with, but This is not working and is causing a backend issue when I try to create a new contract.

Is there any difference when doing this in a Item Node? ANy tips? Is there any loop to do and how?


Best regards,

Victor

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member200567
Active Contributor

Dear Victor,

1. You should write the code in the After-Modify event of Item node. (you can enhance this event script same as you did for root node.)

this.OperatorReftype = this.extenisonzoneitem1;

Accessing the elements of the first Item instance from root node (After-Modify) will give UI dumps if no item instance has been created yet.

This code this.Item.GetFirst().OperatorReftypewill give UI dumps if there is no item instance yet.

2.If you really need to write this in the After-Modify event of the root node. You can write like this:

foreach(var item in this.Item){

item.OperatorReftype = item.extenisonzoneitem1;

}

3. Be careful with the size of the assigning element. If the size of the assigning element is greater than that of the assigned element, system might give UI dumps.

Best Regards,

Fred

Former Member
0 Kudos

Dear Fred,

I just entered your code and it has debugged the system, I thank you a lot for this

However, this is not working when I use the root Node solution, even after modifying Root elements.

The value from the Extension List is not transfered to the Extensionzoneitem1.

Do you have any idea why?

I will try with the after Modify Item Node if I can not solve it in the root node. The Main reason is that I will have several extension zones in the Root Node as well, and would like to code everything in the main script (like you can see in my BO Declaration)

Any help on this topic ls welcome,

Best regards,

Victor