I mentioned in a previous blog post that the last SAP Professional Journal issue ended up having a bit of an information management theme. It looks like the next issue is going to have a decidedly techier tone, which I'm sure out developer readership will appreciate.
That's right: We've got lots of ABAP content coming. First up is an article by James Wood, principal at Bowdark Consulting and author of the SAP PRESS book Object-Orienting Programming with ABAP Objects. The article, "Case Study: Encapsulation Design Techniques in ABAP" introduces you conceptually to encapsulation techniques, which involve capturing includes and methods within an object.
James walks you through four case studies using these techniques, giving you code samples and his thought process behind each technique. I'll share a sample of one of the case studies with you below:
Case Study 1: Isolating Business Rules
With each case study, I’ll take you through three subsections: diagnosis, observations, and solution. For the first case study, let’s imagine a scenario in which you are asked to enhance a piece of
validation logic that is applied whenever a purchase order is created in an SAP ERP system.
As you begin your investigative analysis, you quickly come to several realizations:
- The legacy documentation from both a functional and technical perspective is unclear as to where and how the business rule in question was applied
- There have been multiple enhancements applied in this area of the system already, and it is not apparent where one enhancement begins and another one ends
- It would seem that several developers worked on the original enhancement effort and, based on their transport history, they made changes to a lot of different pieces of code.
Being relentless, you eventually get to the bottom of the problem and determine that the business rule has been applied in three separate places in the system:
- Within a Business Add-In (BAdI) implementation that is executed whenever users maintain purchase orders in transaction ME21N
- Within a custom conversion program that applies the business rule as part of a pre-validation process that is executed prior to loading legacy purchase orders into the system
- Within a custom Web Dynpro for ABAP (WDA) application that provides a simplified edit mask for a certain group of buyers who enter purchase orders online in SAP NetWeaver Portal. Here, the business rule is used to validate screen input prior to creating the purchase order.