Sunteți pe pagina 1din 53

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. EVBAP = IVBAP.
EVBAP-VKONT = ‘12345’
IF NOT EVBAP IS INTIAL ...
IVBAP = EVBAP.
ENDIF.
Enhancement

SAP standard code


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 YES


standard SAP
code
Supported by YES NO
SAP

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


ΠChoose 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

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
Martin.Ullmann@Ariston-Inc.com
53

S-ar putea să vă placă și