Friday, February 11, 2011

SAP Web Dynpro Best Practices

User Interface (UI): 

  • A standard naming convention should be used

  • Context elements should be implemented before UI creation. The Web Dynpro wizard can then be utilized to generate elements, minimizing UI development

  • Container element properties should control the layout of child elements for improved maintenance

  • Images should be incorporated on all buttons and main interaction elements to improve intuitiveness

  • Views used for popup messages should be generic. All UI elements in these views should be bound to context nodes to promote reuse


Context: 

  • A standard naming convention should be used for context nodes and elements

  • Multiple trips to the database or other external objects to access data should be avoided by holding a larger dataset in the Context’s memory

  • Store data transparently by using the Context rather than buffering through ABAP methods

  • Populate context data via Supply Functions rather than embedding code in initialization methods

  • Create standard context nodes in the Component Controller and map to Views. I normally create a context node for holding data related to properties of the views and another for holding user selection information.

  • Simple data types can be stored in Web Dynpro Attributes rather than the Context. This reduces the amount of code required for accessing the data


Methods / Actions: 

  • A standard naming convention should be used

  • Interactions with data and other external objects to the Web Dynpro application should be encapsulated in class objects, e.g. database access, execution of programs etc.

  • Use Events to trigger private methods in other Web Dynpro views rather than creating methods publicly in the Component Controller

  • Common calls to update or select context elements can be encapsulated in a method, reducing the amount of code needed

  • Validation should be performed in the view’s WDDOBEFOREACTION method. If validation fails, the cancel navigation should be called

  • Validation of UI elements should be linked to the UI element to highlight the erroneous user input

  • Use Text Symbols rather than message classes to hold literals as they offer language translation

No comments:

Post a Comment