53
© 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) Functionality Martin Ullmann Ariston Consulting & Technologies

Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

Embed Size (px)

Citation preview

Page 1: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

© 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

Page 2: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 3: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 4: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 5: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 6: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 7: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 8: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

8

What Are Enhancements?

• Enhancements are NOT modifications

NOYESSupported by SAP

YESNOChanges in the standard SAP code

ModificationsEnhancements

Page 9: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

9

How to Find Available SAP Enhancements

• Enhancements can be found in the IMG

Click on documentation

Page 10: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 11: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

11

User Exits: Transaction CMOD

Step 1: Go to Utilities SAP enhancements

Step 2: Execute Repository Report

Page 12: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

12

User Exits: Transaction CMOD (cont.)

• 2051 user exits available: SAP Release 4.70

Page 13: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

13

BTEs: Transaction FIBF

Step 1: Go to Environment

Info system

Step 2: Execute Repository Report

Page 14: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

14

BTEs: Transaction FIBF (cont.)

• About 500 BTEs available: SAP Release 4.70

Page 15: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

15

BAdIs: Transaction SE18

Step 1: Click on “Value List”

Step 2: Click on “SAP Applications”

Page 16: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

16

BAdIs: Transaction SE18 (cont.)

• About 2,000 BAdIs available: SAP Release 4.70

Page 17: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 18: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 19: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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.

Page 20: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 21: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 22: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 23: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

23

Implementation of BAdIs

• Create new BAdI implementationUse SAP BAdI definitionThe method contains custom functionality

• Activate the implementation

Page 24: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 25: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

25

Implementation of BAdIs: Transaction SE19 (cont.)

Step 1d: Double-click on the method to be

implemented

Step 1e: Write your own code

Page 26: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

26

Implementation of BAdIs: Transaction SE19 (cont.)

Step 2a: Activate Method

Step 2b: Activate BAdIimplementation

Page 27: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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)

Page 28: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 29: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 30: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 31: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows 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)

Page 32: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 33: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 34: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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”

Page 35: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

35

Enhancements During Manual Invoice Creation (FB60) (cont.)

• Example: Invoice Date must be before Posting Date

Page 36: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

36

• Example: Invoice Date must be before Posting Date (cont.)

Enhancements During Manual Invoice Creation (FB60) (cont.)

Page 37: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 38: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 39: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

39

Enhancements During Manual Invoice Creation (MIRO) (cont.)

• Example: Display a “warning” message, if you enter a credit memo

Page 40: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

40

Enhancements During Manual Invoice Creation (MIRO) (cont.)

Page 41: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 42: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

42

Enhancements During Manual Invoice Creation (MIRO) (cont.)

Example: Move the Purchase Order number to the assignment field of the vendor line

Page 43: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

43

Enhancements During Manual Invoice Creation (MIRO) (cont.)

Invoice is entered against Purchase Order 4500000106

Page 44: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

44

Enhancements During Manual Invoice Creation (MIRO) (cont.)

Purchase order number is transferred to the

Assignment field

Page 45: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 46: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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'.

Page 47: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 48: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 49: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

49

Enhancements During the Payment Proposal (cont.)

• BTE 00001820: Item SelectionExample: Block all invoices over $1,000,000.00

Page 50: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 51: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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)

Page 52: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

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

Page 53: Beyond the Basics – Explore the Power of User Exits to …docshare03.docshare.tips/files/21424/214249478.pdf ·  · 2017-02-28Allows you to check data in user-defined screens

53

Your Turn!

How to contact me:Martin Ullmann

[email protected]