Today’s era is a technological era. In today’s world newer languages, tools and technologies emerge and vanish day in and day out and hence the main challenge for any tools or technologies is to maintain their strength over others. SAP is one of those who succeed to maintain there strength.
Writing code is easy but writing a good optimized code is very hard.Within this blog you will find about important concepts and practical guidelines for building state-of-the-art freestyle SAP Web Dynpro user interfaces.
The first and foremost important part of any application development is to find out which code belongs to which part and should be kept in which part, so that unnecessary jumps and overhead should be reduced.
How to separate business logic?
As a beginner most of you have used to stored quite much logic in your main component controller. Instead of this you can separate reusable logic away from the component to assistance class and to other business classes as seen on the following illustration.
This way you can use business routines again or even change/copy assistance class for another purpose.
How to create simple lightweight interface views?
Create User interfaces that are simple, easy to understand for user and must be light weight. Always use a standard naming convention for UI elements. Firstly implement context elements before UI creation. The Web Dynpro wizard can then be utilized to generate elements, minimizing UI development overhead. Try to reduce the code from your view part instead put it in common controller, it will not only help you to reduce your application’s complexity but also make your views more Lightweight. According to good SAP practice, most of your coding part must be present in Invisible Controller i.e your Component Controller.
How to simplify context reading/writing?
Context generation is most important part of any Web Dynpro application because it directly deals with your data.Following points definitely help you to create good context elements.
– A standard naming convention should be used for context nodes and elements.
– Try to avoid multiple trips to the database or other external objects to access data by holding a larger dataset in the Context’s memory. Store data transparently by using the Context rather than buffering through ABAP or Java methods.
– You can populate the context data via Supply Functions rather than embedding code in initialization methods.
– Always create standard context nodes in the Component Controller and map to views. 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.
Points to remember while creating a Method/Action :
– Always use a standard naming convention for the method/action.
– Methods that are frequently called/used should be kept in common part of the application say a common class or a common controller.
– Context elements that are frequently called for updates can be encapsulated in a method, it will help to reduce considerable amount of code needed.
Try above tips it will help you to generate a good Web Dynpro Application.
Have a question on this topic ? Please read more here.
In case you need assistance on SAP Support Services, please contact us. Please send us your questions, comments or assistance request and our team would be glad to assist you.
By Dhiraj Wasane (on behalf of SAP Consulting Team)
SAP :: Streamlined
We offer variety of services including SAP ECC ,SAP HR,SAP BW,SAP CRM, SAP SCM,SAP BPM, Business Objects, SAP ABAP Development, SAP BASIS and SAP NetWeaver consulting. We have expertise in providing implementation,development, SAP Migration and SAP support services to SAP customers across diverse industries at a global level.
Have a question on SAP? Write to our SAP Architect : AskTheArchitect@Apprisia.com
(We promise a no-obligation consulting reply)