cancel
Showing results for 
Search instead for 
Did you mean: 

Executing model : deep structure in importing parameter of RFC

rakesh_kumar2
Advisor
Advisor
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

rakesh_kumar2
Advisor
Advisor
0 Kudos

Hello Bertram,

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

Regards,

Rakesh

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

sid-desh
Advisor
Advisor
0 Kudos

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