Enhancing SAP Hybris Cloud for Customer with the SAP Cloud Application Studio: Tips and Tricks1/11/2016
Get your SAP Cloud Application Studio (SDK) developments for SAP Hybris Cloud for Customer off to a good start by considering some of these tips and tricks from our SAP Cloud Application Studio Development Team. While some of them are common to all types of development, others are very specific to the SDK. 1. Custom Business Objects and variables - To ensure the right naming according to the business semantics, the business object name is constructed / chosen according to ISO 11179 naming standards.
Design your business objects on paper before you start coding in ABSL. Unless you are working with a simple BO, it is important to carry out a design exercise so you design the BO with the relevant nodes, associates and elements. Make sure variables are named consistently so that they can be understood easily e.g. customerCallType and deletionFlag. 2. Comment your code - it is important to leave clear comments so you can recall the purpose of the code and makes it easier when other people pick up your development. 3. While the Cloud Application Studio is based on Visual Studio don’t expect it to work in exactly the same way as Visual Studio. Some features such as syntax checking and debugging are not fully fledged at this stage. 4. Always check objects back in and activate them after you have finished your work as you will be locking them otherwise. 5. Always log out of the studio completely as it will not release the lock if you click on X and someone will have to clear the locks manually. 6. Use folders for Cloud Develop Studio developments. It is not currently possible to create folders after development objects have been created and move them into the new folder. It can get very messy once the list of objects grows under the solution. It is important to create a folder structure under the new solution so objects can be organised. Example below: Folder 1: BAC (Scoping Question) Folder 2: BC (Business Configuration – BC sets / BCO / BC Views) Folder 3: Extension BO Folder 3a: Sales Quote Extension Folder 3b: Opportunity Extension Folder 4: Custom BO Folder 4a: Price Functionality Folder 4a: Role Enhancement Folder 5: Web Services 7. Try to Keep all developments for a given Deployment Unit under one Solution (with folders to subdivide the developments as mentioned in 9) 8. Be aware of performance when coding in ABSL. Although HANA underpins C4C and provides reasonable performance, bad code will always slow things down. Some examples: Use ‘Retrieve’ whenever possible instead of a ‘Query’. Try not to use a Query inside a loop. Try not to use multiple nested loops. Use Global variables when possible to avoid duplication of queries and retrievals. Use Relationships and Associations when possible. The blog below provides some good points about performance optimisation of the code. http://scn.sap.com/community/business-bydesign/studio/blog/2015/08/27/sap-cloud-application-studio-performance-best-practices 9. Remember to remove trace statements as the code is executed even when the trace is inactive. This adds to the performance overhead. Also remember to remove any code such as alerts and print of variable content for debugging purposes. 10. Do it in the web Client if the feature is there. Sometimes the Cloud Application Studio offers the same functionality as the web client such as Mashup authoring. If the web client does the job – do it there, as it is simpler to maintain and deploy. 11. Use the auto code format tool so it is consistently formatted - Ctrl + (K then D) 12. You can’t delete any fields in the business object if the business configuration has been deployed as it will lead to an error. 13. Try to avoid having more than one developer working on the same business objects as they can tread on each other’s toes. 14. Try not to name your created web services too specifically; instead name them around the BO / function they perform. 15. When coding, while it is possible to have if{} all on one line; it is easier to debug if each line of code is on its own line e.g. if (p1 == -1){ WorkingCounter = WorkingCounter + 1; continue;} is ok ; but this would be better if (p1 == -1) { WorkingCounter = WorkingCounter + 1; continue; } 16. Remember that when dealing with for example, attachments, that you need to check the associated object to see if the folder exists before attaching the link. 17. While not absolutely required; always given fields in BO a label e.g. [Label("Ticket Number")] element TicketNumber:BusinessTransactionDocumentID; 18. Check SCN/YouTube which are good sources of information. If someone else has done it before, don’t reinvent the wheel.
Mithun
5/5/2017 03:13:31 pm
Thanks a lot for publish this blog and the content is very helpful for SDK developer. Comments are closed.
|
Categories
All
Archives
February 2020
|
|
© COPYRIGHT 2003 - 2022 DE VILLIERS WALTON LIMITED. ALL RIGHTS RESERVED.
SAP® Business Suite, SAP® BusinessObjects™, SAP® BW are the trademarks or registered trademarks of SAP SE in Germany and in several other countries.
|
PRIVACY POLICY |