Developing and Modifying SAP Applications
The purpose of this blog is to have knowledge of current development techniques to improve the SAP system.
The purpose of this blog is to have knowledge of current development techniques to improve the SAP system. If your development needs cannot be met with customization or personalization, you can develop the application, start a custom development project, or replace the standard SAP application. We will discuss the various development techniques that can be used to develop the SAP system, how to fundamentally apply each of the development techniques, and how to identify the available development options to adjust the standard SAP implementation.
Your customer wants to know the various options available to modify and improve the SAP system, as the SAP standard implementation does not support the customer's business requirements. As an SAP developer in the project, you should be aware of the various development techniques available in the SAP system so that you can explain the development technique, its features and benefits and use them correctly.
First, the implementation consultant on the project will try to meet customer requirements through customization or personalization. If the requirement cannot be implemented by customization or personalization, you should develop the application to see if the requirement can be met. SAP provides you with various techniques to develop the SAP system. These techniques can be implemented without changing the SAP system and therefore do not require changes during the upgrade or when you apply support packages. You should only change SAP objects if the development techniques we have mentioned do not meet the business need.
Customization
Customization is used to configure the SAP application through the reference IMG (Implementation Guide). It allows you to take a set of SAP templates for business processes and manage them to meet your business needs. You can customize some apps to define mandatory screen areas or even hide certain areas or screens from the app.
Personalization
Personalization is used to simplify SAP operations. The purpose of personalization is to set any action in the SAP application for a specific user or group of users. Personalization includes things like user menus, adding actions to your favorites menu, and shortcuts. Using them, you can turn off the screen elements and functions of the operation, thereby simplifying the operation for the user.
Enhancement
You can develop SAP applications to add your own functionality without changing the standard SAP system. SAP provides several ways to develop an application without modifying the original SAP application or program. SAP applications can be developed using one of the following techniques.
User Exits
User exits are empty subroutines provided by SAP where you can add your code. This is the oldest development technique that allows you to add to the SAP standard application without changing your programming logic. SAP will no longer provide new user exits, but you can still apply existing ones. User exits are implemented as subroutines and are sometimes called form exits. All user exits begin with USEREXIT_ and are usually collected in an include program included in the standard application. SAP calls these subroutines from the standard program. You can find user exits within a program by searching for the word USEREXIT in the application's main program. You can also find the user exits for your application in the IMG in the System Changes folder. An example of a user exit of the Sales Distribution module is shared below.
Customer Exits
Customer exits were introduced after user exits to allow him to develop not only the SAP standard code but also screens and menus. Program exits are implemented as function modules within the SAP standard program. These function modules are delivered empty; i.e, they do not contain any SAP standard code. Instead, it provides space for users to place their own logic. You can add your own functionality to the function module without changing the SAP standard implementation. Therefore, it has no effect during a system upgrade. SMOD is managed via transaction code, you can also view the current SAP enhancements catalog here.
If a customer exit is desired to be implemented, they should create a development project from the CMOD opcode. This is a way to group enhancements so they can be enabled together. A project can contain several enhancements, each of which can be a mix of program exits, screen exits, and menu exits. The following example shows a customer project with multiple exits.
Business Transaction Events
BTEs have been available since version 4.0. It is just another technique to implement program exits. It is typically found in the General Ledger Accounting (FI-GL), Accounts Receivable and Payable (FI-AR and FI-AP), and Sales Distribution components. A BTE has a predefined interface and allows you to add additional functionality in the form of a service function module. Unlike customer exits, you create the function module yourself, but this function module should have the parameters you dictate. The function module will be connected to the BTE and called at the appropriate point in the SAP standard application.
Business Add-ins (BAdIs)
BAdI is an SAP development technique based on object oriented ABAP. BAdIs, like the development techniques mentioned earlier, are predefined by SAP in standard applications. Transaction code SE18 is used to view and develop BAdI definitions. You create an interface and then the adapter class for the BAdIs that contain the definition of the methods to be supplied. In standard SAP implementation, you create an instance of the adapter class and call the corresponding method within the application. This field is where the relevant method can add its own logic. The strength of BAdIs lies in the fact that they have multiple applications. If the multiple use checkbox is selected, you can have more than one active BAdI application. When BAdI is called in the SAP standard application, the instance of the BAdI adapter class is responsible for ensuring that all applications are called. But it is not possible to guarantee the order as they can be called in any order. If you have multi-use BAdI definitions, sorting shouldn't play a big role. Similarly, you can have more than one active BAdI application for different filter values if it is filter-depended. But if you have multiple usage and filter dependencies, you can only have one active BAdI application at a time. Each BAdI can contain components for program enhancements, menu enhancements, and screen enhancements, similar to the client outputs described earlier.
There are several ways to search for BAdIs in standard SAP applications, for example: You can search for a BAdI in the corresponding application program using the CL_EXITHANDLER class. If a BAdI is called in the program, the GET_ INSTANCE static method of that class is called in the program. This method returns an instance of the BAdI adapter class, and after that you will see the BAdI method call you can apply.
ABAP Dictionary Enhancements
There are two ways to add fields to standard SAP tables without changing the tables. These are the use of append structure or customizing include.
It can create an append structure for almost any SAP table or structure. Append structure allows you to enhance SAP tables by adding customer-specific fields that are not part of the standard application without modifying the table. It is table specific; that is, an append structure can only belong to one table. However, a table can contain multiple append structures. When a table is activated, the system searches for the active append structure for that table and adds them to the database table. When an append structure is enabled, it also activates the table to which it is assigned. Append structure is always added as the last field of the table. Field names should begin with ZZ or YY when creating an append structure. This avoids any naming conflicts with new SAP domains that can be added in the future. In the example below, you can view the fields added to the standard table in line with customer needs.
You cannot create an append structure for pool or cluster tables. Also, you cannot create an append structure with a long field, such as an LCHR or LRAW type, because the long field should always be the last field in that table.
Some of the tables provided by SAP contain a special include structure. These include are called customizing include and you can add customer specific fields to them. Unlike the append structure, customizing includes can be included in more than one table or structure. If you add a field to the customizing include, it will automatically appear in any tables or structures that have the customizing include attribute. Its nomenclature begins with CI. As with the append structure, customizing include field names should begin with ZZ or YY.
Of course, there is no point in adding these fields to the SAP tables unless you fill them out. You should develop the standard SAP application to fill in the fields added using the append structure or customizing include. Customer-specific fields can be populated using one of the enhancement techniques discussed throughout.
Enhancement Framework
As of SAP NetWeaver 7.0, the Enhancement Framework allows you to add functionality to the standard SAP application without changing the original repository objects. With this technology, it is possible to develop global classes, function modules, Web Dynpro ABAP components and all program units. The Enhancement Framework consists of:
Enhancement Options
It allows you to develop the interface parameters of SAP function modules and class methods without modification. You can also add additional attributes and methods to SAP classes. Development options are always available and can be used by the user to develop SAP applications. They can also be used for SAP objects developed before SAP NetWeaver 7.0.
Implicit Enhancement Points
It is always available to the user. They can be used to add code to programs, function modules, and methods without modification. They are also available for SAP objects developed before SAP NetWeaver 7.0.
Explicit Enhancement Points
They are the points located in the repository objects, where the user can add functionality by coding without making any changes. They are implemented using the ENHANCEMENT-POINTS syntax.
Explicit Enhancement Section
It allows you to change code in SAP programs, function modules and methods without making changes. The modifiable SAP code has been added between the ENHANCEMENT-SECTION and END-ENHANCEMENT-SECTION statements.
New BAdIs
For SAP NetWeaver 7.0, SAP has implemented the new BAdI technology and plans to use it for future improvements. The new BAdI technology works in the same way as the classic BAdI, but the adapter call is no longer required. Instead, the new BAdI technology uses the GET BADI and CALL BADI syntaxes. Similar to traditional BAdIs, new BAdIs give you enhancements to program, screen and menu outputs. To use BAdIs, you should practice development via transaction code SE19. You can also find the new BAdI definition by searching for the GET BADI command in its main program.
Enhancement Spots
Open are areas for development options. Enhancement sections add new BAdIs, carry information about the locations where enhancement points or BAdIs were created. Enhancement spots contain either new BAdIs or open development sections and development sections. Several enhancement points can be assigned to a development option. Implicit enhancements do not need to be assigned to development points.
Composite Enhancement Spots
These include one or more simple or compound enhancements. They are used to semantically bundle simple or compound development points.
Nested Source Code Enhancements
As of SAP NetWeaver 7.0, it is possible to develop SAP objects using the Enhancement Framework. We could use implicit or explicit development to develop the application, but it is not possible to develop the code plugin defined in ENHANCEMENT – ENDENHANCEMENT. As of SAP NetWeaver 7.0 EHP 2, it is possible to create nested enhancements such as developing the code plugin and using the ENHANCEMENT-POINT and ENHANCEMENT-SECTION statements within the code plugin. Additionally, there is implicit development before the first line and last line of the code plugin.
Modification
An object can be original in only one system. The original system for the SAP system is SAP itself. On customer systems, SAP objects are available as copies. Your development system is the original system for objects created on it. Objects created on your development system are assigned to development or fix requests if they are assigned to the package. The transport request is used to move the development object from the development system to the next systems. Modifications made to the original are assigned to the modification request, and the modification to the copy (an object that was not developed on the system in which it was modified) is assigned to the repair modification request.
You should not modify the SAP object unless the modification you want is absolutely necessary and cannot be implemented with current development techniques. When you upgrade your system or apply a support package, conflicts with modified objects can occur. These conflicts occur if you have modified a SAP object and SAP has delivered a new version of the object. The new object delivered by SAP becomes an active object on your system and if you want to keep your modifications, you should make a modification adjustment to the object. The modification setting should always be made on the development system and then migrated to the next systems.
You need an access key to modify the SAP object. You need to obtain the access key from the SAP Service Marketplace (http://service.sap.com) and save the object you have modified. The access key is also called the SAP Software Change Record (SSCR). All objects being modified are logged by SAP. If this is a result of replacing the standard SAP object, it helps SAP support find and fix the problem quickly. SAP recommends using Modification Assistant to modify standard SAP objects, but you can turn off the modification assistant if necessary. The change assistant makes the modification easy and allows you to reset the change.
Modification Browser
The modification browser provides an overview of all modifications made to the system. Distinguish between modifications made using the modification assistant and those made without it. It can be run using opcode SE95 and you can restrict the selection of objects on the start screen according to various selection criteria. It can also be used to reset or undo the modification made to the system.
SAP Notes Assistant
SAP Notes Assistant is used to apply SAP notes, which are corrections to objects in the SAP system. Before SAP Notes Assistant was introduced, system administrators had to manually implement SAP notes with developer help. This increased the probability of error. Without SAP Notes Assistant, you should enter a registration key before you can modify the object. With SAP Notes Assistant, you no longer need to enter the registration key; can automatically import the hotfix without modification assistant. You no longer have to maintain the code manually, which saves time and reduces the chance of errors. SAP Notes Assistant automatically downloads the notes from the SAP Service Marketplace using a direct RFC link and reads the revision before applying the notes to the system. SAP Notes Assistant also recognizes dependencies between different notes. The system checks for prerequisites and dependencies for other notes. Detects whether a note is a prerequisite note and loads the prerequisite note if it is. In the dialog, you display the list of prerequisites and apply the note in the correct order as shown in the list. You have the option to apply all selected notes at once, or you can apply each note separately. If implemented with SAP Notes Assistant, you also have the option to undo the note application.