Upload
dinhkien
View
232
Download
3
Embed Size (px)
Citation preview
© 2006 Wellesley Information Services. All rights reserved.© 2006 Wellesley Information Services. All rights reserved.
Beyond the Basics –Explore the Power of User Exits to Enhance Accounts Payable (A/P) FunctionalityMartin UllmannAriston Consulting & Technologies
2
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
3
Introduction
• SAP enhancements are powerful tools, but they are often under-utilized
Reasons are:Different enhancement types are confusingDifficult to find enhancementsNot sure how to implement an enhancement
• Learn the different SAP enhancements• Learn how to implement enhancements• Take home sample codes of various AP enhancements
4
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
5
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 INTIALIVBAP = EVBAP.
ENDIF. …
SAP standard code
…EVBAP = IVBAP.EVBAP-VKONT = ‘12345’...
Enhancement
6
What Are Enhancements? (cont.)
• Benefits of enhancementsEnhancement of standard code without modificationsEnhancements 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
7
SAP Enhancement Type
• SAP delivers three different types of enhancementsUser exits
Oldest type of enhancementsUses function modulesTwo types of user exits:
Validations and substitutions within FI, CO, PS, and AMCustomer enhancements
Business Transactions Events (BTEs)Publish and subscribe interfacesProcess interfaces
Business Add-Ins (BAdIs)Uses classes instead of function modules
8
What Are Enhancements?
• Enhancements are NOT modifications
NOYESSupported by SAP
YESNOChanges in the standard SAP code
ModificationsEnhancements
9
How to Find Available SAP Enhancements
• Enhancements can be found in the IMG
Click on documentation
10
How to Find Available SAP Enhancements (cont.)
• Go to the implementation transactions of the different enhancement types
User exits Transaction CMOD
BTE:Transaction FIBF
BAdIsTransaction SE18
• Online Service Support: OSSSearch for “enhancements” or “user exit” within the respective module
11
User Exits: Transaction CMOD
Step 1: Go to Utilities SAP enhancements
Step 2: Execute Repository Report
12
User Exits: Transaction CMOD (cont.)
• 2051 user exits available: SAP Release 4.70
13
BTEs: Transaction FIBF
Step 1: Go to Environment
Info system
Step 2: Execute Repository Report
14
BTEs: Transaction FIBF (cont.)
• About 500 BTEs available: SAP Release 4.70
15
BAdIs: Transaction SE18
Step 1: Click on “Value List”
Step 2: Click on “SAP Applications”
16
BAdIs: Transaction SE18 (cont.)
• About 2,000 BAdIs available: SAP Release 4.70
17
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
18
Implementation of User Exits
• Use transaction CMOD to create a projectChoose a project name within your naming convention standards
• Assign enhancement to your project• Create the user exits within the function modules
ABAP/4 knowledge necessary The user exit contains custom functionality
• Activate project
19
Implementation of User Exits: Transaction CMOD
Step 1: Create a project Step 2: Assign
enhancement
Step 4: Activate project
Step 3: Create the user exit.
Double-click on enhancement and include
program.
20
Implementation of BTEs
• Find SAP Sample function module• Copy SAP Sample function module and create own
function moduleABAP/4 knowledge necessary Transaction SE37The function module contains custom functionality
• Include new function module in the BTE function module list
21
Implementation of BTEs: Transaction FIBF
Step 1a: Place cursor in the BTE
you want to implement
Step 1b: Click on Sample function
module
Step 2: Copy Sample function
module
22
Implementation of BTEs: Transaction FIBF (cont.)
Step 3a: Go to Settings Process Modules
of an SAP application
Step 3b: Insert your own function module
23
Implementation of BAdIs
• Create new BAdI implementationUse SAP BAdI definitionThe method contains custom functionality
• Activate the implementation
24
Implementation of BAdIs: Transaction SE19
Step 1a: Enter name of new BAdI implementation
Step 1b: Click Create
Step 1c: Enter the name of the SAP BAdI
definition
25
Implementation of BAdIs: Transaction SE19 (cont.)
Step 1d: Double-click on the method to be
implemented
Step 1e: Write your own code
26
Implementation of BAdIs: Transaction SE19 (cont.)
Step 2a: Activate Method
Step 2b: Activate BAdIimplementation
27
Enhancement Dashboard
• Create a Control Dashboard for your enhancementsAdvantages:
Central repository of implemented enhancementsAllows you to centrally switch on/off enhancements Audit trail of activated/deactivated enhancements
• See article:“Create a Control Dashboard to Monitor Your Internal Controls” (FI/CO Volume 4/Issue 6)
28
Enhancement Do’s and Don’ts
• Do’s:Your enhancement needs to be performance efficient
Use “SELECT SINGLE” statements if you need to select values from SAP tables
• Don’ts:Never execute a “COMMIT” statement in an enhancement
Warning
29
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
30
AP Master Data Enhancements
• Validation of vendor master data during data entryEnhancement:
SAPMF02K: User exit vendor master dataIncludes only new vendor master values
BTEs: P&S Interface00001440: Vendor master data: Final checks
Includes old and new vendor master valuesBAdI: VENDOR_ADD_DATA
Method: CHECK_ALL_DATAAllows you to check data in user-defined screens
31
AP Master Data Enhancements (cont.)
• Substitution of vendor master data fieldsBAdI: VENDOR_ADD_DATA
Method: PRESET_VALUES_CCODE (company code fields)Method: PRESET_VALUES_PORG (purchasing fields)
32
AP Master Data Enhancements (cont.)
• User-defined fields and screenBAdI: VENDOR_ADD_DATA_CS – additional data for vendors
Allows you to create user-defined screens for vendor master data
BAdI: VENDOR_ADD_DATAMethod: SAVE_DATA – saves user-defined fieldsMethod: INITIALIZE_ADD_ON_DATAMethod: READ_ADD_ON_DATA
33
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
34
Enhancements During Manual Invoice Creation (FB60)
• FI-Validation: Transaction OB28Callup Point 1: Document HeaderCallup 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”
35
Enhancements During Manual Invoice Creation (FB60) (cont.)
• Example: Invoice Date must be before Posting Date
36
• Example: Invoice Date must be before Posting Date (cont.)
Enhancements During Manual Invoice Creation (FB60) (cont.)
37
Enhancements During Manual Invoice Creation (FB60) (cont.)
• FI-Substitutions: Transaction OBBHCallup Point 1: Document HeaderCallup Point 2: Document Line item
• Not all fields are released for substitutions from SAPHeader: 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)
OSS Note: 42615 Substitution in FI
38
Enhancements During Manual Invoice Creation (MIRO)
• Validations within Logistic Invoice Verification: Document Header Validation
BAdI: MRM_HEADER_CHECKMethod: HEADERDATA_CHECK
BAdI is executed at the document header level Complete Invoice Validation
BAdI: INVOICE_UPDATEMethod: CHANGE_AT_SAVE
BAdI is executed when you “post” the document
39
Enhancements During Manual Invoice Creation (MIRO) (cont.)
• Example: Display a “warning” message, if you enter a credit memo
40
Enhancements During Manual Invoice Creation (MIRO) (cont.)
41
Enhancements During Manual Invoice Creation (MIRO) (cont.)
• Substitution with Logistic Invoice VerificationBAdI: MRM_HEADER_DEFAULT
Method: HEADER_DEFAULT_SETBAdI allows you to default certain invoice fields, like document type, invoice date, or date of invoice receipt
BTE: Substitution of complete FI documentProcess Interface: 00001120 BTE is executed at the time you post an FI document
The complete FI document (header and line item) is availableHeader Reference or Assignment field values can be changed
42
Enhancements During Manual Invoice Creation (MIRO) (cont.)
Example: Move the Purchase Order number to the assignment field of the vendor line
43
Enhancements During Manual Invoice Creation (MIRO) (cont.)
Invoice is entered against Purchase Order 4500000106
44
Enhancements During Manual Invoice Creation (MIRO) (cont.)
Purchase order number is transferred to the
Assignment field
45
Enhancements During Automatic Invoice Creation
• Evaluated Receipt SettlementEnhancement MRMH0001 consists of two function modules, which allows the change of different fields
EXIT_SAPLMRH_001Invoice data, like document date, posting date, reference number, payment term, can be changed
EXIT_SAPLMRH_002Tax information like tax code and jurisdiction code can be changed
46
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'.
47
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
48
Enhancements During the Payment Proposal
• SAP delivers several BTEs for the AP payment program, transaction F110
BTE 00001820: Item SelectionAllows changing the payment method (ZLSCH) of invoicesAllows blocking invoices for paymentAllows exclusion of invoices in the proposal
BTE 00001810: Bank SelectionAllows determination of the house bank to be paid based on user-defined criteria
49
Enhancements During the Payment Proposal (cont.)
• BTE 00001820: Item SelectionExample: Block all invoices over $1,000,000.00
50
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
51
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)
52
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