Skip to Content
avatar image
Former Member

Web Dynpro context Best Practices

Hello Experts,

While i am going through the Best Practices for optimizing web Dynpro applicaion performance document provided by SAP,there is a point which talks about best practices for Web Dynpro contexts while using ARFC models.

the point is :Donu2018t Declare Context Model Nodes and Attri- butes NOT used for Data Binding Purposes.

Further explanation for this point is:

When model data retrieved via backend connections (Adaptive RFC, Web Service, EJB) has NOT to be transferred to the user interface via data binding:

��There is no need to declare context model nodes and attributes bound to model classes and attributes for storing business data in the context.

��Just programmatically operate on model objects directly to access model data in your controller classes

By omitting the definition of a context-to-model binding relation in a controller context, the generated context interfaces are kept as slim as possible, and this reduces the permanent memory space* on server side.

Can some body explains what exactly meaning of this Best practice?

Futher to this Best Practice,i want am looking for some suggestions in my current scenario.

In Our application we have model nodes created for each RFC and we do have Value nodes which are similar to model nodes.After RFC FM is executed ,data from model nodes are copied to value nodes with some processing and these values nodes are used throughout the application.Now my webdynpro context is holding similar data with some changes in two context nodes(Model and Value).I want some suggestion on reducing memory consumption.

Thanks in Adavance.


Balaram Naidu

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Mar 19, 2009 at 03:45 AM

    Hi Balaram,

    There are various best practices for any kind of framework you are working in. I guess you already know the meaning of best practices, however, I gues you just wanted to know what is best practice for webdynpro framework.

    Best practcies is nothign but what to do what not to do while developing application to increase the efficieny of the code and make it performance effective.

    Now for your scenario:

    1) Since you have already got the modeled nodes and there is change in only 2 of your nodes therefore I would suggest not to make the copy of those modeled nodes whose data is not edited in the application.

    2) If you have some kind of the save() or flush() or comit() method exposed from the BAPI, then I guess I guess no need to make the copy of the modeled node. You can just set the values of the attributes used in the modeled node directly and then can flush use the save()/ flush() methods...

    3) However if you have some tricky modifications in the modeled node then probably you need to copy the vaue of te modeled node to value node. Make the changes to the value node. And while saving get the value from Value node and set it back to Modeled node before doing save(). This will help in removing the performance hit during the copy of elements from modeled node to value node.

    4) Youcan also make sure that once you dont require the values in Value node you just invalidate() that value node so that it does ot hold any data.

    5) Or if you want to execute the model again and get new values from the modeled node to copy into the value node. Just invalidate() the value node and then copy the elements from modeled node to value node. You need not have to use the node.removeElements() method. Inlidating the node will solve this purpose.

    There are lot of other best practices it just depends no your scenario. What may be the best practice for your case may hold good for other scenario.

    I hope this helps!!

    Thanks and Regards,


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Pravash,

      Thank you very much for detailed explanation.Still there are some points not clear time.As you suggested in our case, we can directly use model class with out going for model binding.Does that means i can directly create object for model class like BAPI_PO_GET_LIST_INPUT obj = new BAPI_PO_GET_LIST_INPUT() and call execute method.This calls RFC FM module in Back end system and returns results,using the same object we can fetch all out put parameter values as well,There out put parameter values can be copied to my values nodes,This will autmatically invalidate the model objects after method each time RFC is called,instane for input class is created and execute method is called with appropraite parameters.

      Can you plz check whether my understanding is correct or not?


      Balaram Naidu