Skip to Content
avatar image
Former Member

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

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

contrat1.png (36.7 kB)
pp8gl.png (18.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 01, 2017 at 08:02 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 01, 2017 at 08:34 AM

    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

    Add comment
    10|10000 characters needed characters exceeded