Table of Contents

Open all
Close all
Preface
13
1 Introduction to Enhancements in Sales and Distribution
19
1.1 Enhancing Standard SD Functionality
20
1.1.1 Exits
21
1.1.2 Projects
31
1.2 Customer Routines
32
1.3 The Enhancement and Switch Framework
34
1.3.1 Explicit Enhancements
35
1.3.2 Implicit Enhancements
38
1.3.3 The Switch Framework
40
1.4 Comparison of Enhancement Methods
41
1.5 Summary
43
PART I Enhancements in Sales Order Processing
45
2 Validating Sales Order Data
47
2.1 Business Scenario
47
2.2 Finding the Right Enhancement
48
2.3 Implementing the Solution
51
2.3.1 Create a New Database Z Table
52
2.3.2 Generate Table Maintenance
52
2.3.3 Create Parameter Transaction
52
2.3.4 Creating an Enhancement Point Implementation
54
2.3.5 Implementing an Implicit Enhancement
56
2.3.6 Coding the User Exit
57
2.4 Summary
59
3 Capturing and Saving Additional Data Fields in Sales Order Processing
61
3.1 Business Scenario
61
3.2 Finding the Right Enhancement
62
3.2.1 Using the Additional Data B Tab
63
3.2.2 Using Implicit Enhancements
63
3.2.3 Using Persistent Objects
65
3.2.4 USEREXIT_SAVE_DOCUMENT
65
3.3 Implementing the Solution
66
3.3.1 Declarations of Data Elements, Database Tables, and Table Types
66
3.3.2 Create Persistency Classes for Survey Data
68
3.3.3 Create Database Table Lock Entries
71
3.3.4 Creating Modification and Implicit Enhancements for a Custom Screen
71
3.3.5 Create the Implicit Enhancement for PBO Modules
73
3.3.6 Create the Implicit Enhancement for Module PAI
76
3.3.7 Adding Layout Changes to Screen 8309 of SAPMV45A
81
3.4 Summary
82
4 Creating an SAP CRM Activity after SD Order Billing
83
4.1 Business Scenario
83
4.2 Finding the Right Enhancement
84
4.3 Communication between SAP Systems via RFC
90
4.3.1 ABAP-to-ABAP Communications
90
4.3.2 Setting Up RFC Connections
91
4.4 Implementing the Solution
93
4.4.1 Creating a New Function Group in the SAP CRM System
94
4.4.2 Creating an RFC Function Module in the SAP CRM System
94
4.4.3 Specify Function Module Parameters
95
4.4.4 Implement ABAP Logic to Create an Activity in SAP CRM
95
4.4.5 Create the Enhancement Point Implementation in Function Module RV_INVOICE_REFRESH
97
4.5 Summary
99
5 Filtering Pricing Data within a Web Service
101
5.1 Background on SOA and Enterprise Services
102
5.1.1 Service-Oriented Architectures
102
5.1.2 Characteristics and Goals of SOA
102
5.1.3 Enterprise Services and Web Services
104
5.1.4 Finding Enterprise Services
105
5.2 Business Scenario
109
5.3 Finding the Right Enhancement
111
5.4 Implementing the Solution
111
5.4.1 Locate the Web Service using Transaction SE80
112
5.4.2 Locate a Provider Class for the Web Service
112
5.4.3 Locate and Implement the Outbound BAdI
114
5.4.4 Find the Correct Outbound Parameter in the BAdI Signature
116
5.4.5 Implement ABAP Coding
118
5.4.6 Testing the Enhanced Service
119
5.5 Summary
120
6 Using a Custom Field in SD Pricing
121
6.1 Business Scenario
121
6.2 Finding the Right Enhancement
122
6.3 Implementing the Solution
123
6.3.1 Creating a New Customer Field for Table VBAK
123
6.3.2 Adding a New Field to Pricing Communication Structure KOMK
125
6.3.3 Creating a New Condition Table
126
6.3.4 Maintaining USEREXIT_PRICING_PREPARE_TKOMK
126
6.3.5 Maintaining the Access Sequence
128
6.3.6 Defining a New Condition Type
129
6.3.7 Maintaining Condition Rates in Transaction VK11
129
6.4 Summary
130
PART II Enhancements in Delivery Processing
133
7 Setting a Delivery Block on the Header Level
135
7.1 Business Scenario
135
7.2 Finding the Right Enhancement
136
7.3 Implementing the Solution
137
7.3.1 Locating the BAdI
137
7.3.2 Creating a BAdI Implementation
140
7.3.3 Adding Code to the Implementation
143
7.4 Summary
144
8 Using a BAdI to Keep Track of Delivery KPIs
145
8.1 Business Scenario
145
8.1.1 Current KPI Solution
145
8.1.2 To-Be Process for KPI Reporting
146
8.2 Finding the Right Enhancement
148
8.3 Implementing the Solution
150
8.3.1 Custom KPI Field Table Layouts
150
8.3.2 Define Custom Table ZKPI_FIELDS
151
8.3.3 Generating a Table Maintenance for ZKPI_FIELDS
154
8.3.4 Define Custom Table ZKPI_DATA
155
8.3.5 Implement ABAP Coding in Method SAVE_AND_PUBLISH_DOCUMENT
156
8.4 Summary
161
9 Using a Customer Exit to Enhance the Outbound Delivery Monitor
163
9.1 Business Scenario
163
9.2 Finding the Right Enhancement
165
9.3 Implementing the Solution
166
9.3.1 Implement the Customer Exit Routine
166
9.3.2 Add New Field Entries to Append Structure LIPOVZ
168
9.3.3 Add Coding to Derive KPI Data and Calculate Delivery Age
172
9.3.4 Testing the Enhanced Delivery Monitor
175
9.4 Summary
175
PART III Enhancements in Billing
177
10 Invoice Splitting Using a VOFM Routine
179
10.1 Business Scenario
179
10.2 Finding the Right Enhancement
180
10.2.1 Understanding the Invoice Split
180
10.2.2 Finding Exits or Enhancements
181
10.2.3 Transfer Routines
182
10.3 Implementing the Solution
184
10.3.1 Copy the Existing VOFM Routine
184
10.3.2 Create an Implicit Enhancement within the Data Transfer Routine
186
10.3.3 Add Custom ABAP Coding
190
10.3.4 Apply Routine to Copy Control
191
10.4 Summary
192
11 Changing Invoice Reference and Numbering Range during Document Creation
195
11.1 Business Scenario
195
11.2 Finding the Right Enhancement
198
11.3 Implementing the Solution
201
11.3.1 Define New Numbering Ranges
201
11.3.2 Define the Cross-Reference Table
202
11.3.3 Implement Implicit Enhancements in RV60AFZC
204
11.3.4 Add Coding to Establish Delivery Type
206
11.3.5 Implement an Implicit Enhancement in RV60AFZZ
207
11.3.6 Add Coding to Amend the Numbering Range
207
11.4 Summary
208
PART IV Conclusion
209
12 Finding the Right Enhancement Technique
211
12.1 Techniques Used and How the Solution Was Found
211
12.2 Solution Search Categories
213
12.3 Key Aspects When Implementing Enhancements
214
12.4 There is No “Silver Bullet”
216
13 Future Outlook
217
Appendices
221
A Exits and BAdIs in Sales and Distribution
223
A.1 Sales Orders
223
A.2 Deliveries
232
A.3 Invoicing
238
A.4 Transport Documents
242
A.5 Shipment Costs
246
B Code Listing for Class ZCL_SURVEY
249
C The Author
253
Index
255