Beyond the Basics – Explore the Power of User Exits to Enhance Accounts Payable (A/P) Functionality Martin Ullmann Ariston Consulting & Technologies © 2006 Wellesley Information Services. All rights reserved.
What We’ll Cover … • • • • • •
Understanding enhancements Implementing user exits, BTEs, and BAdIs Applying AP master data enhancements Understanding AP invoice entry enhancements Looking at AP payment program enhancements Wrap-up
2
Introduction •
SAP enhancements are powerful tools, but they are often under-utilized
• • •
Reasons are: f Different enhancement types are confusing f Difficult to find enhancements f Not sure how to implement an enhancement
Learn the different SAP enhancements Learn how to implement enhancements Take home sample codes of various AP enhancements
3
What We’ll Cover … • • • • • •
Understanding enhancements Implementing user exits, BTEs, and BAdIs Applying AP master data enhancements Understanding AP invoice entry enhancements Looking at AP payment program enhancements Wrap-up
4
What Are Enhancements? •
•
“Enhancements” is a generic term for SAP functionality that allows you to expand the SAP standard functionality Enhancements are called in the SAP standard code and use function modules or classes … MOVE VBAP TO IVBAP. CALL USER-EXIT. IF NOT EVBAP IS INTIAL IVBAP = EVBAP. ENDIF. …
SAP standard code
… EVBAP = IVBAP. EVBAP-VKONT = ‘12345’ ...
Enhancement
5
What Are Enhancements? (cont.) •
Benefits of enhancements
•
•
Enhancement of standard code without modifications Enhancements do not have to be re-implemented during upgrades or support packages
Enhancements have to be re-tested during upgrades or support packages SAP constantly adds new enhancements
6
SAP Enhancement Type •
SAP delivers three different types of enhancements
User exits f Oldest type of enhancements f Uses function modules f Two types of user exits: Validations and substitutions within FI, CO, PS, and AM Customer enhancements Business Transactions Events (BTEs) f Publish and subscribe interfaces f Process interfaces Business Add-Ins (BAdIs) f Uses classes instead of function modules 7
What Are Enhancements? •
Enhancements are NOT modifications Enhancements Modifications Changes in the NO standard SAP code Supported by YES SAP
YES
NO
8
How to Find Available SAP Enhancements •
Enhancements can be found in the IMG
Click on documentation 9
How to Find Available SAP Enhancements (cont.) •
Go to the implementation transactions of the different enhancement types
•
User exits f Transaction CMOD BTE: f Transaction FIBF BAdIs f Transaction SE18
Online Service Support: OSS
Search for “enhancements” or “user exit” within the respective module
10
User Exits: Transaction CMOD Step 1: Go to Utilities SAP enhancements
Step 2: Execute Repository Report
11
User Exits: Transaction CMOD (cont.) •
2051 user exits available: SAP Release 4.70
12
BTEs: Transaction FIBF Step 1: Go to Environment Info system
Step 2: Execute Repository Report
13
BTEs: Transaction FIBF (cont.) •
About 500 BTEs available: SAP Release 4.70
14
BAdIs: Transaction SE18
Step 1: Click on “Value List”
Step 2: Click on “SAP Applications” 15
BAdIs: Transaction SE18 (cont.) •
About 2,000 BAdIs available: SAP Release 4.70
16
What We’ll Cover … • • • • • •
Understanding enhancements Implementing user exits, BTEs, and BAdIs Applying AP master data enhancements Understanding AP invoice entry enhancements Looking at AP payment program enhancements Wrap-up
17
Implementation of User Exits •
Use transaction CMOD to create a project
• •
Assign enhancement to your project Create the user exits within the function modules
•
Choose a project name within your naming convention standards
ABAP/4 knowledge necessary The user exit contains custom functionality
Activate project
18
Implementation of User Exits: Transaction CMOD Step 4: Activate project
Step 1: Create a project
Step 2: Assign enhancement
Step 3: Create the user exit. Double-click on enhancement and include program. 19
Implementation of BTEs • •
Find SAP Sample function module Copy SAP Sample function module and create own function module
•
ABAP/4 knowledge necessary Transaction SE37 The function module contains custom functionality
Include new function module in the BTE function module list
20
Implementation of BTEs: Transaction FIBF
Step 1b: Click on Sample function module
Step 2: Copy Sample function module Step 1a: Place cursor in the BTE you want to implement 21
Implementation of BTEs: Transaction FIBF (cont.) Step 3a: Go to Settings Process Modules of an SAP application
Step 3b: Insert your own function module
22
Implementation of BAdIs •
Create new BAdI implementation
•
Use SAP BAdI definition The method contains custom functionality
Activate the implementation
23
Implementation of BAdIs: Transaction SE19
Step 1b: Click Create
Step 1a: Enter name of new BAdI implementation
Step 1c: Enter the name of the SAP BAdI definition 24
Implementation of BAdIs: Transaction SE19 (cont.)
Step 1e: Write your own code Step 1d: Double-click on the method to be implemented
25
Implementation of BAdIs: Transaction SE19 (cont.) Step 2a: Activate Method
Step 2b: Activate BAdI implementation
26
Enhancement Dashboard •
Create a Control Dashboard for your enhancements
•
Advantages: f Central repository of implemented enhancements f Allows you to centrally switch on/off enhancements f Audit trail of activated/deactivated enhancements
See article:
“Create a Control Dashboard to Monitor Your Internal Controls” (FI/CO Volume 4/Issue 6)
27
Enhancement Do’s and Don’ts •
Do’s:
•
Your enhancement needs to be performance efficient f Use “SELECT SINGLE” statements if you need to select values from SAP tables
Don’ts:
Never execute a “COMMIT” statement in an enhancement
Warning
28
What We’ll Cover … • • • • • •
Understanding enhancements Implementing user exits, BTEs, and BAdIs Applying AP master data enhancements Understanding AP invoice entry enhancements Looking at AP payment program enhancements Wrap-up
29
AP Master Data Enhancements •
Validation of vendor master data during data entry
Enhancement: f SAPMF02K: User exit vendor master data Includes only new vendor master values BTEs: P&S Interface f 00001440: Vendor master data: Final checks Includes old and new vendor master values BAdI: VENDOR_ADD_DATA f Method: CHECK_ALL_DATA Allows you to check data in user-defined screens
30
AP Master Data Enhancements (cont.) •
Substitution of vendor master data fields
BAdI: VENDOR_ADD_DATA f Method: PRESET_VALUES_CCODE (company code fields) f Method: PRESET_VALUES_PORG (purchasing fields)
31
AP Master Data Enhancements (cont.) •
User-defined fields and screen
BAdI: VENDOR_ADD_DATA_CS – additional data for vendors f Allows you to create user-defined screens for vendor master data BAdI: VENDOR_ADD_DATA f Method: SAVE_DATA – saves user-defined fields f Method: INITIALIZE_ADD_ON_DATA f Method: READ_ADD_ON_DATA
32
What We’ll Cover … • • • • • •
Understanding enhancements Implementing user exits, BTEs, and BAdIs Applying AP master data enhancements Understanding AP invoice entry enhancements Looking at AP payment program enhancements Wrap-up
33
Enhancements During Manual Invoice Creation (FB60) •
FI-Validation: Transaction OB28
•
•
Callup Point 1: Document Header Callup Point 2: Document Line item
FI-Validations can be used for all financial documents, including journal entries, AP invoices, AR invoices, or MM documents (goods issues or goods receipts) For parked documents (FV60), the validation is called if an invoice is “Saved as Complete”
34
Enhancements During Manual Invoice Creation (FB60) (cont.) •
Example: Invoice Date must be before Posting Date
35
Enhancements During Manual Invoice Creation (FB60) (cont.) •
Example: Invoice Date must be before Posting Date (cont.)
36
Enhancements During Manual Invoice Creation (FB60) (cont.) •
FI-Substitutions: Transaction OBBH
•
Callup Point 1: Document Header Callup Point 2: Document Line item
Not all fields are released for substitutions from SAP
Header: Reference (XBLNR), Header text (BKTXT) Line item: Assignment (ZUONR), Text (SGTXT) If you want to include additional fields in substitutions, i.e., Payment Block (ZLSPR) f OSS Note: 42615 Substitution in FI
37
Enhancements During Manual Invoice Creation (MIRO) •
Validations within Logistic Invoice Verification:
Document Header Validation f BAdI: MRM_HEADER_CHECK Method: HEADERDATA_CHECK f BAdI is executed at the document header level Complete Invoice Validation f BAdI: INVOICE_UPDATE Method: CHANGE_AT_SAVE f BAdI is executed when you “post” the document
38
Enhancements During Manual Invoice Creation (MIRO) (cont.) •
Example: Display a “warning” message, if you enter a credit memo
39
Enhancements During Manual Invoice Creation (MIRO) (cont.)
40
Enhancements During Manual Invoice Creation (MIRO) (cont.) •
Substitution with Logistic Invoice Verification
BAdI: MRM_HEADER_DEFAULT f Method: HEADER_DEFAULT_SET f BAdI allows you to default certain invoice fields, like document type, invoice date, or date of invoice receipt BTE: Substitution of complete FI document f Process Interface: 00001120 f BTE is executed at the time you post an FI document The complete FI document (header and line item) is available Header Reference or Assignment field values can be changed 41
Enhancements During Manual Invoice Creation (MIRO) (cont.) Example: Move the Purchase Order number to the assignment field of the vendor line
42
Enhancements During Manual Invoice Creation (MIRO) (cont.) Invoice is entered against Purchase Order 4500000106
43
Enhancements During Manual Invoice Creation (MIRO) (cont.)
Purchase order number is transferred to the Assignment field
44
Enhancements During Automatic Invoice Creation •
Evaluated Receipt Settlement
Enhancement MRMH0001 consists of two function modules, which allows the change of different fields f EXIT_SAPLMRH_001 Invoice data, like document date, posting date, reference number, payment term, can be changed f EXIT_SAPLMRH_002 Tax information like tax code and jurisdiction code can be changed
45
Enhancements During Automatic Invoice Creation (cont.) *----------------------------------------------------------------------* * INCLUDE ZXM08U20 * *----------------------------------------------------------------------* DATA: T_ESSR LIKE ESSR, T_MKPF LIKE MKPF. LOOP AT T_SELWENR. MOVE-CORRESPONDING I_RBKPV TO E_RBKPV_ERS_CHANGE. * Requirement 1: Document is the ERS execution date E_RBKPV_ERS_CHANGE-BLDAT = SY-DATUM. * Requirement for Services: * Move the external number to the FI Document Reference number SELECT SINGLE * FROM ESSR INTO T_ESSR WHERE LBLNI = T_SELWENR-LFBNR. IF SY-SUBRC = 0. E_RBKPV_ERS_CHANGE-XBLNR = T_ESSR-LBLNE. ENDIF. * Requirement for Goods Receipts: * Move the Goods-Receipt reference to the FI Document Reference number SELECT SINGLE * FROM MKPF INTO T_MKPF WHERE MBLNR = T_SELWENR-LFBNR AND MJAHR = T_SELWENR-LFGJA. IF SY-SUBRC = 0. E_RBKPV_ERS_CHANGE-XBLNR = T_MKPF-XBLNR. ENDIF. ENDLOOP. E_CHANGE = 'X'.
46
What We’ll Cover … • • • • • •
Understanding enhancements Implementing user exits, BTEs, and BAdIs Applying AP master data enhancements Understanding AP invoice entry enhancements Looking at AP payment program enhancements Wrap-up
47
Enhancements During the Payment Proposal •
SAP delivers several BTEs for the AP payment program, transaction F110
BTE 00001820: Item Selection f Allows changing the payment method (ZLSCH) of invoices f Allows blocking invoices for payment f Allows exclusion of invoices in the proposal BTE 00001810: Bank Selection f Allows determination of the house bank to be paid based on user-defined criteria
48
Enhancements During the Payment Proposal (cont.) •
BTE 00001820: Item Selection
Example: Block all invoices over $1,000,000.00
49
What We’ll Cover … • • • • • •
Understanding enhancements Implementing user exits, BDT, and BAdIs Applying AP master data enhancements Understanding AP invoice entry enhancements Looking at AP payment program enhancements Wrap-up
50
Resources •
FI/CO Expert
“Create a Control Dashboard to Monitor Your Internal Controls,” Taylor Erickson; (FI/CO Volume 4/Issue 6) “User-Exits in FI/CO,” Tami Becker; (FI/CO Volume 1/Issue 6)
51
7 Key Points to Take Home • • • • • • •
Enhancements are NOT modifications Test your enhancements after each support package and upgrade In order to implement SAP enhancements, you need both business and technical knowledge Use an enhancement dashboard to centrally maintain enhancements Use performance-efficient ABAP code Never execute a “COMMIT” statement in an enhancement Search in SAP OSS for sample codes and examples 52
Your Turn!
How to contact me: Martin Ullmann
[email protected] 53