Skip to Content
avatar image
Former Member

Executing model : deep structure in importing parameter of RFC

Hi all,

I need to execute a RFC model which has a deep structure in its importing parameter. I am finding it difficult in populating the stucture.

Can some body help me in giving some input on this.

Thanks and Regards,

Rakesh Kumar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 13, 2004 at 01:00 PM

    Hallo Rakesh,

    you have to pay attention when dealing with <i>context-to-model-binding</i> in respect of <b>model object relations</b>.

    First think of a <b>model</b> as being a <i>model object graph</i> which is independent from the context. Its objects can have relations to one another.

    Then think of the <b>context</b> as being a <i>structured hierarchy</i> of nodes containing node element collections, with node elements containing inner non-singleton nodes or nodes containing a singleton child node and so on.

    <i>Context-To-Model-binding</i> at design time means, that you define bindings from model nodes in the context to model classes in the model as well as supplying relation roles in the context (nodes) based on given model class relations.

    Then a tip when dealing with models at runtime: <u>Start implementing inside the model object graph and not in the context</u>. Instantiate model objects. Fill model object collections. Add these collections to other model objects based on the given model class relations.

    Afterwards you have to set the reference between the root-level context node (element) and the root-level model object. This means you call

    wdContext.nodeCustomer().bind(customerModelObject)

    . With this method call the context model node (on root level) contains a model node element referencing the corresponding model object in the model object graph. That's all. As soon as Web Dynpro needs context data from deeper levels it follows the defined supplying relation roles, traverses the model object graph starting from the root model object and updates the references between model node elements and model objects.

    I favor a <i>first-model-then-context</i> approach when programming the context-to-model-binding:

     /* First model.*/
    
    __Model_Input input = new __Model_Input();
    __Model_Input_Table tableInput = new __Model_Input_Table();
    input.addMyTableNode(tableInput);
    
    /* Then context: add model node element (with reference to model object) to a context model  node. */
    wdContext.nodeMyNode().bind(input);

    In your case, populate the model object graph first with correctly associated model objects before binding the executable model object to the context node.

    Greetings, Bertram

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Bertram,

      Just one question here.

      __Model_Input input = new __Model_Input();

      __Model_Input_Table tableInput =

      new __Model_Input_Table();

      input.addMyTableNode(tableInput);

      The above statement adds one element to the root model object and one element to child model object below the root one.

      Incase i have to fill the "tableInput" elements based on some condition for eg number of entries in the a Table UI then should i first get the model object of the root node and then add elements as per the code or is there any other way.

      Regards

      Sidharth

      Message was edited by: Sidharth Deshpande

  • avatar image
    Former Member
    Dec 13, 2004 at 03:26 PM

    Hello Bertram,

    Thanks for this input. Now it worked for me with some additional help from you.

    Regards,

    Rakesh

    Add comment
    10|10000 characters needed characters exceeded