BC425 Enhancements and Modifications(BW认证)

Share Embed Donate


Short Description

BC425 Enhancements and Modifications...

Description

BC425 Enhancements and Modifications

Preface Copyright The R/3 Integration Model ABAP Workbench Target Audience Prerequisites Course Goal

Introduction: Contents Objectives Course Content Course Overview Diagram Main Business Scenario

Changing the SAP Standard Objectives Change Levels Deciding What Kind of Changes to Make Customizing Personalization Change Levels in the ABAP Workbench Customer Exits: Overview Implementing Customer Exits Customer Exits: SAP and the Customer Field Exits Field Exits: SAP and the Customer Table Enhancements Table Enhancements: SAP and the Customer Text Enhancements Text Enhancements: SAP and the Customer User Exits Modifications Modifying vs. Copying Evaluating ABAP Development Projects Summary

Modifications Objectives Modifications What are modifications? Modifications and Upgrades Modifications Copying SAP Objects Making Changes to SAP Copies (Modifications) Registering Modifications in SSCR Carrying Out a Registered Modification Versions Naming Conventions for Repository Objects Modifications Modifications: Critical Success Factors (1) Modifications: Critical Success Factors (2) Modifications: Critical Success Factors (3) Documenting Modifications in Programs

Modification Logs: An Example Modifications Modification Adjustment: SPDD and SPAU Modification Adjustment: Objects Transaction SPAU (Process After Upgrade) Transporting Adjustments between Systems The amount of work necessary at upgrade increases... Modifications: Critical Repository Objects Avoiding Adjustments Modifications User Exits User Exits: An Example Using User Exits Summary

Enhancements to Dictionary Elements Objectives Enhancements to Dictionary Elements Table Enhancements: Overview Append Structures Append Structures at Upgrade Customizing Includes Enhancements to Dictionary Elements Global Enhancements Field Exits Global and Local Field Exits Creating Field Exits Enhancements to Dictionary Elements Text Enhancements Editing Text Enhancements Keywords Keyword Change Requirements Keyword Changes and Release Upgrades Restoring SAP Keywords Enhanced Documentation for Data Elements Customer Documentation Summary: Text Enhancements Summary

Enhancements using Customer Exits Objectives Enhancements using Customer Exits SAP Application Enhancements Customer Enhancement Projects SAP Enhancements and Customer Enhancement Projects Enhancements using Customer Exits The SAP Enhancement Creation Procedure Implementing Enhancements in Customer Systems Creating Customer Enhancement Projects Assigning SAP Enhancements to Customer Projects Editing Components Activating Enhancement Projects Transporting Projects Summary: Enhancement Management Enhancements using Customer Exits Function Module Exits Calling and Creating Function Modules Assigning SAP Enhancements to Customer Projects Organization of an X Function Group

Customer Source Code Global Data: SAP and the Customer Subroutines, Modules: SAP and the Customer Customer Screens Customer Screens: Modules Summary: Function Module Exits Enhancements using Customer Exits Menu Exits Menu Exit Requirements Assigning SAP Enhancements to Customer Projects Menu Exits and Function Module Exits Summary: Menu Exits Enhancements using Customer Exits Screen Exits Subscreens in the R/3 System Calling Subscreens Defining Screen Exits Calling Customer Subscreens Transporting Data to Subscreens Transporting Data from Subscreens Editing Subscreens (1) Editing Subscreens (2) Summary: Screen Exits Summary

Business Transaction Events Objectives Business Transaction Events (BTE) BTE: Possible Scenarios (1) BTE: Possible Scenarios (2) Publish & Subscribe vs. Process Interfaces Business Transaction Events: SAP and the Customer Finding Business Transaction Events Creating a Publish & Subscribe Interface Differences between Customer Exits and BTEs Summary

Exercises Exercises for Unit 'Modifications' Exercises for Unit 'Enhancements to Dictionary Elements' Exercises for Unit 'Enhancements using Customer Exits'

Solutions Solutions for Unit 'Enhancements to Dictionary Elements' Solutions for Unit 'Enhancements using Customer Exits'

Preface

BC425 Enhancements and Modifications R

© SAP AG

BC425 Enhancements and Modifications Release 4.0A Material number 50020277 October 98

?SAP AG

BC425 Enhancements and Modification

0-1

Preface

Copyright Copyright 1998 SAP AG. All rights reserved. Neither this training manual nor any part thereof may be copied or reproduced in any form or by any means, or translated into another language, without the prior consent of SAP AG. The information contained in this document is subject to change and supplement without prior notice. All rights reserved.

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

0-2

Preface

The R/3 Integration Model SD

FI

Sales & & Distribution Distribution

Financial Financial Accounting Accounting

MM PP

CO

Materials Materials Mgmt. Mgmt.

Production Production Planning Planning

AA Asset Accounting

R/3

QM Quality Quality Mgmt. Mgmt.

Controlling Controlling

PM

PS Client / Server Project Project System System ABAP WF WF

Plant Plant Maintenance Maintenance

W Workflow orkflow

HR

IS

Human Human Resources

Industry Solutions Solutions

R

© SAP AG

SAP’s R/3 System has set new norms for standard software that can be universally implemented. R/3 uses advanced development techniques to achieve comprehensive integration of business administration and data processing. R/3 combines state-of-the-art technology with comprehensive business administration functions to provide a fully integrated business solution for your company.

?SAP AG

BC425 Enhancements and Modification

0-3

Preface

ABAP W orkbench Level 2

BC400 5 days ABAP Workbench Basics

Level 3 BC405 5 days Techniques of List Processing

BC411 5 days Advanced ABAP Programming

BC410 5 days Transaction Processing

BC425 2 days Enhancements and Modifications

BC415 3 days Communication Interface Programming in ABAP BC420 2 days Interface Programming for Data Transfer

BC440 5 days Developing Internet Application Components (IAC)

BC430 2 days ABAP Dictionary BC460 3 days SAPscript: Forms Design and Text Management in R/3 R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

0-4

Preface

Target Audience Course participants Project team leaders Members of those project teams responsible for adjusting R/3 to their companies’ needs

Duration: 2 days

R

© SAP AG

Hints to the user: These training documents are not meant to be used without corresponding classroom instruction. They are only complete when used in tandem with the comments of an SAP trainer. Space is provided for you in the course documents to note this additional information.

?SAP AG

BC425 Enhancements and Modification

0-5

Preface

Prerequisites SAP50 - Basis Technology BC400 - ABAP Workbench: Basics BC410 - Transaction Processing Experience with Customizing projects is also helpful

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

0-6

Preface

Course Goal This course will enable you to: Make enhancements to the SAP standard Modify the standard and perform modification adjustments

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

0-7

Introduction: Contents

Introduction: Contents z Course goal z Objectives z Course contents z Course overview diagram z Main business scenario z Introduction

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

1-1

Introduction: Contents

Objectives At the conclusion of this unit, you will be able to: z Describe the different kinds of change

levels available in the R/3 System z Make modifications to your system and

adjust these modifications z Enhance ABAP Dictionary objects without

having to modify them z Make enhancements to the R/3 standard

using customer exits z Enhance your system using Business

Transaction Events

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

1-2

Introduction: Contents

Course Content Preface

Unit 1

Introduction

Unit 2

Changing the SAP Standard

Unit 3

Modifications

Unit 4

Enhancements to Dictionary Elements

Unit 5

Enhancements using Customer Exits

Unit 6

Business Transaction Events Exercises Solutions Appendix

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

1-3

Introduction: Contents

Course Overview Diagram R/3 Business Applications ( The SAP Standard)

Customer Programs

Enhancem ent Enhancement

Modification

z

Hard-Coded Modifications

2

ABAP Dictionary

3

4

5

Table enhancements Field exits Text enhancements

Customer Exits Function module exits Menu exits Screen exits

Customer Custom er Developm ent Development „ W ith references to SAP objects „

W ithout references to SAP objects

Business Transaction Events R

z

User Exits

© SAP AG

?SAP AG

BC425 Enhancements and Modification

1-4

Introduction: Contents

Main Business Scenario z You are employed by a major travel agency as a

computer specialist. It is your responsibility to enhance the programs that your customer service specialists use when helping clients z There are several ways of enhancing your

software without having to actually modify your system’ s standard

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

1-5

Changing the SAP Standard

Changing the SAP Standard Change levels Change procedures Making enhancements using the ABAP W orkbench User exits Modifications

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

2-1

Changing the SAP Standard

Objectives At the conclusion of this unit, you will be able to: Describe the different ways in which you can make changes to the SAP Standard. Choose the type of change best able to meet your system’ s needs .

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

2-2

Changing the SAP Standard

Change Levels

R/3 Business Applications (SAP Standard)

Customizing Custom izing

Personalization

Business Engineer

Customer Programs

Modifications

Enhancem ents

Custom er Customer Development Developm ent

ABAP W orkbench R

© SAP AG

You can adjust the R/3 System to meet your needs in the following ways: Customizing: This means setting up specific business processes and functions for your system according to an implementation guide. The need for these changes has already been foreseen by SAP and an implementation procedure has been developed. Personalization: This means making changes to certain fields' global display attributes (setting default values or fading fields out altogether), as well as creating user-specific menu sequences. Modifications: These are changes to SAP Repository objects made at the customer site. Whenever SAP makes changes to these objects, the customer's system must be adjusted to reflect these changes. Up to 4.0B, these adjustments had to be made manually using upgrade utilities. From Release 4.5A, the new SAP Modification Assistant automates this technical adjustment process to a large extent. Enhancements: This means creating Repository objects for individual customers that refer to objects that already exist in the SAP Repository. Customer Development: This means creating Repository objects unique to individual customers in a specific namespace reserved for new customer objects. Customizing and most personalization is done using tools found in the SAP Business Engineer; customer developments, enhancements, and modifications are all made using the tools available in the ABAP Workbench.

?SAP AG

BC425 Enhancements and Modification

2-3

Changing the SAP Standard

Customizing

Deciding What Kind of Changes to Make Are there standard functions that can be adjusted to fulfill the customer’ s needs using Customizing or personalization?

Customizing Personalization Yes

No

Customer Development CSP Solution

Development

Do similar functions exist in the SAP standard? No Yes Does the SAP application allow you to add additional functions using enhancements? No

No

Cust. dev. with SAP programs as examples

Enhancement / User Exit Yes

R

Modification

© SAP AG

If your requirements cannot be met by Customizing or personalization, you may either start a development project or try using a CSP solution (= Complementary Software Product). A development project falls into the customer development category if the SAP standard does not already contain functions similar to the one you are trying to develop. If, however, a similar SAP function exists, try to assimilate it into your development project by either enhancing or modifiying it, by using a user exit, or simply by making a copy the appropriate SAP program. Modifications can create problems, as new versions of SAP objects must be adjusted after an upgrade to coincide with modified versions of SAP objects you have created. Up to Release 4.0B, you must make such adjustments manually using upgrade utilities. From Release 4.5A, the SAP Modification Assistant automates this technical adjustment process to a large extent. Thus, you should only make modifications if: - Customizing and personalization do not fulfill your requirements - No enhancements or user exits have been provided - Copying an SAP object to your customer namespace is of no use.

?SAP AG

BC425 Enhancements and Modification

2-4

Changing the SAP Standard

Customizing Im plem entation Guide

R/3 Procedure M odel

Business Process Scenario

Session Manager

Application Com ponents

B estan dsfü hrun g

Ei nkau f

Business Objects P urchase order

Materialw irtschaft

Info rm ation ssystem

Schedule lines

P urchase order item P urchase order consignm ent

L ag erverwaltu ng

Tim e

Purchase order returnable packaging L ieferan ten anfrag e / -an gebo t

Process Model

B estel lanfo rd erun g

Purchase order third party delivery

B estellu ng

Object-Oriented Data Model

Company Organization Pu rchase req ui si tio n

Vend or i nq ui ry

Vend or q uo tation

R /3

Re M o fere n ce de l

Pu rchase i nfo rm ation Sh ip pi ng n oti fication Pu rchase o rd er

Vend or sch ed ul in g agreement

W orkflow and Organization R

© SAP AG

The Business Engineer is made up of all SAP implementation tools. These include: The R/3 Reference Model contains all of the models used to describe R/3 (the process model, the data model, the organization model, and so on) The Implementation Guide (IMG) A complete list of all Customizing changes

?SAP AG

BC425 Enhancements and Modification

2-5

Changing the SAP Standard

Personalization You can often simplify and personalize an application without having to use the ABAP W orkbench. Global display attributes of fields SET/GET parameters Global values Variant transactions Parameter transactions Table control settings valid throughout the entire system

Company-specific menus Area menus Session Manager on your frontend or in the R/3 System Shortcuts on your desktop © SAP AG

R

Report trees

Personalization accelerates and simplifies how business cases are processed by the R/3 System. During personalization, individual application transactions are adjusted to meet the business needs of your company as a whole or even to the needs of specific user groups within your company. All unnecessary information and functions found in the transaction are switched off. Global display attributes allow you to define default values for specific screen fields. You can also suppress individual fields or table control columns in a particular transaction, or even a whole screen. Area menus, shortcuts, report trees, and the Session Manager (which you can either install on your frontend directly or call using transaction SESS) allow you to adjust menu sequences to reflect the needs of different user groups within your company.

?SAP AG

BC425 Enhancements and Modification

2-6

Changing the SAP Standard

Change Levels in the ABAP W orkbench R/3 Business Applications (The SAP Standard)

Modification

Hard-Coded Modifications

Customer Programs

Enhancements

ABAP Dictionary Table enhancements Field exits Text enhancements

Customer Exits Function module exits Menu exits Screen exits

Custom er Customer Development W ith references to SAP objects W ithout references to SAP objects

Business Transaction Events R

User Exits © SAP AG

Modifications: These are changes to SAP objects that have been made in customer systems. Modifications are:

• executed with the help of user exits (these are subroutines reserved for customers that have been inserted in objects in the SAP namespace) • 'hard-coded' at various points within SAP Repository objects. Enhancements work the other way round: Here, SAP programs call Repository objects that have been created or changed by customers. Function module exits created by customers and called by an SAP program are examples of enhancements. You can enhance your system in the following areas:

• in ABAP programs (function module exits) • on GUI interfaces (menu exits) • on screens by inserting a subscreen in an area specified by SAP (screen exits) • on screens by processing customer code that refers to a specific field on the screen (field exits) • in ABAP Dictionary tables or structures (table enhancements) • in the form of text enhancements (intended to replace SAP documentation or keywords). Customer Development: These are programs developed by customers that can call SAP Repository objects. For example, customers often create programs that call SAP function modules.

?SAP AG

BC425 Enhancements and Modification

2-7

Changing the SAP Standard

Customer Exits: Overview SAP R/3 Menu#1

Menu#2

Menu#3

Function 1 Function 2 Function 3 Customer function Function 4

Screen exits (Custom er fields) (Customer

System

Help

Menu exits (Customer (Custom er functions)

Field y Field z

ABAP PROGRAM ... ...

.

CALL CUSTOMER-FUNCTION ...

Function module

...

Function module exits (Custom er functions)

R

© SAP AG

You can enhance programs in the following areas: in ABAP programs (function module exits) on GUI interfaces (menu exits) in screen flow logic - by inserting a subscreen in an area specified by SAP (screen exits) SAP provides you with the following functions for enhancing your system: the ABAP statement CALL CUSTOMER-FUNCTION special function codes for your interface the statement CALL CUSTOMER-SUBSCREEN in screen flow logic. All program exits, menu exits, and screen exits must be programmed in advance by an SAP application programmer.

?SAP AG

BC425 Enhancements and Modification

2-8

Changing the SAP Standard

Implementing Customer Exits ABAP Function module exit CALL CUSTOMER-FUNCTION ...

Screen Painter

Screen exit

CALL CUSTOMER-SUBSCREEN...

Menu Painter Menu exit Function

Description

+ CUS . . .

. . . R

© SAP AG

SAP application programmers provide for customer exit implementation (enhancement) using the following mechanisms: CALL CUSTOMER-FUNCTION statements (function module exits) Special function codes (menu exits) CALL CUSTOMER-SUBSCREEN statements in screen flow logic (screen exits)

?SAP AG

BC425 Enhancements and Modification

2-9

Changing the SAP Standard

Customer Exits: SAP and the Customer SAP

Customer

Administration Interfaces Documentation

Function module exits

Function module code Customer screens

Function codes

Menu exits

Text

Subscreen areas Flow logic

Screen exits

Subscreens Function module code

R

© SAP AG

When planning program enhancements for customer use, SAP application programmers can:

• Create function modules and maintaining their administrative data, their interface, and their documentation (function module exits). Note: SAP programmers do not, however, write the function modules' actual code. • Define additional function codes (menu exits) • Define special areas for customer subscreens (screen exits) In order to take advantage of these preplanned customer exits and actually enhance your system, you must: Write your own code the function modules (function module exits) Enter your own function code texts (menu exits) Create subscreens for the subscreen areas (screen exits)

?SAP AG

BC425 Enhancements and Modification

2-10

Changing the SAP Standard

Field Exits SAP R/3 System Help

Field SAP R/3 System Help

Field SAP R/3 System Help

Field

Data element

Function module R

Field exit © SAP AG

Data elements cause the customer code in field exits to be processed.

?SAP AG

BC425 Enhancements and Modification

2-11

Changing the SAP Standard

Field Exits: SAP and the Customer SAP

Data element

Customer

Field exits

Function module

R

© SAP AG

Field exits do not have to be planned by an SAP application programmer. You create field exits simply by storing function modules for specific data elements in your system.

?SAP AG

BC425 Enhancements and Modification

2-12

Changing the SAP Standard

Table Enhancements ABAP Dictionary SAP table

Append structure

Field 1 Field 2 Field 3

Field A Field B

Customer fields

Database

Field 1 Field 2 Field 3 Field A Field B

R

© SAP AG

Append structures allow you to attach fields to a table without actually having to modify the table itself. Append structures may only be assigned to a single table. A table may, however, have several append structures attached to it. Whenever a table is activated, the system searches for all active append structures for that table and attaches them to the table. If an append structure is created or changed and then activated, the table it is assigned to is also activated, and all of the changes made to the append structure take effect in the table as well. Append structures differ from substructures in how they refer to their tables. In order to include fields from a substructure in a table, you must add an '.INCLUDE...' line to the table. In this case, the table refers to the substructure. Append structures, on the other hand, refer to their tables. Thus, the tables themselves are not altered in any way by the reference. You can use append structures in ABAP programs just as you would any other structure. Note: When you copy tables that have append structures attached to them, the fields that were found in the append structure of the original table become part of the actual body of the target table.

?SAP AG

BC425 Enhancements and Modification

2-13

Changing the SAP Standard

Table Enhancements: SAP and the Customer SAP

Customer

Table

Table enhancement

Append structure

Table + Include statement

Table enhancement

CI_Include

R

© SAP AG

Append structures allow you to attach fields to a table without actually having to modify the table itself. Table enhancements using append structures do not have to be planned by SAP developers. CI_includes allow you to use the same structure in multiple tables. Table enhancements using CI_includes do, however, have to be planned by SAP developers.

?SAP AG

BC425 Enhancements and Modification

2-14

Changing the SAP Standard

Text Enhancements SAP R/3 System

Help

Text enhancements

Customer keyword Documentation Docum entation SAP: ..... Customer : .....

?

R

© SAP AG

You have the option to enhance SAP data element documentation with your own documentation or to replace the documentation entirely. You can also replace SAP keywords with your own (text enhancements).

?SAP AG

BC425 Enhancements and Modification

2-15

Changing the SAP Standard

Text Enhancements: SAP and the Customer SAP

Customer

SAP documentation

Data elements

Adds own documentation to SAP documentation

SAP keyword

Data elements

Customer keyword

R

© SAP AG

SAP application programmers either use existing data elements or define new ones, then they document them and assign keywords. Customers can add their own custom documentation as text enhancements for these data elements, or they can create new documentation entirely. Customers can also assign their own keywords.

?SAP AG

BC425 Enhancements and Modification

2-16

Changing the SAP Standard

User Exits

SAP program PROGRAM ... ...

Include for user exits .

*INCLUDE ... ...

PERFORM user_exit_. ...

FORM user_exit_. *example code... ENDFORM. ...

User exit (Customer (Custom er function)

R

© SAP AG

When laying out user exits, SAP application developers create FORM routines that are called from within SAP programs. SAP developers then create a special include for these FORM routines. These includes are only ever delivered once by SAP.

?SAP AG

BC425 Enhancements and Modification

2-17

Changing the SAP Standard

Modifications

ABAP PROGRAM ... ...

.

*Original source code.. ... ... ... *Code changed or added by the customer ... *Original source code.. ...

R

© SAP AG

Any change that a customer makes in his or her system to an object that has been delivered by SAP is known as a modification. Modifications can lead to complications at upgrade. Customers must decide if they want newly delivered SAP objects to take effect in their system, or if they want the objects they have modified to remain intact.

?SAP AG

BC425 Enhancements and Modification

2-18

Changing the SAP Standard

Modifying vs. Copying

Connection to SAP

Modifying

Project security

Copying R

© SAP AG

Modifying has the advantage that your productive Repository objects do not lose their connection to the SAP standard. Copying, on the other hand, has the advantage that no modification adjustment will be necessary for your productive Repository objects during subsequent upgrades. Choose copying instead of modifying if You have to make numerous changes to an SAP program Your requirements will not be met by the standard in future R/3 releases.

During copying, pay attention to a Repository object's environment as well. You should only decide whether to modify or copy after having informed yourself of the consequences for the main program, as well as for all of the includes attached to the main program. The same holds true for function groups and function modules.

?SAP AG

BC425 Enhancements and Modification

2-19

Changing the SAP Standard

Evaluating ABAP Development Projects Implementation costs

are greater than with Customizing.

Consequences System performance

... can be affected negatively.

An increased number of adjustments

... become necessary at upgrade .

R

© SAP AG

ABAP development projects can be evaluated according to the following criteria: What will implementation cost, measured in manpower (creating the concept, implementation, testing)? How will the ABAP development project influence -Production operation performance? -The amount of adjustment at upgrade? By calling SAP objects in your own Repository object, you can drastically reduce the amount of effort needed to implement your object. However, any changes that SAP makes to the Repository object you choose to call may make extra adjustment necessary after an upgrade. Example: SAP could conceivably change the user interface of a screen for which you have written a batch input program.

?SAP AG

BC425 Enhancements and Modification

2-20

Changing the SAP Standard

Summary You can enhance your R/3 system using Customizing, enhancements, customer developments, and modifications. If not all of the business processes that you want can be added to your system during Customizing, use ABAP development projects are to expand your system’ s functionality. Function module exits, screen exits, menu exits, and field exits all allow you to enhance programs. Function module exits, screen exits, and menu exits have to be planned and created by SAP programmers. You should avoid making modifications to the SAP standard since this makes additional adjustment necessary at upgrade. R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

2-21

Modifications

Modifications Overview Making modifications Critical success factors Modification adjustments User exits

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

3-1

Modifications

Objectives At the conclusion of this unit, you will be able to: Explain what kind of problems can arise if you modify without having first acquainted yourself with the possible consequences of your modifications Determine the amount of additional work your modifications will create at release upgrade List critical success factors that allow you to reduce such additional work at upgrade Enhance your system using user exits R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

3-2

Modifications

Modifications Overview Making Modifications Critical Success Factors Modification Adjustments User Exits

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

3-3

Modifications

W hat are modifications? Customer R/3 System

SAP object

Domains, data elem ents, tables, ABAP programs, screens, interfaces, ...

Change (with ABAP W orkbench tools)

Modified SAP object

R

© SAP AG

Any change made to an SAP object in a customer system is called a modification. Customers usually modify their systems for one of two reasons. Either they make changes to the SAP standard in order to adjust the R/3 System to their specific business needs (actual modifications), or they alter individual SAP objects in order to correct an error (as recommended in an SAP error note). You should only modify the SAP standard if the modifications you want to make are absolutely necessary for optimizing work flow in your company. Be aware that good background knowledge of application structure and flow are important prerequisites for deciding what kind of modifications to make and how these modifications should be designed.

?SAP AG

BC425 Enhancements and Modification

3-4

Modifications

Modifications and Upgrades Upgrade

Customer R/3 System

SAP object (new)

Modified SAP object

Adjustment Integrate m odification into new SAP object ... or return system to the SAP standard? R

© SAP AG

Whenever customers make changes to SAP Repository objects, the customer versions of these objects must be adjusted to match any new SAP versions of the same object delivered at upgrade. Prior to Release 4.0B these adjustments had to be made manually using upgrade utilities. From Release 4.5A, this procedure has been automated with the Modification Assistant. You should not underestimate the time and energy needed to make such adjustments to your system.

?SAP AG

BC425 Enhancements and Modification

3-5

Modifications

Modifications Overview Making Modifications Critical Success Factors Modification Adjustments User Exits

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

3-6

Modifications

Copying SAP Objects

Custom er developm ent system

Target system

Copy SAP object

Copy SAP object

Change request

R

© SAP AG

SAP objects exist as copies in all customer systems.

?SAP AG

BC425 Enhancements and Modification

3-7

Modifications

Making Changes to SAP Copies (Modifications)

Copy

Repaired copy

SAP object

SAP object Transport request

Adjustm ent

Copy

Copy

SAP object

SAP object

R

Adjustment transport © SAP AG

Changes to SAP copies are called modifications. Modifications are classified as repairs. Modifications are, however, much more likely lead to inconsistencies in customer systems than repairs. This is due to the fact that the customer cannot alter the modified object's original in its corresponding development system. Whenever new versions of SAP objects are imported into your system during upgrade, all SAP objects that have been repaired must be adjusted. This means that you must make the same changes to new SAP objects that you made to your SAP old objects during the initial repair phase.

?SAP AG

BC425 Enhancements and Modification

3-8

Modifications

Registering Modifications in SSCR Repository Browser: Initial Screen System

Help

Customer system

Object list

Register object System

Program

Help

program_name Please enter the key for object ... :

OSS: SAP Object Registration System

Help

R

PgmID/OBJ/Name R3TR

PROG

program_name

R/3 OSS Key

07319180563614231463 R

© SAP AG

A registered development user registers changes in SAP sources and manual changes of ABAP Dictionary objects. Exceptions to such registration are matchcodes, database indexes, buffer settings, customer objects, patches, and objects whose changes are based on automatic generation (for example, in Customizing). If the object is changed again at a later time, no new query is made for the registration key. Once an object is registered, the related key is stored locally and automatically copied for later changes, regardless of which registered developer is making the change. For the time being, these keys remain valid even after a release upgrade. How do you benefit from SSCR (SAP Software Change Registration)? Quick error resolution and high availability of modified systems All objects that have been changed are logged by SAP. Based on this information, SAP's First Level Customer Service can quickly locate and fix problems. This increases the availability of your R/3 system. Dependable operation Having to register your modifications helps prevent unintended modification. This in turn promotes the dependable operation of your R/3 software. Simplification of upgrades Upgrades and release upgrades become considerably easier due to the smaller number of modifications.

?SAP AG

BC425 Enhancements and Modification

3-9

Modifications

Carrying Out a Registered Modification

Change SAP object

Sperre Assign object to a change request Automatic assignment to a task

Release task Release change request

Export Import Transport directory

R

Administrator

© SAP AG

When you change one of SAP's Repository objects, the Workbench Organizer prompts you for a change request, just as if you were creating your own object. The object is automatically added to a repair task. After development is finished, the programmer releases the task. The objects and object locks valid in the task are transferred from to the change request. Once the project is completed, you release the change request. This removes all of the change request's object locks. Change requests may be transportable or local. The Workbench Organizer automatically classifies change requests according to their development classes. Only transportable change requests are transferred to the Change and Transport System after they have been released. Immediately after export, a test import checks to see if all objects can be imported into your target system. Repository objects are exported to the central transport directory. The results of both export and the test import are recorded in the change request's transport log and verified by the programmer. Import into the target system does not take place automatically, rather it must be initiated either using the transport control program tp at the operating system level or by a system administrator using the Transport Management System from within R/3. Developers should subsequently check the import logs.

?SAP AG

BC425 Enhancements and Modification

3-10

Modifications

Versions Repair old

SAP object

Include in

Full version

task EU-Objekt Backward delta new

SAP object

Release request

R

© SAP AG

When you release a change request, a complete version of all objects contained in the change request is written to the versions database. If you edit the Repository object again later, the current object becomes a complete copy and the differences between the old and the new object are stored in the versions database as a backwards delta. Whenever you assign a Repository object to a task, the system checks whether the current version agrees with the complete copy in the versions database. If not, a complete copy is created. This process is also initiated the first time you change an object, since SAP does not deliver versions of Repository objects. The versions of a Repository object provide the basis for modification adjustment. To support adjustment, information on whether the version was created by SAP or by the customer is also stored.

?SAP AG

BC425 Enhancements and Modification

3-11

Modifications

Naming Conventions for Repository Objects

SAP Standard Software

SAP Partners

decentralized centralized

SAP

Development Developm ent

Main office

YA

Sales office

ZA

Application area

Customer nam espace (OSS note 16466)

V_TRESN Namespace reservation (Workbench Organizer)

/xxxx/ Namespace reservation (SAP OSS)

Complementary Software

R

© SAP AG

Naming conventions allow you to avoid naming conflicts and give your Repository objects meaningful names (that can be understood by others). The following naming conflicts can occur: An SAP Repository object and a customer Repository object conflict SAP Repository objects and customer Repository objects should be separated from each other by strict adherence to SAP naming conventions. OSS note 16466 gives you an overview of the current naming conventions for customer Repository objects (usually names that begin with either Y or Z). Two customer Repository objects conflict Naming conflicts can also crop up between customer Repository objects in decentralized development scenarios where more than one development system is being used. You can avoid naming conflicts in this area by reserving a special namespace for development areas within the customer namespace. The Workbench Organizer checks to make sure that you adhere to these conventions by making entries in view V_TRESN. Complementary software and customer Repository objects conflict You can avoid naming conflicts when importing complementary software from SAP partners by reserving special namespaces in SAP OSS. In addition, from Release 4.0 SAP partners can apply for prefixes in SAP OSS that they can tack on to the beginning of their Repository objects' names (For additional information, refer to OSS notes 84282 and 91032, or the white paper 'Development Namespaces in the R/3 System', order number E:50021723 [English] and D:50021751 [German]).

?SAP AG

BC425 Enhancements and Modification

3-12

Modifications

Modifications Overview Making Modifications Critical Success Factors Modification Adjustments User Exits

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

3-13

Modifications

Modifications: Critical Success Factors (1) • Encapsulation instead of insertion REPORT sapabap. IF sy-tabix = 1. *#SD_001...#Insertion count = count + 1. LOOP AT tab WHERE f1 < 10. .... ENDLOOP. ENDIF. Insertion

REPORT sapabap. IF sy-tabix = 1. *#SD_001...#Insertion CALL FUNCTION 'ZFM' CHANGING counter = count TABLES itab = tab. ENDIF. FU NCTION zfm. counter = counter + 1. LOOP AT itab WHERE f1 < 10. .... ENDLOOP. ENDFUNCTION. Encapsulation R

© SAP AG

Encapsulate customer source code in modularization units instead of inserting it directly into SAP source code (with, for example, customer function module calls in program source code, or customer subscreen calls for additional screen fields).

?SAP AG

BC425 Enhancements and Modification

3-14

Modifications

Modifications: Critical Success Factors (2) Use narrow interfaces during encapsulation Standardize your modification documentation Log all modifications Confirm and release all repairs, as well as all requests that contain repairs

R

© SAP AG

When encapsulating the customer portions of a program, be sure to use narrow interfaces. You should define a standard for all of your company's modification documentation (see the following slides). You should also maintain a list of all modifications to your system (a modification log, see the following slides). All requests that contain repairs must be released before an upgrade so that all relevant customer versions can be written to the versions database (the system compares versions during adjustment!) . Repairs must also be confirmed prior to upgrade, otherwise the object being repaired is locked and cannot be imported.

?SAP AG

BC425 Enhancements and Modification

3-15

Modifications

Modifications: Critical Success Factors (3) Do not modify any ABAP Dictionary objects that belong to the core of your system (Basis Dictionary objects). Only make changes to Basis Dictionary objects if told to do so in an OSS note or by somebody from the SAP Hotline. Do not create any additional function modules in SAP function groups (prior to Release 4.5A) Do not delete source code - comment it out instead

R

© SAP AG

Any modifications that you make to ABAP Dictionary objects that belong to Basis components are lost at upgrade--- these objects revert to their earlier form and no adjustment help is offered. This can lead to the contents of certain tables being lost.

?SAP AG

BC425 Enhancements and Modification

3-16

Modifications

Documenting Modifications in Programs PROGRAM sapkdemo. *#OSS0815 #C11K900001 Smith 03/19/1998 #Valid until 3.1G ry IF sum < 25. in a o n m li ti WRITE mysum. P re o rre c c *# *#Subject area #C11K900003 Meyer 01/19/1998 #Insertion io n ert s In

IF sum < 25. WRITE mysum. *#

*#Subject area #C11K900002 Ziner 08/12/1997 #Replacement nt * IF sum < 10. me e c * WRITE sum. p la Re IF sum < 25. WRITE mysum. *# R

© SAP AG

SAP recommends that you document hard modifications in your source code with the information listed below: Preliminary corrections OSS note, repair number, changed by, changed on, valid until Customer funtions that have been inserted subject area, repair number, changed by, changed on, INSERTION Customer functions that have replaced SAP functions subject area, repair number, changed by, changed on, REPLACEMENT The SAP functions that you do not need should not be deleted, but commented out instead. Subject areas are specified in the relevant process design blueprint (for example, subject area SD_001 = pricing).

?SAP AG

BC425 Enhancements and Modification

3-17

Modifications

Modification Logs: An Example Object type (program, screen, GUI status, ...)

PROG

Object name

SAPMV45A

Routine

SAVE_DOC

Subject area

SD_001

Repair number

C11K90008

Changed on

05.04.98

Changed by

Smith

Person responsible

Cramer

Preliminary correction? (yes/no)

no

OSS note number, valid until Release x.y

-

Amount of work necessary to recreate [hrs.]

4

R

© SAP AG

SAP recommends that you keep a record of all modifications that have been made to your system (that is, of any changes you have made to Repository objects in the SAP namespace). The following information should be logged for each modification: Object type (program, screen, GUI status, ...) Object name Routine (if applicable) Subject area (according to process design blueprint or technical design) Repair number Changed on Changed by Preliminary correction? (yes/no) OSS note number, valid until Release x.y Amount of time necessary to recreate modification during adjustment (measured in hours).

?SAP AG

BC425 Enhancements and Modification

3-18

Modifications

Modifications Overview Making Modifications Critical Success Factors Modification Adjustments User Exits

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

3-19

Modifications

Modification Adjustment: SPDD and SPAU

SAP standard Customer version

Compare

Revert to SAP standard

Transactions: SPDD SPAU

Adjustment

R

© SAP AG

During modification adjustment, old and new versions of ABAP Repository objects (from before and after upgrade) are compared using transactions SPDD and SPAU. You do not have to call transaction SPDD to adjust Dictionary objects if No changes have been made to SAP standard objects in the Dictionary You have only added customer objects to your system. Only SAP objects that have been changed must be adjusted using this transaction. All other ABAP Repository objects are adjusted using transaction SPAU. Upgrade program R3up tells you to start the transaction after upgrade has finished. You have 30 days to use transaction SPAU after an upgrade. After 30 days, you must apply for a SSCR key for each object that you want to adjust. Transaction SPAU first determines which objects have been modified and then determines for which of the modified objects a new version has been imported during the current upgrade. Modification adjustment allows you to transfer the modifications you have made in your system to your new R/3 Release.

?SAP AG

BC425 Enhancements and Modification

3-20

Modifications

Modification Adjustment: Objects SPDD

SPAU

ABAP programs Domains Data elements Tables

Interfaces Screens Matchcode objects Views Lock objects R

© SAP AG

Use transaction SPDD to adjust the following ABAP Dictionary objects during the modification adjustment process: - Domains - Data elements - Tables (structures, transparent tables, and pool and cluster tables including their technical settings) These three kinds of objects are adjusted immediately after all ABAP Dictionary objects are imported (before main import begins). At this point in time, no ABAP Dictionary objects have yet been generated. To ensure that no data is lost, it is important that any customer modifications to domains, data elements, or tables are undertaken prior their generation. Changes to other ABAP Dictionary objects, such as lock objects, matchcodes, or views, cannot result in loss of data. Therefore, these ABAP Dictionary objects are adjusted using transaction SPAU after both main import and object generation have been completed. Transaction SPAU allows you to upgrade the following kinds of objects: - ABAP programs - Interfaces (menus) - Screens - Matchcode objects - Views - Lock objects - Business data models

?SAP AG

BC425 Enhancements and Modification

3-21

Modifications

Transaction SPAU (Process After Upgrade) Intersection SAP Transport/Customer Modifications * R/3 Upgrade: Release 4.0B

Version Overview for Object abc

abc

Select

Vers

CorrNo.

Date

User

Short text

active 0001 0002

SAPK21A C11K0047 SAPK20B

011293 021093 010593

SAP ROGER SAP

Upgrade 40B Modification Upgrade 31F

Compare versions ABAP Editor (SAP new)

000010 000020 X 030 000040

REPORT RDDATC. PARAMETERS:TEST(1)TYPE C. TABLES: TDDAT, D002L. DATA: ECOUNT(2) TYPE I

Copy

Contents unchanged: 000010 000010 000020 000020 000030 000030 The following lines 000040 000050 000060 000070 Contents unchanged: 000040 000080

REPORT RDDDACT. PARAMETERS: TEST(1) TYPE C TABLES: TDDAT, DD02L. were inserted: TABLES: E070. E071. DATA: BEGIN OF K_TAB OCCURS 100. INCLUDE STRUCTURE E071K. DATA: END OF K_TAB. DATA: ECOUNT(2) TYPE I. R

© SAP AG

Version compare is also used during or after an upgrade for modification adjustment. During modification adjustment, the number of SAP objects that you a) changed in the system and that b) were then overwritten by SAP at upgrade is determined. Version compare allows you to find where changes were made and transfer them to your new SAP version if you so desire.

?SAP AG

BC425 Enhancements and Modification

3-22

Modifications

Transporting Adjustments between Systems

Release i

Release i-1 Release i-1

Modification adjustment

SPDD Transport request

M odification adjustm ents are transferred to these systems at upgrade

SPAU Transport request R

© SAP AG

During modification adjustment, you should use two different change requests to implement the changes you have made: one for SPDD adjustments and another for SPAU adjustments. These change requests are then transported into other R/3 systems you want to adjust. This guarantees that all actual adjustment work takes place solely in your development system. When upgrading additional R/3 systems, all adjustments exported from the first system upgrade are displayed during the ADJUSTCHK phase. You decide which adjustments you want to accept into your additional systems and these are then integrated into the current upgrade. Afterwards, the system checks to see if all modifications in the current R/3 system are covered by the change requests created during the first system upgrade. If this is the case, no adjustments are made during the current upgrade. Note: For this process to be effective, it is important that all systems involved have identical system landscapes. This can be guaranteed by first making modifications in your development system and then transporting them to later systems before you upgrade the development system. You can also guarantee that all of your systems have an identical system landscape by creating your development system before upgrade as a copy of your production system and then refraining from modifying the production system again until after upgrade.

?SAP AG

BC425 Enhancements and Modification

3-23

Modifications

The amount of work necessary at upgrade increases... W ith the number of SAP objects that your ABAP development projects depend on Every time SAP changes the objects that you call or have modified W ith the importance of the SAP objects you have modified.

Modified Repository objects create a significant amount of additional work at upgrade. R

© SAP AG

SAP only changes the following Repository objects in an upwardly compatible manner. They should therefore be considered 'uncritical' by customers who want to call them: Function modules that have been released BAPIs Includes for user exits Customer exits. After an upgrade, you must test customer reports that call SAP objects, as well as all objects displayed in the upgrade utility SPAU. This is also true for Repository objects that have been automatically adjusted using the Modifications Assistant (from Release 4.5A). You must be familiar with the processing logic of your application in order to be able to adjust programs properly.

?SAP AG

BC425 Enhancements and Modification

3-24

Modifications

Modifications: Critical Repository Objects ABAP Dictionary

Function Groups

Other

--------- Deleting SAP Repository objects --------Forbidden Changing the type or length of a domain, an elementary type, or of a table field

Making incompatible changes to SAP function modules

Inserting key fields Very critical

Critical

Changing conversion routines, value tables, or fixed values in domains

Making changes to the process types of SAP function modules

Tables, fields, and selection criteria in views

Transaction codes

Tables and fields in lock objects and m atchcode objects

M essages Logical databases

Matchcode ID adm inistration

R

© SAP AG

Modifications can be categorized as 'critical' if They affect numerous other Repository objects (Dictionary objects or function modules, for example) Modification adjustment is either difficult (as with menus, pushbuttons, and GUI interfaces up to 4.5A) or not supported by a tool (transaction codes, message classes, logical databases). Without the Modification Assistant (prior to Release 4.5A), both modifying GUI statuses and GUI titles, as well as assigning customer function modules to SAP function groups, should be considered 'critical' activities.

?SAP AG

BC425 Enhancements and Modification

3-25

Modifications

Avoiding Adjustments The SAP Enhancement Concept no changes are m ade to SAP objects and therefore no adjustments must be m ade during an upgrade

Online Correction Services (OCS) allow you to automatically import and cancel preliminary corrections

Return to the SAP Standard The versions database and entries both in the W orkbench Organizer and in the Change and Transport System rem ain intact R

© SAP AG

Modification adjustment is not necessary if you avoid making changes to SAP objects. Use program enhancements and appends with SAP tables to enhance SAP objects in such a way that they your changes cannot be overwritten by SAP at upgrade. From Release 3.0, you can use Online Correction Services to automatically import and cancel hot packages and patches (instead of having to insert preliminary corrections manually).

?SAP AG

BC425 Enhancements and Modification

3-26

Modifications

Modifications Overview Making Modifications Critical Success Factors Modification Adjustments User Exits

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

3-27

Modifications

User Exits Type of enhancements used in SD Consist of empty subroutines (FORM routines) in special includes SAP never alters these includes ever Include names must satisfy a special naming convention The use of user exits is technically considered modification

R

© SAP AG

User exits are a type of system enhancement that were originally developed for the R/3 Sales and Distribution Module (SD). The original purpose of user exits was to allow the user to avoid modification adjustment. A user exit is generally a very rudimentary type of enhancement, since technically objects in the SAP namespace are being modified. SAP application developers create a special include in either a module pool or a function group. These includes contain one or more subroutines routines that satisfy the naming convention userexit_ The calls for these subroutines have already been implemented in your program. Usually global variables are used. After delivering them, SAP never alters includes created in this manner; if new user exits must be delivered in a new release, they are placed in a new include program.

?SAP AG

BC425 Enhancements and Modification

3-28

Modifications

User Exits: An Example ***INCLUDE MV45AFZB . ************************************************************ * This include is reserved for user modifications * * Forms for sales document processing * * The name of modification modules should begin with 'ZZ'. * ************************************************************ * *&----------------------------------------------------------------* *& Form USEREXIT_FILL_VBAP_FROM_HVBAP *&----------------------------------------------------------------* * This user exit can be used to fill additional data into * * VBAP from the main item (HVBAP), that is, this user exit * * is called when an item is entered with reference to a main* * item. This form is called from form VBAP_FUELLEN_HVBAP. * *-----------------------------------------------------------------* FORM userexit_fill_vbap_from_hvbap. * VBAP-zzfield = HVBAP-zzfield2. ENDFORM. R

© SAP AG

User exits are actually empty subroutines that SAP developers provide you with. You can fill them with your own source code. The purpose behind this type of system is to keep all changes well away from program source code and store them in include programs instead. To this end, SAP developers create various includes that fulfill the naming conventions for programs and function groups. The last two letters in the name of the include refer to the include that the customer should use: "Z" is usually found here. Example: Program SAPMV45A Include MV45AFZB This naming convention guarantees that SAP developers will not touch this include in the future. For this reason, includes of this nature are not adjusted during modification upgrade. The subroutine call is already implemented in the programt. The interface is already defined. Normally, subroutines of this type only work with global data. If any new user exits are delivered by SAP with a new release, then they are bundled into new includes that adhere to the same naming convention.

?SAP AG

BC425 Enhancements and Modification

3-29

Modifications

Using User Exits Look in the SAP Reference Implementation Guide for where to use user exits. Read the relevant documentation Follow the steps described in the documentation

R

© SAP AG

You can find a list of all user exits in the SAP Reference Implementation Guide. There, you will also find documentation explaining why SAP developers have created a particular user exit. Follow the steps described in the Implementation Guide.

?SAP AG

BC425 Enhancements and Modification

3-30

Modifications

Summary You must register all modifications in OSS. SAP versions are compared with customer versions during modification adjustment. Change requests lock all objects that they contain. Therefore, all existing requests that contain objects in need of adjustment must also be released before an upgrade. ABAP Dictionary objects are adjusted during an upgrade, program objects are adjusted after an upgrade. User exits are made up of include modules (created by SAP developers) and the subroutines that they contain. You can use these subroutines for additional source code. R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

3-31

Enhancements to Dictionary Elements

Enhancements to Dictionary Elements Table enhancements Field exits Text enhancements

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

4-1

Enhancements to Dictionary Elements

Objectives At the conclusion of this unit, you will be able to: Create table enhancements Use field exits Alter data element keywords and documentation without having to modify your system

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

4-2

Enhancements to Dictionary Elements

Enhancements to Dictionary Elements Table Enhancements

Field Exits

Text Enhancements

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

4-3

Enhancements to Dictionary Elements

Table Enhancements: Overview There are two ways that you can add additional fields to tables without modifying your system: Append structures Append structures are created for use with a specific table Multiple append structures can be used with a single table Can be used just like any other structure

Customizing includes Must be preplanned by an SAP developer Are created by the customer

R

© SAP AG

Tables and structures can be expanded in one of two different ways: Append structures allow you to enhance tables by adding fields to them that are not part of the standard. With append structures, customers can add their own fields to any table or structure they want. Append structures are created for use with a specific table. However, a table can have multiple append structures assigned to it. If customers know in advance that one of the tables or structures delivered to them by SAP needs to have customer-specific fields added to it, an SAP application developer can include these fields in the table using a Customizing include statement. The same Customizing include can be used in multiple tables or structures. This provides for consistency in these tables and structures whenever the itself include is altered. Nonexistent Customizing includes do not lead to errors.

?SAP AG

BC425 Enhancements and Modification

4-4

Enhancements to Dictionary Elements

Append Structures Field A Field B Append structure

Table Field 1 Field 2 Field 3

Field 1 Field 2 Field 3 Field A Field B

R

© SAP AG

Append structures allow you to attach fields to a table without actually having to modify the table itself. Append structures may only be assigned to a single table. A table may, however, have several append structures attached to it. Whenever a table is activated, the system searches for all active append structures for that table and attaches them to the table. If an append structure is created or changed and then activated, the table it is assigned to is also activated, and all of the changes made to the append structure take effect in the table as well. You can use append structures in ABAP programs just as you would any other structure. Note: When you copy tables that have append structures attached to them, the fields that were found in the append structure of the original table become part of the actual body of the target table.

?SAP AG

BC425 Enhancements and Modification

4-5

Enhancements to Dictionary Elements

Append Structures at Upgrade Field A Field B Append structure

Table Field 1 Field 2 Field 3 Field 4 New SAP version is imported

Activation Field is appended in the database

Field 1 Field 2 Field 3 Field 4

Field 1 Field 2 Field 3 Field A Field B Field 4

R

© SAP AG

You create append structures in the customer namespace.This protects them from being overwritten at upgrade or during release upgrade. During both upgrades and release upgrades, new versions of standard tables are loaded. The fields contained in active append structures are then appended to the new standard tables when these new standard tables are activated for the first time. From Release 3.0, the field sequence in the ABAP Dictionary is allowed differ from the field sequence in the database. Therefore, no conversion of the database table is necessary when adding an append structure or inserting fields into an existing one. All necessary structure adjustment is taken care of automatically when you adjust the database catalog (ALTER TABLE). The table's definition is changed when it is activated in the ABAP Dictionary and the new field is appended to the database table. Pay attention to the following points when using append structures: • You cannot create append structures for pool and cluster tables. • If a table contains a long field (either of data type LCHR or LRAW), then it is not possible to expand the table with an append structure. This is because long fields of this kind must always be the last field in their respective tables. No fields from an append structure may be added after them. • If you use an append structure to expand an SAP table, the field names in your append structure must be in the customer namespace, that is, they must begin with either YY or ZZ. This prevents naming conflicts from occuring with any new fields that SAP may insert in the future.

?SAP AG

BC425 Enhancements and Modification

4-6

Enhancements to Dictionary Elements

Customizing Includes Customizing transaction or SAP enhancement Customizing include Field A Field B

Table A Field 1 Field 2 CI_Incl Field 3

Table B Field L Field M CI_Incl Field N

Field 1 Field 2 Field 3 Field A Field B Field L Field M Field N Field A Field B R

© SAP AG

Some of the tables and structures delivered with the R/3 standard contain special include statements calling Customizing includes. These are often inserted in those standard tables that need to have customer-specific fields added to them. In contrast to append structures, Customizing includes can be inserted into more than one table. This provides for data consistency throughout the tables and structures affected whenever the include is altered. Customizing include programs are part of the customer namespace: all of their names begin with 'CI_'. This naming convention guarantees that nonexistent Customizing includes do not lead to errors. No code for Customizing includes is delivered with the R/3 standard. You create Customizing includes using special Customizing transactions. Some are already part of SAP enhancements and can be created by using project management (see the unit on 'Enhancements using Customer Exits'). The Customizing include field names must lie in the customer namespace just like field names in append structures. These names must all begin with either 'YY' or 'ZZ'. When adding the fields of a Customizing include to your database, adhere to same rules you would with append structures.

?SAP AG

BC425 Enhancements and Modification

4-7

Enhancements to Dictionary Elements

Enhancements to Dictionary Elements Table Enhancements

Field Exits

Text Enhancements

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

4-8

Enhancements to Dictionary Elements

Global Enhancements SAP

Customer

Defines global enhancements Defines data elements Creates field exits Documents data elements

Changes keywords and short texts

R

© SAP AG

Every time they define a data element, SAP application programmers create keywords of different lengths and a short text. Customers can use the project management function to change keywords and short texts. Customers can also use the project management function to create field exits. Field exits are processed when the user leaves a screen that contains a field which refers to a data element containing a field exit.

?SAP AG

BC425 Enhancements and Modification

4-9

Enhancements to Dictionary Elements

Field Exits SAP R/3 System

Help

ABAP Dictionary Field 1 Field 2

Function module

Entry Entry

Obligatory Obligatory field field checks checks

Field form Field format format at checks checks and and field field transport transport

Foreign Foreign key key checks checks R

© SAP AG

SAP allows you to install field exits for every screen field with an ABAP Dictionary reference. Field exits cause the system to branch to a function module at PAI.

?SAP AG

BC425 Enhancements and Modification

4-10

Enhancements to Dictionary Elements

Global and Local Field Exits Program one System

FIELD_EXIT_DTEL Data element DTEL

Help

Field 1 Field 2 Program two System

Help

Field 1 Field 2

FIELD_EXIT_ LOCTEL_1

Program three System

Help

Field 1 Field 2

FIELD_EXIT_LOCTEL_2

FIELD_EXIT_LOCTEL_3

Data element LOCTEL R

© SAP AG

Field exits take you from a screen field with a data element reference to a function module. Field exits can be either global or local: Global field exits are not limited to a particular screen. If a global field exit's data element is used on multiple screens, you will branch to a function module from all of these screens once the exit has been activated. Here you can, for example, edit the contents, force a new entry to be made by outputting an error message, or prohibit certain users from proceeding further. Local field exits are valid for one screen only. If you assign a screen from a specific program to the data element, then you will only branch to a function module from this screen once the exit has been activated. To be able to allow different functionality on different screens referring to the same data element, you can assign exit numbers to data elements. Each exit number refers to a different function module. Field exit function modules adhere to the following naming convention: prefix: FIELD_EXIT_ name: _ suffix (optional): 0 to 9, A to Z

?SAP AG

BC425 Enhancements and Modification

4-11

Enhancements to Dictionary Elements

Creating Field Exits Function Builder System

Help

1

Function module

2

FIELD_EXIT_DTEL

Global enhancements

Create field exit

3 Field exit for data elem ent ...? 4 Create function m odule 5 Edit function module 6 Activate function module 7 8

Assign program/screen (for local field exits only)

Activate field exit

Function module: Interface System

Help

Im port parameter

INPUT Export parameter

R

OUTPUT © SAP AG

The function module interface contains the import parameter INPUT and the export parameter OUTPUT. You must assign a value to the OUTPUT field in a function module's source code in order to transport its field contents back to the SAP screen. Field exits are only taken into account during screen generation if profile parameter abap/fieldexit = YES has been set on all application servers (this profile parameter is set to 'NO' in the default profile). The following ABAP statements are not allowed in field exit function modules: BREAK-POINT CALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMIT COMMIT WORK, ROLLBACK WORK COMMUNICATION RECEIVE EXIT FROM STEP-LOOP MESSAGE I, MESSAGE W external PERFORM When you debug a screen that is referenced by a field exit, the field exit code is ignored by the debugger. As with any normal function module, you can, however, debug the field exit code in the Function Builder's test environment just.

?SAP AG

BC425 Enhancements and Modification

4-12

Enhancements to Dictionary Elements

Enhancements to Dictionary Elements Table Enhancements

Field Exits

Text Enhancements

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

4-13

Enhancements to Dictionary Elements

Text Enhancements SAP

Customer

SAP R/3 System Help

SAP R/3 System

SAP keyword

Help

Custom er keyword

? SAP documentation docum entation ..... ..... .....

? SAP documentation ..... ..... Custom er documentation Customer ..... R

© SAP AG

Possible text enhancements include customer keywords and customer documentation of data elements. Text enhancements differ from other application enhancements in that they take effect globally in all related SAP applications after activation (global enhancements).

?SAP AG

BC425 Enhancements and Modification

4-14

Enhancements to Dictionary Elements

Editing Text Enhancements Project Management Managem ent System

Help

Project Global enhancements Keywords

Data elements

SAP R/3 System

SAP R/3

Help

Customer keywords: Short: Medium: Long: Header: Customer short text:

System

Help

Customer docum entation:

? R

© SAP AG

Use the project management function to edit text enhancements. Just as with field exits, use the menu entry Global enhancements to access the enhancement functions for keywords and data element documentation

?SAP AG

BC425 Enhancements and Modification

4-15

Enhancements to Dictionary Elements

Keywords SAP

Customer

Defines data elements

Defines global enhancements

Keyword

Keyword

short: medium: long: Header: Short text (F1):

short: medium: long: Header: Short text (F1):

R

© SAP AG

SAP application programmers define keywords in different lengths and a short description for each data element. Use the project management function (transaction CMOD) to change these keywords and short texts. All screen fields that use the keyword text of data elements can be renamed in this manner. A new short text in a data element will show up in the F1 help of the screen field.

?SAP AG

BC425 Enhancements and Modification

4-16

Enhancements to Dictionary Elements

Keyword Change Requirements SAP Screen Painter

Field list

Screen Painter: Field list System

Help

. .

E A

MOD

LFA1-LFNR LFA1-LFNR . . .

R

© SAP AG

In order for keyword changes to take effect on a screen, SAP application programmers have to maintain the MOD attribute (keyword modification indicator) of the affected field accordingly in the Screen Painter field list. The MOD attribute must have one of the following values: SPACE: the keyword that best fits the field length 1: short keyword 2: medium keyword 3: long keyword 4: keyword for header V: variable text transfer from the ABAP Dictionary F: fixed, no text transfer If the attribute contains an 'F', it is fixed on the screen and cannot be modified. In all other cases, screens that refer to that particular data element will show the changed keyword.

?SAP AG

BC425 Enhancements and Modification

4-17

Enhancements to Dictionary Elements

Keyword Changes and Release Upgrades SAP

Customer

Release x.x

Release x.x SAP R/3

SAP R/3 System

System

Help

Help

Old SAP keyword

Custom er keyword

Release y.y Release y.y SAP R/3 System

Help

SAP R/3 System

Help

New SAP keyword

New SAP keyword

Restore customer

Release x.x SAP R/3 System

Help R

Custom er keyword © SAP AG

You must restore keywords after a release upgrade or after new corrections have been imported, if SAP has redelivered existing keywords. If you want to retain your own keywords from the last release, choose the menu option Restore customer. SAP recommends that you always restore your keywords after a release upgrade. Keywords are restored by a program running in the background. This program checks all of the data elements that you have edited and restores their keywords and short texts if necessary. With certain central keywords, such as BUKRS or MANDT, we recommend that you start the restoration process at a time when the contents of the tables that use BUKRS and MANDT are not being changed. Otherwise, activation of the data element may not work, changing it to only partially active.

?SAP AG

BC425 Enhancements and Modification

4-18

Enhancements to Dictionary Elements

Restoring SAP Keywords SAP

Customer Release x.x SAP R/3 System

Release x.x

Help

Custom er keyword

SAP R/3 System

Help

Restore SAP

SAP keyword

Release x.x SAP R/3 System

Help

SAP keyword

R

© SAP AG

To undo keyword changes, choose the menu option Restore SAP. Keywords are restored by a program running in the background. This program checks all of the data elements that you have edited and restores their keywords and short texts if necessary. With certain central keywords, such as BUKRS or MANDT, we recommend that you start the restoration process at a time when the contents of the tables that use BUKRS and MANDT are not being changed.

?SAP AG

BC425 Enhancements and Modification

4-19

Enhancements to Dictionary Elements

Enhanced Documentation for Data Elements Customer

SAP

Global enhancements

Data elements

Data elements Documentation Customer documentation SAP R/3 System

SAP R/3

Help

System

SAP documentation:

Help

INCLUDE Customer docum entation: R

© SAP AG

When enhancing data element documentation, include your SAP documentation as an include module. By doing this, you maintain all references to the SAP documentation, including documentation delivered by SAP at a later date. If you press the F1 key while on the appropriate field after you have activated your documentation, your text will appear in addition to the SAP documentation. You can generate a list of data elements that have been changed and edit the documentation by choosing the elements' corresponding lines in the list. Simply delete your own documentation if you want original SAP documentation to be displayed.

?SAP AG

BC425 Enhancements and Modification

4-20

Enhancements to Dictionary Elements

Customer Documentation Global enhancements Data elements Customer documentation

SAP R/3 System

SAP R/3

Help

System

INCLUDE

Help

:

Customer docum entation: Customer docum entation: R

© SAP AG

You also have the option to create your own data element documentation independent of the SAP documentation. This is, however, not recommended, since the reference to SAP documentation is lost. If SAP delivers a new version of the documents in question, you may miss important information. You may also use the SAP documentation module in your own documentation in expanded form. You should only do this, however, if changes to the contents of the original documentation are absolutely necessary in your R/3 System. The reference to SAP documentation is not totally lost in this case, but any changes that appear in later versions it will not be reflected in your system.

?SAP AG

BC425 Enhancements and Modification

4-21

Enhancements to Dictionary Elements

Summary: Text Enhancements Customer Custom er short texts and customer custom er docum entation documentation

Customer keywords

SAP R/3 System

Help

SAP keyword

R

© SAP AG

SAP customers can enhance the R/3 System with their own keywords, short texts, and documentation for data elements. These enhancements can be made using the project management function. Once they are activated, enhancements of this kind are available in all SAP applications that use the data elements in question.

?SAP AG

BC425 Enhancements and Modification

4-22

Enhancements to Dictionary Elements

Summary Table enhancements allow you to add your own fields to SAP tables without having to modify your system You can enhance the functionality of specific screen fields by using field exits Text enhancements allow you to replace SAP keywords with your own keywords You can also enhance your documentation and design your own help topics

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

4-23

Enhancements using Customer Exits

Enhancements using Customer Exits Overview Enhancement management Function module exits Menu exits Screen exits

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

5-1

Enhancements using Customer Exits

Objectives At the conclusion of this unit, you will be able to: Describe the individual components of enhancements Create enhancement projects Explain how to attach enhancement projects to change requests Tell the difference between components, enhancements, and enhancement projects Transport an enhancement project R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

5-2

Enhancements using Customer Exits

Enhancements using Customer Exits Overview Enhancement Management Function Module Exits Menu Exits Screen Exits R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

5-3

Enhancements using Customer Exits

SAP Application Enhancements SAP

Customer

develops

Application functions

uses

defines

Enhancement components

edits

puts together

Application enhancements

activates

R

© SAP AG

Application enhancements allow customers to enhance their application functions. Customer exits are preplanned by SAP and generally consist of several components. Application enhancements are inactive when delivered and can be completed and activated by customers as they are needed. Application enhancement characteristics: Each enhancement provides you with a set of preplanned, precisely defined functions. Each interface between SAP and customer functions is clearly defined. As a customer, you do not need in-depth knowledge of how to implement SAP applications. You do not need to adjust enhancements at upgrade because of new functions that SAP has developed.

?SAP AG

BC425 Enhancements and Modification

5-4

Enhancements using Customer Exits

Customer Enhancement Projects SAP

Customer

Defines SAP enhancements

Defines enhancement projects

SMOD

CMOD

R

© SAP AG

SAP application programmers create SAP enhancements in transaction SMOD using function module exits, menu exits, and screen exits. Customers are given a catalog containing an overview of existing SAP enhancements. They can then combine the SAP enhancements they want into an enhancement project using transaction CMOD.

?SAP AG

BC425 Enhancements and Modification

5-5

Enhancements using Customer Exits

SAP Enhancem ents and Customer Enhancement Projects SAP

Customer

K

K

E

E

P

K

K K

E E

K

P

E E

K

K K K

E K R

K

Com ponent

E

SAP enhancement

P

Custom er enhancement project

© SAP AG

SAP enhancements are made up of component parts. These components include function module exits, menu exits, and screen exits. A specific component may be used only once in a single SAP enhancement (this guarantees the uniqueness of SAP enhancements). Customer enhancement projects consist of SAP enhancements. Each individual SAP enhancement may be used only once in a single customer enhancement program (this guarantees the uniqueness of a customer project).

?SAP AG

BC425 Enhancements and Modification

5-6

Enhancements using Customer Exits

Enhancements using Customer Exits Overview Enhancement Management Function Module Exits Menu Exits Screen Exits R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

5-7

Enhancements using Customer Exits

The SAP Enhancement Creation Procedure Define customer exits in application functions

Function module exits Menu exits Screen exits

C

Combine components to form SAP enhancements

C

E C

Document enhancements

SAP documentation: R

© SAP AG

SAP application programmers plan possible enhancements in their applications, define the necessary components, and combine these components to create various SAP enhancements. The programmers document their enhancements as best they can, so that customers can implement the enhancements without having to analyze program source code or screen source code.

?SAP AG

BC425 Enhancements and Modification

5-8

Enhancements using Customer Exits

Implem enting Enhancements in Customer Systems Put together an enhancem ent project using SAP enhancem ents

E

E P

E

Function m odules Edit the enhancem ent enhancement project’ project’ s components com ponents

Menu entries Subscreens

Docum ent the Document enhancem ent project enhancement

Custom er docum entation:

Activate the enhancem ent project

Activation

R

© SAP AG

First, use the project management function to choose the SAP enhancements that you want and create an enhancement project. Next, edit your individual components using the project management function and document the entire enhancement project. Finally, activate the enhancement project (this activates all of the project's component parts).

?SAP AG

BC425 Enhancements and Modification

5-9

Enhancements using Customer Exits

Creating Customer Enhancement Projects Project Management Managem ent System

Help

Project

Create

Attributes System

Help

Descript.

R

Save © SAP AG

Start the project management function (transaction CMOD) and give your enhancement project a name. SAP recommends that you think up a naming convention for all of your projects. You can, for example, include the project's transaction or module pool in its name. All enhancement project names must be unique. Next, branch to the project's attributes and enter a short text describing the enhancenent project. The system inserts all of the project's other attributes (such as created by, created on, or status).

?SAP AG

BC425 Enhancements and Modification

5-10

Enhancements using Customer Exits

Assigning SAP Enhancements to Custom er Projects Project Management Managem ent System

Help

Project

Change SAP enhancements enhancem ents SAP E nhancements nhancem ents System

Help

SAP Enhancements

R

Save © SAP AG

Use the project management function (transaction CMOD) to assign SAP enhancements to customer enhancement projects. Enter the names of the SAP enhancements you want to use on the appropriate screen. The search function gives you a catalog-like overview of existing SAP enhancements. From there you can select those enhancements that are of interest to you.

?SAP AG

BC425 Enhancements and Modification

5-11

Enhancements using Customer Exits

Editing Components Project Management M anagement System

Help

Project Change com ponents SAP Enhancements System

Help

SAP Enhancements

Edit com ponents Function Builder System

Help

Function m odule

Menu Text System

Help

Screen Painter System

New text

Help R

© SAP AG

Use the product management function to edit the components of your enhancement project. Depending on whether the component you are editing is a function module, a menu entry, or a subscreen, you branch to either the Function Builder, a dialog box for entering menu entries, or to the Screen Painter.

?SAP AG

BC425 Enhancements and Modification

5-12

Enhancements using Customer Exits

Activating Enhancement Projects

Project Management System

Help

Project

Activate project

R

© SAP AG

Activation of an enhancement project affects all of its components. After successful activation, the project has the status active. During activation, all programs, screens, and menus containing components that belong to the project are regenerated (programs at the time they are executed). After activation, you can see the enhancements in your application functions. The Deactivate function allows you to reset an enhancement project's status to inactive.

?SAP AG

BC425 Enhancements and Modification

5-13

Enhancements using Customer Exits

Transporting Projects System A

Customer transport

System B

I

I I

I

P

Change request

I

P

I

P

Customer projects

I

Includes

R

© SAP AG

Before you transport enhancement projects, you must first assign your project and each individual include that it contains (include programs, subscreens, includes with subscreen module pools) to one or more tasks within a change request.

?SAP AG

BC425 Enhancements and Modification

5-14

Enhancements using Customer Exits

Summary: Enhancement Management

K

Component

P

E

SAP Enhancement

I

Customer enhancem ent projects Includes R

© SAP AG

SAP application programmers preplan function module exits, menu exits, and screen exits for their applications and combine them to create useful enhancements for the R/3 System. Customers create their own enhancement projects for their systems using SAP enhancements. You can customize the individual components of an enhancement project by creating your own include programs (for function module exits), texts (for menu exits), and subscreens (for screen exits).

?SAP AG

BC425 Enhancements and Modification

5-15

Enhancements using Customer Exits

Enhancements using Customer Exits Overview Enhancement Management Function Module Exits Menu Exits Screen Exits R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

5-16

Enhancements using Customer Exits

Program Exits SAP defines

Customer Function module exits

activates

call

Administration

Function modules

Interface

Source code

Documentation

R

© SAP AG

Function module exits allow customers to implement additional logic in application functions. SAP application programmers define where function module exits are inserted and what kind of data they transfer. SAP programmers also create an exit's corresponding function modules complete with short text, interface, and documentation, as well as describing each function module exit's intended purpose in the SAP documentation. You write the source code for the function modules yourself. If need be, you must also create your own screens, text elements, and includes for the function group. The system processes your ABAP code for the first time whenever the enhancement project (of which your function module is a component) is activated as a whole. Function module exits have no effect prior to enhancement project activation.

?SAP AG

BC425 Enhancements and Modification

5-17

Enhancements using Customer Exits

Calling and Creating Function Modules PROGRAM . . . . CALL CUSTOMER-FUNCTION '001'. . . .

FUNCTION-POOL SAPLX. . . . FUNCTION exit__001. . . . ENDFUNCTION. R

© SAP AG

SAP application programmers use the ABAP statement CALL CUSTOMER-FUNCTION 'nnn' to call function modules (where 'nnn' is a three-digit number). They must also create the function module they want to call and its related function group. These function modules are always belong to function groups whose names begin with X (X function groups). The following naming convention applies to these function modules: prefix: EXIT name of the program that calls the function module suffix: three-digit number The three parts of the name are separated by two underscores. The CALL CUSTOMER-FUNCTION statement is not executed until the corresponding enhancement project is activated. Multiple calls of the same function module are all activated at the same time.

?SAP AG

BC425 Enhancements and Modification

5-18

Enhancements using Customer Exits

Assigning SAP Enhancements to Custom er Projects Project M anagement Management System

Help

Project Change components

Project M anagement Management System

Help

Function module exit exit__001 Edit components

Function Builder System

Help

FUNCTION exit__001. ... INCLUDE zxaaau01. ENDFUNCTION. Choose object

ABAP Editor System

Help

*INCLUDE zxaaau01.

R

© SAP AG

Use the project management function (transaction CMOD) to edit function modules for function module exits. Use the pushbutton for editing components to branch directly to the function module editor (display mode). DO NOT change the function module itself. It is especially important that you do not alter the interface in any way. The function module does , however, contain an INCLUDE statement for an include program that you have to create. Double-click on the object you want to select. This automatically takes you to the editor of the include program, where you can enter your code.

?SAP AG

BC425 Enhancements and Modification

5-19

Enhancements using Customer Exits

Organization of an X Function Group SAP INCLUDE INCLUDE INCLUDE INCLUDE

Customer

LXaaaTOP. LXaaaTOP. LXaaaUXX. LXaaaUXX. LXaaaF00. LXaaaF00. ZXaaaZZZ. ZXaaaZZZ.

*INCLUDE ZXaaaZZZ.

INCLUDE LXaaaU01. LXaaaU01. INCLUDE LXaaaU02. LXaaaU02. FUNCTION exit_< program_name >_001. ... ...

INCLUDE ZXaaaU01. ZXaaaU01.

*INCLUDE ZXaaaU01.

ENDFUNCTION. FUNCTION-POOL SAPLXaaa. SAPLXaaa. INCLUDE LXaaaTAP. INCLUDE ZXaaaTOP.

*INCLUDE ZXaaaTOP. R

© SAP AG

Function groups created by SAP application programmers contain include programs that beginning with both LX and ZX. Only those includes whose names begin with ZX may be changed by customers. No additional function modules or includes may be added to a function group. Use include program ZxaaaUnn to write the source code for function modules of a function module exit.

?SAP AG

BC425 Enhancements and Modification

5-20

Enhancements using Customer Exits

Customer Source Code SAP

Customer

FUNCTION exit_< program_name >_001 ... ...

INCLUDE ZXaaaU01. ZXaaaU01.

*INCLUDE ZXaaaU01. DATA: .... FORM ...

ENDFUNCTION.

MODULE ... INCLUDE LXaaaF01. LXaaaF01. customers> ...

GET ... AT ...

R

© SAP AG

The INCLUDE statement for program ZXaaaUnn is located a FUNCTION ... ENDFUNCTION block. Because of this, neither events, nor subroutines(FORM) or modules (MODULE) are allowed here. Data declarations made here with DATA are local. SAP application programmers can supply default code by creating an include program LxaaFnn and documenting this include in the SAP enhancement (here 'nn' represents the number assigned internally for the function module in include LXaaaUXX). You can copy the source code from this include into your own customer include program ZXaaaUnn using the project management transaction. You can create your own text elements for function groups.

?SAP AG

BC425 Enhancements and Modification

5-21

Enhancements using Customer Exits

Global Data: SAP and the Customer SAP

Customer

FUNCTION-POOL SAPLXaaa. SAPLXaaa. INCLUDE LXaaaTAP INCLUDE ZXaaaTOP. ZXaaaTOP.

*INCLUDE ZXaaaTOP TABLES: ... DATA: ...

* INCLUDE LXaaaTAP TABLES: ... DATA: ... *INCLUDE ZXaaaU01 FUNCTION exit_< program_name>_ 001. ...

...

INCLUDE ZXaaaU01. ...

MESSAGE E123(YZ) WITH ...

ENDFUNCTION. R

© SAP AG

SAP application programmers can declare global data in include program LxaaaTAP. You declare your own global data in include program ZXaaaTOP. Include program LXaaaTOP also contains the FUNCTION-POOL statement, which may not be changed. Therefore, you must always include the message class in parentheses when outputting messages.

?SAP AG

BC425 Enhancements and Modification

5-22

Enhancements using Customer Exits

Subroutines, Modules: SAP and the Customer SAP INCLUDE INCLUDE INCLUDE INCLUDE

LXaaaTOP. LXaaaTOP. LXaaaUXX. LXaaaUXX. LXaaaF01. ZXaaaZZZ. ZXaaaZZZ.

Customer *INCLUDE ZXaaaZZZ. INCLUDE ZXaaaF01. INCLUDE ZXaaaO01. INCLUDE ZXaaaI01.

* INCLUDE LXaaaF01. FORM ... . ENDFORM .

INCLUDE ZXaaaE01.

AT ... MODULE ... INPUT. .. MODULE ... OUTPUT. FORM ... ...

R

© SAP AG

SAP application programmers can supply customers with default subroutines in include LXaaaF00. Subroutines, modules, and interactive events (AT…) are created as include programs and included enhancements using include program ZXaaaZZZ. Additional includes must adhere to the following naming convention: ZXaaaFnn ZXaaaOnn ZXaaaInn ZXaaaEnn

?SAP AG

for subroutines, for PBO modules, for PAI modules, for events.

BC425 Enhancements and Modification

5-23

Enhancements using Customer Exits

Customer Screens Customer

SAP FUNCTION exit_< program name >_001. ... INCLUDE ZXaaaU01. ZXaaaU01. ... ENDFUNCTION.

INCLUDE LX aaa TOP. INCLUDE LX aaa UXX. INCLUDE ZX aaa ZZZ.

*INCLUDE ZXaaaU01. ... CALL SCREEN STARTING AT ....

*INCLUDE ZXaaaZZZ. INCLUDE ZXaaaO01. INCLUDE ZXaaaO02. ... INCLUDE ZXaaaI01.

*INCLUDE ZXaaaO01. MODULE ... OUTPUT. ... ENDMODULE. R

© SAP AG

You can use CALL SCREEN to call your own screens. Create the related include programs for your screens' PBO and PAI modules in include program ZXaaaZZZ.

?SAP AG

BC425 Enhancements and Modification

5-24

Enhancements using Customer Exits

Customer Screens: Modules * SAPLXaaa / screen 9nnn PROCESS BEFORE OUTPUT. MODULE customer_pbo. customer_pbo. PROCESS AFTER INPUT. MODULE customer_pai. * INCLUDE ZXaaaO01 MODULE customer_pbo OUTPUT. ... ENDMODULE.

* INCLUDE ZXaaaI01 MODULE customer_pai INPUT. ... R

ENDMODULE. © SAP AG

Use forward navigation (select an object and then double-click on it) to create your own screens and modules. Screens created in this manner are automatically given the name of the function module's main program (SAPLXaaa). The PBO modules for these screens can be found in include ZXaaaOnn, the PAI modules in include ZXaaaInn.

?SAP AG

BC425 Enhancements and Modification

5-25

Enhancements using Customer Exits

Summary: Function Module Exits Text elements Additional processing logic SAP R/3 System

Help

Graphical user interface

SAP application

Processing logic

SAP R/3 System

Help

Customer screens

R

© SAP AG

Customers can enhance SAP applications by adding their own processing logic at predefined points. Such enhancements can include customer screens with their corresponding processing logic and graphical user interface, as well as text elements created by customers.

?SAP AG

BC425 Enhancements and Modification

5-26

Enhancements using Customer Exits

Enhancements using Customer Exits Overview Enhancement Management Function Module Exits Menu Exits Screen Exits R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

5-27

Enhancements using Customer Exits

Menu Exits SAP

Menu#1

Menu#2 Function 1 Function 2 Function 3

Customer

SAP R/3 Menu#3 System

Help

Menu#1

Menu#2

SAP R/3 Menu#3 System

Help

Function 1 Function 2 Function 3 Customer function

R

© SAP AG

Menu exits allow you to attach your own functions to menu options. SAP application programmers reserve certain menu entries in your GUI interface for this. This allows you to define a text for the reserved menu entry and add your own logic, usually in the form of a related function module exit. Once you activate menu exits, they become visible in the application. Whenever this menu option is chosen, the system processes either a function provided by SAP application programmers or your own function that you have implemented in a function module exit.

?SAP AG

BC425 Enhancements and Modification

5-28

Enhancements using Customer Exits

Menu Exit Requirements SAP

Interface definition

Function BACK DISP + CU1 + CU2 . .

Description Back Display . .

R

© SAP AG

In order for you to be able to implement menu exits, SAP application programmers must equip the GUI interface of your application program with function codes that begin with a plus sign ('+'). These function codes are inactive at first and do not appear on the interface of the program. They only become visible in the program after you have activated them.

?SAP AG

BC425 Enhancements and Modification

5-29

Enhancements using Customer Exits

Assigning SAP Enhancements to Custom er Projects Project Management System

Help

Project Change components com ponents Project Management System

Help

Menu exit SAPMabbc+fc1 Edit components com ponents Menu Text System

Help

New text R

© SAP AG

You edit menu exits using the project management function (transaction CMOD). The pushbutton for editing components calls a dialog box where you can enter short descriptions and choose a language for each additional menu entry. You may not make any changes to the GUI interface.

?SAP AG

BC425 Enhancements and Modification

5-30

Enhancements using Customer Exits

Menu Exits and Function Module Exits PROGRAM DATA

. ok_code LIKE sy-ucomm.

... CASE ok_code. WHEN 'DISP'. ... WHEN '+CU1'. CALL CUSTOMER-FUNCTION '001' EXPORTING ... IMPORTING ... ... ENDCASE.

R

© SAP AG

SAP application programmers determine where a program reads additional function codes and how it reacts--- either with a function module exit or with a predefined function.

?SAP AG

BC425 Enhancements and Modification

5-31

Enhancements using Customer Exits

Summary: Menu Exits Function module m odule exits

Additional menu entries

SAP R/3 System

Help

SAP application

R

© SAP AG

Customers can implement menu exits based on reserved function codes. SAP application programmers define these function codes, assign them to menus, and often provide them with a corresponding function module exit. Menu exits and function module exits are both part of the same SAP enhancement. No pushbuttons may be assigned to additional function codes. You can, however, make changes to the various menu entries and activate their function codes.

?SAP AG

BC425 Enhancements and Modification

5-32

Enhancements using Customer Exits

Enhancements using Customer Exits Overview Enhancement Management Function Module Exits Menu Exits Screen Exits R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

5-33

Enhancements using Customer Exits

Screen Exits SAP

Customer

Field 1

Field 1

Field 2

Field 2

Field z

Field x Field y

R

© SAP AG

Screen exits allow you to layout reserved sections of a main screen (subscreen areas). You can either display additional information in these areas or input data. You define the necessary input and output fields on a customer screen (subscreen).

?SAP AG

BC425 Enhancements and Modification

5-34

Enhancements using Customer Exits

Subscreens in the R/3 System SAP R/3 System Help

Name Phone no.

200

SAP R/3

Name

System Help

Meyer

Last name

Klaus

abcd

Phone no. 45678 Last name

200

SAP R/3 System Help

abcd

Last name P. O. box

P. O. box

Fax no.

Fax no.

Meyer 11334

abcd 67890

300

R

300

© SAP AG

Subscreens are rectangular areas on your screen that are reserved for displaying additional screens at runtime. Each subscreen area can be filled with a different screen (of type subscreen) at runtime.

?SAP AG

BC425 Enhancements and Modification

5-35

Enhancements using Customer Exits

Calling Subscreens Main screen flow control PROCESS BEFORE OUTPUT. CALL SUBSCREEN abcd INCLUDING sy-cprog '0100'. ... PROCESS AFTER INPUT. CALL SUBSCREEN abcd. ... MODULE ok_code_processing. R

© SAP AG

Your system determines which screen will be displayed in a subscreen area at PBO. The general syntax is as follows: CALL SUBSCREEN INCLUDING . For each subscreen, PAI and PBO events are processed just as if the subscreen were a normal screen. The sequence of "CALL SUBSCREEN" statements in your main screen's flow logic directly determines in what order the flow logic of individual subscreens is processed. Caution: Function codes are only processed in the main screen's flow logic! You are not allowed enter a name for a subscreen's command field! You are not allowed to define GUI statuses for subscreens! No value for next screen may be entered in a subscreen's flow control!

?SAP AG

BC425 Enhancements and Modification

5-36

Enhancements using Customer Exits

Defining Screen Exits SAP R/3 System

Help

Program: Program : SAPMabbc Screen: 1234 Customer field 1 Subscreen area abcd

Customer field 2 Program: SAPLXyyz Screen: 0444

PROCESS BEFORE OUTPUT. ... CALL CUSTOMER-SUBSCREEN abcd INCLUDING 'SAPLXYYZ' '0444'. ... R

© SAP AG

SAP applications programmers can reserve multiple subscreen areas on a screen. Subscreens are called from the flow control of a main screen using the statement CALL CUSTOMERSUBSCREEN. You are not allowed to enter the name of a subscreen area in quotation marks, but you must enter the name of the function group that the called screen belongs to in single quotes. You can keep the screen number a variable by using fields; the number must, however, always contain four digits. Screen exit calls are inactive at first, and are skipped when a screen is processed. Only after a corresponding subscreen has been created in an enhancement project, and this project has been activated, will the system process the screen exit. You create subscreens in X function groups. Normally, these function groups also contain function module exits.

?SAP AG

BC425 Enhancements and Modification

5-37

Enhancements using Customer Exits

Calling Customer Subscreens SAP

Customer

SAP R/3 System

Help

Field y Field z Subscreen area abcd Program: SAPMabbc

Screen: ....

PROCESS BEFORE OUTPUT. ... CALL CUSTOMER -SUBSCREEN abcd INCLUDING 'SAPLXYYZ' '0444' . ... PROCESS AFTER INPUT. ... CALL CUSTOMER-SUBSCREEN abcd.

Program: SAPLXyyz

Screen: 0444

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT.

R

© SAP AG

Whenever the statement CALL CUSTOMER-SUBSCREEN INCLUDING occurs at PBO in the flow control of a screen, a subscreen is included in the subscreen area defined by SAP application programmers. At this point, all modules called during the PBO event of the subscreen are also processed. The PAI event of a subscreen is processed when the calling screen calls the subscreen during its PAI event using the statement CALL CUSTOMER-SUBSCREEN .

?SAP AG

BC425 Enhancements and Modification

5-38

Enhancements using Customer Exits

Transporting Data to Subscreens SAP

Customer

PROCESS BEFORE OUTPUT. ... MODULE export_data. CALL CUSTOMER-SUBSCREEN CUSTOMER-SUBSCREEN abcd INCUDING 'SAPLXYYZ' '0444'. '0444'.

Program sapmabbc. DATA: f1 LIKE ... , f2 ... . ... MODULE export_data. ... CALL CUSTOMER - FUNCTION '001' EXPORTING e01 = f1 e02 = f2. ... ENDMODULE.

PROCESS BEFORE OUTPUT. MODULE a. MODULE b.

Interface

e01 e02

. . .

FUNCTION-POOL Xyyz. DATA: g1 LIKE ... , g2 ... . ... FUNCTION exit_sapmabbc_001. ... MOVE e01 TO g1. MOVE e02 TO g2. ... ENDFUNCTION. MODULE a OUTPUT. ... MOVE g1 TO .... ... R

© SAP AG

The global data of the calling program is not known to the X function group that contains your subscreen; SAP application programmers use function module exits to explicitly provide this data to subscreens. In order to facilitate data transport, modules are called in the flow control of the calling program that contain function module exits for transferring data via interface parameters. Function modules belonging to these kinds of function module exits can be found in the same function groups as their corresponding subscreens.

?SAP AG

BC425 Enhancements and Modification

5-39

Enhancements using Customer Exits

Transporting Data from Subscreens SAP

Customer PROCESS AFTER INPUT. ... MODULE m. MODULE n. ...

PROCESS AFTER INPUT. ... CALL CUSTOMER-SUBSCREEN abcd. MODULE import_data.

Program sapmabbc. DATA h1 LIKE ... , h2 .... .... ... MODULE import_data. ... CALL CUSTOMER-FUNCTION '002' IMPORTING i01 = h1 i02 = h2 ... ENDMODULE.

Interface

i01 i02

. . .

FUNCTION-POOL Xyyz. DATA k1 LIKE ... , k2 ... ... FUNCTION exit_sapmabbc_002. ... MOVE k1 TO i01. MOVE k2 TO i02. ... ENDFUNCTION. MODULE m. ... k1 = .... ...

R

© SAP AG

Data must be transported in the other direction as well, since global data from the X function group that contains your subscreen is not known to the calling program either. For this reason, SAP application programmers use function module exits to return any data that has been changed by the customer to the calling program. This is done by calling a module during the calling program's PAI event that contains a function module exit for returning customer data via interface parameters.

?SAP AG

BC425 Enhancements and Modification

5-40

Enhancements using Customer Exits

Editing Subscreens (1) Project Management M anagement System

Help

Project Change components Project M anagement Management System

Help

Screen exit SAPMabbc1234_abcd_SAPLXyyz 0444 Edit components

R

© SAP AG

Use the project management transaction (CMOD) to edit subscreens. The technical names of screen exits consist of the name of the calling program, a four-digit screen number, and the name of the subscreen area, followed by the name of the X function group's program and the number of the subscreen.

?SAP AG

BC425 Enhancements and Modification

5-41

Enhancements using Customer Exits

Editing Subscreens (2) Edit components No Create screen?

Does screen exist?

Yes Screen Painter Painter Hilfe Screen Painter

System Hilfe Screen System System

Help

Screen attributes System

Help

Screen type

* SAPLXyyz Dynpro 0444 PROCESS BEFORE OUTPUT. MODULE a . ... PROCESS AFTER INPUT. MODULE m.

Choose object Subscreen * INCLUDE ZXyyzO01 . MODULE a OUTPUT . ... R

© SAP AG

You create subscreens and their corresponding PBO and PAI modules yourself using forward navigation. Make sure that your subscreens are of screen type subscreen the first time you create them. You are not allow to alter any of the interfaces in the X function group that the subscreen and the function module exits belong to, nor are you allowed to add any of your own function modules. See also the restrictions listed on the slide entitled 'Calling Subscreens'.

?SAP AG

BC425 Enhancements and Modification

5-42

Enhancements using Customer Exits

Summary: Screen Exits Customer Custom er subscreen Custom er processing

Interface Data transfer SAP R/3 System

Help

Subscreen area R

© SAP AG

Screen exits allow you to determine the layout of certain portions of a screen yourself. You can use these areas to display additional information, or to collect and process data. Screen exits must be predefined (planned) by an SAP application programmer. Use the statement CALL CUSTOMER-SUBSCREEN to integrate these preplanned subscreen areas into the flow control of the calling screen at PBO and PAI events. As soon as you activate an enhancement project that contains a subscreen as a component, the calling screen is regenerated and the subscreen is displayed the next time the application function is called.

?SAP AG

BC425 Enhancements and Modification

5-43

Enhancements using Customer Exits

Summary Customers can enhance SAP applications at certain designated points using additional processing logic. SAP application developers plan function module exits, menu exits, and screen exits in their applications and organize them into SAP enhancements. Customers create enhancement projects using specific SAP enhancements that they decide upon themselves.

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

5-44

Business Transaction Events

Business Transaction Events What are business transaction events (BTE)? Publish & Subscribe interfaces Process interfaces Using business transaction events Differences between business transaction events and customer exits

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

6-1

Business Transaction Events

Objectives

At the conclusion of this unit, you will be able to: Describe what business transaction events are Implement enhancements using BTE

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

6-2

Business Transaction Events

Business Transaction Events (BTE) Are enhancements that were developed for the Financial Accounting (FI) component of R/3 Have predefined interfaces allowing for customer access Have one of the following types of interfaces: Publish & Subscribe interfaces Process interfaces

R

© SAP AG

Business Transaction Events (BTE) allow you to attach additional components, in the form of a function module, for example, to the R/3 system. Business Transaction Events use one of the following types of interfaces: Publish & Subscribe interfaces These interfaces inform external software that certain events have taken place in an SAP standard application and provide them with the data produced. The external software cannot return any data to the R/3 System. Process interfaces These are used to hand over control of certain business processes to external software. Process interfaces replace standard processes. You can attach various external developments to the R/3 System. You can create additional developments using the ABAP Workbench.

?SAP AG

BC425 Enhancements and Modification

6-3

Business Transaction Events

BTE: Possible Scenarios (1)

SAP transaction Interfaces Data flow

Add on components R

© SAP AG

The example above pertains to Publish & Subscribe interfaces. In this case, data only flows in one direction - from the SAP application to the additional component. SAP application developers make interfaces available to you at certain callup points in a transaction. You can deposit additional logic at these points. In a very basic scenario, SAP partners and customers can use the interfaces themselves. In this case business transaction events function in much the same manner as customer exits (see the unit on "Enhancements using Customer Exits").

?SAP AG

BC425 Enhancements and Modification

6-4

Business Transaction Events

BTE: Possible Scenarios (2)

SAP transaction Interfaces Data flow

Add on component from partner A Add on component from partner B

Both additional products exist side by side without impeding each other. R

© SAP AG

The above scenario also pertains solely to Publish & Subscribe interfaces. In contrast to customer exits, business transaction events allow you to use an interface for multiple types of additional logic. If this is the case, you must decide which bit of logic you want to execute at what time. Both of your enhancements exist side by side with out impeding each other; however, at runtime only one of the enhancements can be processed.

?SAP AG

BC425 Enhancements and Modification

6-5

Business Transaction Events

Publish & Subscribe vs. Process Interfaces Publish & Subscribe interfaces

Process interfaces

SAP Transaction

Customer

Customer

Partner B

Partner

Partner A

SAP IBU

SAP IBU

Process interfaces replace standard procedures one and only one add-on component => priorities!

Publish & Subscribe interfaces trigger one or more additional operations

R

© SAP AG

Publish & Subscribe interfaces: Allow you to start one or more (multiple) additional operations when a particular event is triggered. They do not influence the standard program in any way. Multiple operations do not interfere with each other. Add on components only import data. Example: Additional checks (authorizations, existing duplicates, and so forth) Process interfaces: In contrast to Publish & Subscribe interfaces, data exchange takes place in both directions with process interfaces. This influences the number of additions that can be attached to the interface. When an event is triggered, a process in the standard program can only be replaced by a single external process using the process interface. If you are using an add on from an SAP partner that uses a process interface, this enhancement is processed at runtime. If you choose to use this same process interface for one of your own developments, the partner enhancement is dismissed and your own enhancement is processed at runtime instead.

?SAP AG

BC425 Enhancements and Modification

6-6

Business Transaction Events

Business Transaction Events: SAP and the Customer

SAP

Customer

Assigns a number

Enters product in TBE24

Event

Assigns a function module

Enters it in TBE01 Creates a SAMPLE_INTERFACE_

Function module

Copies it into customer namespace; Writes source code; Activates it

R

© SAP AG

Business transaction events allow you to implement additional logic in a task function, similar to function module exits. SAP application programmers determine where to place business transaction events in a task function and what data should be transferred at each point. They also create sample function modules complete with short texts, an interface, and documentation, and describe the functions possible with the enhancement in the accompanying SAP documentation. First, SAP application programmers assign a business transaction event an eight digit number by which it can be identified. These numbers should adhere to a predefined naming convention, for example, the fifth and sixth digits of the number should be identical to specific callup points in your program. SAP developers then enter the BTE in table TBE01 using expanded table maintenance. They include a sample function module sample_interface_ that defines an interface for the customer and must be created later. Business transaction events must be assigned to an application component in table TBE02. You can assign a single callup point to multiple components. Assigning your event to FI means, for example, that the interface is assigned to all dependent nodes found under FI in the hierarchy (FI-*).

?SAP AG

BC425 Enhancements and Modification

6-7

Business Transaction Events

Finding Business Transaction Events Executable function

Implementation Guide for R/3 Customizing

0

4

...

5

Financial Accounting 5

Entry Already edited Documentation

Financial Accounting Global Settings 4 0

... Use business transaction events

R

© SAP AG

In the SAP Customizing Implementation Guide (IMG), you will find the entry "Use business transaction events " under the "Financial Accounting Global Settings" node of the Financial Accounting area. Choosing this entry calls a transaction (FIBF) where you can execute all of the actions necessary for using Business Transaction Events.

?SAP AG

BC425 Enhancements and Modification

6-8

Business Transaction Events

Creating a Publish & Subscribe Interface Customer Enters product in TBE24 Assigns a function module

Copies it into customer namespace; W rites source code; Activates it

R

© SAP AG

You can use the transaction FIBF (called when you selected "Use business transaction events" from the financial accounting hierarchy) to carry out all necessary activities prior to using a business transaction event. First, you must choose an interface to attach your function module to. The "Interface" pushbutton displays the parameter structure for the interface you have selected. You can also use the documentation to determine what functions which interface allows you to perform. Use the ABAP Workbench to copy the sample function module sample_interface_ to the customer namespace (z_*) of a customer function group. You may not alter the interface in any way, but you can fill the function module with any source code you want except for COMMIT WORK statements. Don't forget to activate the function module! Create a product in transaction FIBF. Assign your function module and product a (corresponding) number.

?SAP AG

BC425 Enhancements and Modification

6-9

Business Transaction Events

Differences between Customer Exits and BTEs Customer Exits

Business Transaction Events

cross-client

client-specific

may only be used once

multiple definitions allowed per event; customer events overwrite partner events, partner events overwrite SAP events

R

© SAP AG

In contrast to customer exits, business transaction events are client-specific. This means that the same event can be used in different clients for different purposes. Business transaction events may also be used more than once. With Publish & Subscribe interfaces, you can choose which enhancement you want to use. With process interfaces, the system executes customer components before partner components, and, if neither of these are available, reverts to using the corresponding SAP component.

?SAP AG

BC425 Enhancements and Modification

6-10

Business Transaction Events

Summary Business transaction events were developed for the R/3 Financial Accounting component. They allow you to enhance the SAP standard without having to modify it There are two types of BTE interfaces: Publish & Subscribe and process interfaces These interfaces are predefined and may not be altered Business transaction events - in contrast to customer exits - may be used more than once R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

6-11

Exercises

Exercises Note: There may not be sufficient time to work through all the exercises during the course. The exercises are intended as supplementary examples that can be used, time permitting, during the course. Participants can also use these exercises after the course, to consolidate what they have learned.

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

7-1

Exercises

The following data is used in these exercises: Data

Training System Date

IDES System Data

SFLIGHT

SFLIGHT

SFLIGHT

SFLIGHT01–18

SFLIGHT01–18

SFLIGHT01–18

S_CARRID01-18

S_CARRID01-18

Tables:

Data Elements: S_CARRID01-18 Programs: SAPBC425D_EXIT_## (## = group number) transaction BC425D_EXIT_## (## = group number) Note: Please adhere to all applicable naming conventions! Names of course participants' objects are displayed in COURIER BOLD. The characters '##' denote individual group numbers.

?SAP AG

BC425 Enhancements and Modification

7-2

Exercises

Unit: Modifications Theme: Modifying Repository Objects

• You can modify program BC325X## in the manner described below.

One of the report programs in R/3 is responsible for generating a list of tasks for individual requests. Unfortunately, the report does not work and must be repaired.

3-1

Modifying an SAP program 3-1-1 The following note no. 0815007 (not available in OSS) contains a description of the errors found in the program. Repair the program using the information provided. R/3 Note No. 0815007 Number: Status: Set by:

0815007 Released for external use Marc Thier

Language: Short description:

E BC325X##: Owner not displayed

Person responsible: Application area:

Ulrich Auer BCDS1 ABAP

Long Text Symptom The owner of a request and its corresponding tasks is not being output in the list display of report BC325X##. Cause Field USER is being displayed. The field is empty because the table work area copied to structure OUTLINE using MOVECORRESPONDING. However, the field is called AS4USER in SAP table E070. What to do

?SAP AG

BC425 Enhancements and Modification

7-3

Exercises

Replace field USER with AS4USER in lines 21 and 30. 3-1-2 Change the program so that your list is now sorted according to owner and not according to request number. 3-1-3 Once you start to edit the program, the system will prompt you for a change request number. Create a new change request. 3-1-4 Release both your task and your request. Confirm the repairs. If any unconfirmed repairs are present in the system, the objects affected are locked. If you try to import new versions of such objects during an upgrade, the upgrade will be terminated by the system.

?SAP AG

BC425 Enhancements and Modification

7-4

Exercises

Unit: Modifications Theme: Adjusting Repository Objects after an Upgrade

• This exercise familiarizes you with the program adjustment tool

Your trainer will now import a Hot Package into your system. Adjust your objects accordingly.

3-2

Use transaction SPAU to adjust program BC325X##. 3-2-1 How do you access the transaction used to adjust modified objects? 3-2-2 Use the change request that you created to find the programs you have modified. Double-click on an object to start the version comparison function. Choose the versions you want to compare. 3-2-3 You can transfer your changes to a new version in a new session (open a new R/3 window). 3-2-4 What do you have to do after adjustment is finished?

?SAP AG

BC425 Enhancements and Modification

7-5

Exercises

Unit: Enhancements to Dictionary Elements Theme: Preliminaries

• Creating a development class (Name: ZBC425_##; ## = group number) Before you begin a development project, you must decide whether or not an appropriate development class exists for the project. If not, you must create a new development class for your project's objects.

4-0

Creating a development class 4-0-1 Call up the initial screen of the ABAP Workbench. Start the Repository Browser. Enter ZBC425_## as the name of your development class and choose 'Display'. Enter a short text for the development class and save your changes. Assign the development class to a change request.

?SAP AG

BC425 Enhancements and Modification

7-6

Exercises

Unit: Enhancements to Dictionary Elements Theme: Table Enhancements

• Creating an append structure named ZASFLIGHT## for a specific table (## = group number). You work as a computer specialist for a large travel agency that uses R/3. One of the transactions in your R/3 System has been specially tailored to process air travel data. Your fellow employees use transaction BC425_EXIT_## to display detailed information for specific flights when helping customers. They would like the following additional information to be displayed in this transaction: name of the pilot, main meal times. Your flight data is stored in a table named SFLIGHT##. You need to add two columns to this table without modifying it in order to provide your co-workers with the additional information they desire. 4-1

How can you add these two fields to table SFLIGHT## without modifying it? 4-1-1 Display the structure of table SFLIGHT## in the ABAP Dictionary. What would happen if you were to call up change mode? 4-1-2 Do not call up change mode! How do you create an append structure instead? 4-1-3 Use the default name suggested by the system (ZASFLIGHT##). 4-1-4 Include the following fields in your append structure: Field Name

Data Element

ZZPILOT

S_PILNAME

ZZMEAL

S_MEAL

4-1-5 Do you have to assign a development class to your structure? 4-1-6 What happens when you activate the structure?

?SAP AG

BC425 Enhancements and Modification

7-7

Exercises

Unit: Enhancements to Dictionary Elements Theme: Field Exits

• Creating a field exit for performing additional checks on a screen within a particular transaction The transaction that your co-workers use to display flight information (BC425D_EXIT_##) allows you to access data for all airline carriers. For some unknown reason, you are asked to restrict their access to the data for United Airlines (UA).

4-2

Can you fulfill these requirements using a field exit? If so, proceed. 4-2-1 On which screen of transaction BC425D_EXIT_## do you want to perform the authorization check? Which data element do you want to use? 4-2-2 Where can you create a field exit? 4-2-3 Create a field exit. Enter the name of the data element referred to by the field 'Airline' on the screen you have selected in transaction BC425D_EXIT_##. 4-2-4 The name of the function module that you have to create is already entered on the initial screen of the Function Builder. Do not alter its interface! You must create a function group before you can create your function module! Call your function group ZBC425_##. 4-2-5 Check to see if the user of the transaction has authorization to display information for the airline he or she has selected. Is S_CARRID a suitable authorization object? Display an appropriate error message if the user is not authorized to access this data (message 045 in message class BCTRAIN). 4-2-6 Activate your field exit. 4-2-7 Test your field exit by trying to access data for United Airlines 'UA'.

?SAP AG

BC425 Enhancements and Modification

7-8

Exercises

Unit: Enhancements using Customer Exits Theme: Function Module Exits

• Creating an enhancement project (Name: TG##CUS1) • Using a function module exit in an SAP program (Enhancement name: SBC##E01) Your co-workers have asked you to alter their system so that every time they try to display the details of a flight in the past, a warning message is displayed. Add this new function to the transaction that they use, if possible without modifying the program.

5-1

Does a function module exit already exist that allows you to perform additional checks before flights are displayed? 5-1-1 Find out if the SAP developer responsible for this transaction has already built in customer exits. Pay attention to your group number. 5-1-2 You will find multiple calls for function module exits. What are the names of their corresponding enhancements? Please choose the SAP enhancement most suited to your needs. 5-1-3 Create an enhancement project, include the enhancement in your project, and edit the component. Use messages from message class BCTRAIN. 5-1-4 Activate your project. Has transaction BC425D_EXIT_## been altered in a manner that fulfills your co-workers' wishes?

?SAP AG

BC425 Enhancements and Modification

7-9

Exercises

Unit: Enhancements using Customer Exits Theme: Menu Exits

• Creating an enhancement project (Name: TG##CUS2) • Inserting a menu exit connected to a function module exit in an SAP transaction (Enhancement name: SBC##E02) Your co-workers are thrilled with the new functions that you have built into the system. The new warning messages in transaction BC425D_EXIT_## help them to avoid selecting flights from the past. However, they want more... They want you to allow them to display a list of bookings for their current flight from within the flight display transaction. They already use a program that generates this kind of list, but up until now they have always had to call the program separately. The program in question is SAPBC425D_BOOKING. 5-2

Examine transaction BC425D_EXIT_##. Are there any points in the transaction where you could call another program (or perhaps even a menu option that could allow you to call another program)? 5-2-1 Proceed as in the previous exercise. You should find two additional enhancements. Can either of these be used for your purposes? 5-2-2 Create an enhancement project, include the enhancements you have found in your new project, and edit the components. Which ABAP language element can you use to call a report program? (SUBMIT). 5-2-3 Which addition to SUBMIT can you use to pass values to your report program? Consult the online help if necessary. 5-2-4 How can you make the system return to the calling transaction once your report has been processed? 5-2-5 Does your transaction have the new functions desired?

?SAP AG

BC425 Enhancements and Modification

7-10

Exercises

Unit: Enhancements using Customer Exits Theme: Screen Exits

• Creating an enhancement project (Name: TG##CUS3) • Using a screen exit for an SAP program (Enhancement name: SBC##E03) to transport data from a module pool to an X function group. "It'd really be great if the details lists in the transaction for displaying flights included the pilots name and the main meal times…". You accept this new challenge from your co-workers and try to solve the problem without having to modify the transaction. Specifically, you start looking for a way to add a couple of new fields to the second screen of this transaction (screen number 200). 5-3

What kind of possibilities are there to place additional fields on a screen? Take a closer look at screen 200 in transaction BC425D_EXIT_## and see if any screen exits exist. 5-3-1 Look for the enhancement containing the screen exit. Have you found it? 5-3-2 Create an enhancement project, and include what you consider to be the most suitable enhancement in your project. 5-3-3 Edit the components of the enhancement project. What should you pay attention to when creating a screen? 5-3-4 Transfer data between the flight display transaction and the X function group. Be aware that data is passed between ABAP programs and screens using global fields. 5-3-5 Does the transaction meet your expanded needs?

?SAP AG

BC425 Enhancements and Modification

7-11

Solutions

R

© SAP AG

?SAP AG

BC425 Enhancements and Modification

8-1

Unit: Enhancements to Dictionary Elements Theme: Table Enhancements

4-1

Creating an append structure for table SFLIGHT##. 4-1-1 Make sure that you are not viewing the table structure for the table named above in change mode. Any and all changes to the system made in this mode are regarded as modifications. 4-1-2 Create your append structure using either the menu option Goto → Append structures… or its corresponding pushbutton; accept the name that the system suggests. 4-1-3 Insert the fields listed in the exercise into the append structure. 4-1-4 Save the structure. Assign it to the development class that you created previously (ZBC425_##), and to a change request as well. 4-1-5 Activating the structure adds the designated fields to the table in the database. The database now administers the structure as a table that has been expanded to include two new fields.

?SAP AG

BC425 Enhancements and Modification

8-2

Unit: Enhancements to Dictionary Elements Theme: Field Exits

4-2

Using a field exit. Implement an authorization check on screen 100 of your transaction using a field exit. 4-2-1 Use the menu option System → Status while your transaction is running to determine the name of the data element to which your field exit must refer. 4-2-2 Start the project management transaction in the ABAP Workbench using Utilities → Enhancements → Project management. Choose the menu option Global enhancements → Field exits from the initial screen to maintain field exits. 4-2-3 Create a field exit using Field exit → Create. Enter the name of the data element that the field 'Airline carrier' refers to on screen 0100 of transaction BC425D_EXIT_## (S_CARRID##) 4-2-4 This takes you to the initial screen of the Function Builder. The system suggests the default name EXIT_S_CARRID## for your function module. Accept this name. Do not change the function module's interface! 4-2-5 Create a function group and assign your function module to it. This must be done either before you create your field exit or in another session. (Name: ZBC425_##). 4-2-6 The source code for your function module might look like this: FUNCTION field_exit_s_carr_id. *"--------------------------------------*"*"Local interface: *"

IMPORTING

*"

VALUE(INPUT)

*"

EXPORTING

*"

VALUE(OUTPUT)

*"--------------------------------------AUTHORITY-CHECK OBJECT 'S_CARRID' ID 'CARRID' FIELD input ID 'ACTVT' FIELD '03'. IF sy-subrc NE 0. MESSAGE e045(bctrain) WITH input. ENDIF.

?SAP AG

BC425 Enhancements and Modification

8-3

output = input. ENDFUNCTION.

4-2-7 Activate your field exit.

?SAP AG

BC425 Enhancements and Modification

8-4

Unit: Enhancements using Customer Exits Theme: Function Module Exits

5-1

Creating an enhancement project 5-1-1 Call the project management function in the ABAP Workbench using the menu options Utilities → Enhancements → Project management. 5-1-2 Create a project called TG##CUS1 (## = group number). Save your work and assign the project to your development class and an appropriate change request. 5-1-3 Return to the initial screen of the project management function. Select the sub-object 'SAP enhancements' and choose the 'Change' pushbutton. Include enhancement SBC##E01 in your project and save the entries you have made. 5-1-4 Return to the initial screen of the project management function. Select the sub-object 'Enhancement components' and choose the 'Change' pushbutton. Edit the components. 5-1-5 Create the designated include using forward navigation. 5-1-6 This include should check to see if the flight date entered on the first screen of transaction BC425D_EXIT_## has already passed. If this is the case, a warning message should be displayed. Appropriate messages can be found in message class BCTRAIN, for example no. 35. 5-1-7 Return to the initial screen of the project management function. Activate your project. 5-1-8 Test the transaction. 5-1-9 Example source code: *----------------------------------------------------* *

INCLUDE ZXBC425G00U01

*

*----------------------------------------------------*

IF flight-fldate < sy-datum. MESSAGE w035(bctrain). ENDIF.

?SAP AG

BC425 Enhancements and Modification

8-5

Unit: Enhancements using Customer Exits Theme: Menu Exits

5-2

Creating a menu exit and calling a report program. 5-2-1 Create an enhancement project named TG##CUS2, as described in the previous exercise. 5-2-2 Include SAP enhancement SBC##E02 in your project. 5-2-3 Edit the enhancement's components. Choose a menu exit by double-clicking on it and enter a function text in the appropriate input field in the resulting dialog box. The system disregards any entries made in the other fields in this window. Save your changes. 5-2-4 Use forward navigation to create include zxbc425g10u02 and insert the following source code: *------------------------------------------------* *

INCLUDE ZXBC425G##U02

*

*------------------------------------------------* SUBMIT sapbc405copd_d_booking WITH so_car = flight-carrid WITH so_con = flight-connid WITH so_fld = flight-fldate AND RETURN.

?SAP AG

BC425 Enhancements and Modification

8-6

Unit: Enhancements using Customer Exits Theme: Screen Exits

5-3

Creating a screen exit; Passing data to X function groups and subscreens. 5-3-1 Create an enhancement project named TG##CUS3 as described in the initial exercise for this unit. 5-3-2 Include SAP enhancement SBC##E03 in your project. 5-3-3 Edit the enhancement's components: Create a function module exit just as you learned in the previous unit. Include the following code in the designated include program: MOVE-CORRESPONDING flight TO sflight##. Create a TABLES statement for SFLIGHT## in include ZXBC425G##TOP. 5-3-4 Create a subscreen. Make sure that the screen you create has the type 'subscreen'!

5-3-5 Include fields ZZPILOT and ZZMEAL from table SFLIGHT## on your subscreen. 5-3-6 Activate your project.

?SAP AG

BC425 Enhancements and Modification

8-7

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF