0% found this document useful (0 votes)
11 views48 pages

Badi Enhancement Process

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 48

Enhancement Guide PUBLIC

SAP Process Object Builder


Document Version: 1.0 – 2016-03-23

Enhancement of Process Object Types


For SAP Process Object Builder 1.0 SP5
Typographic Conventions

Type Style Description

Example Words or characters quoted from the screen. These include field names, screen titles,
pushbuttons labels, menu names, menu paths, and menu options.
Textual cross-references to other documents.

EXAMPLE Technical names of system objects. These include report names, program names,
transaction codes, table names, and key concepts of a programming language when they
are surrounded by body text, for example, SELECT and INCLUDE.

Example Output on the screen. This includes file and directory names and their paths, messages,
names of variables and parameters, source text, and names of installation, upgrade and
database tools.

Example Exact user entry. These are words or characters that you enter in the system exactly as
they appear in the documentation.

<Example> Variable user entry. Angle brackets indicate that you replace these words and characters
with appropriate entries to make entries in the system.

Enhancement of Process Object Types PUBLIC


Preface © 2016 SAP SE or an SAP affiliate company. All rights reserved. 2
Document History

Version Date Change

1.0 2016-03-23 First Public Version

Caution
Before you start the implementation, make sure that you have the latest version of this document
relevant for your release. You can always find the latest version on the SAP Help Portal at
http://help.sap.com/pobuilder.

Enhancement of Process Object Types PUBLIC


Preface © 2016 SAP SE or an SAP affiliate company. All rights reserved. 3
Table of Contents

1 Preface ................................................................................................................................ 6

1.1 About this Document ............................................................................................................................... 6

1.2 Target Audience ....................................................................................................................................... 6

1.3 Related Information.................................................................................................................................. 6

1.4 Disclaimer.................................................................................................................................................. 7

2 Introduction ........................................................................................................................ 8

2.1 How to Use this Guide .............................................................................................................................. 8

2.2 Reasons for Enhancing a POT ................................................................................................................. 8

2.3 Sample Business Process ....................................................................................................................... 8

3 Enhancing Enterprise Services ...................................................................................... 10

3.1 Reasons for Enhancing an Enterprise Service .................................................................................... 10

3.2 Standard Procedure ............................................................................................................................... 10

3.3 Sample Service ....................................................................................................................................... 11

4 Building Enhanceable Process Object Types .............................................................. 14

4.1 Overview of Enhancement Spots and BAdIs ....................................................................................... 14


4.1.1 Phase Implementation .................................................................................................................... 14
4.1.2 Archiving ........................................................................................................................................... 14
4.1.3 Editing UI........................................................................................................................................... 15
4.1.4 Others ............................................................................................................................................... 15
4.1.5 Technical Settings for BAdIs .......................................................................................................... 16
4.1.6 Naming Conventions ....................................................................................................................... 16

4.2 How to Make POT Phase Implementations Enhanceable .................................................................. 16


4.2.1 Enhancement Spot and BAdI Definitions ...................................................................................... 16
4.2.2 Call BAdIs in Phase Implementations............................................................................................ 18

4.3 How to Make POT Archiving Enhanceable ........................................................................................... 18


4.3.1 Enhancement Spots ........................................................................................................................ 18
4.3.2 Selection Screen of Archiving Write Program .............................................................................. 19
4.3.3 Additional Fields for Determination of Residence Time .............................................................. 20

Enhancement of Process Object Types PUBLIC


Preface © 2016 SAP SE or an SAP affiliate company. All rights reserved. 4
4.3.4 Archive Search UI ............................................................................................................................ 21

4.4 How to Make the Editing UI Enhanceable ............................................................................................ 22


4.4.1 Adding Fields to Search and Search Result .................................................................................. 23
4.4.2 Adding Fields to List and Form Feeders ........................................................................................ 24
4.4.3 Adding Buttons to Feeders ............................................................................................................. 25
4.4.4 Adding Buttons to the Global Application Toolbar ....................................................................... 28

5 Enhancing Process Object Types .................................................................................. 30

5.1 Enhancement Options ........................................................................................................................... 30


5.1.1 POT Object Model ............................................................................................................................ 30
5.1.2 Custom Checks in Check Phase .................................................................................................... 31
5.1.3 Archiving ........................................................................................................................................... 32
5.1.4 Authorization .................................................................................................................................... 32
5.1.5 Editing UI........................................................................................................................................... 33

5.2 How to Enhance POT Services and Object Model............................................................................... 33


5.2.1 Enhance POT Services in ESR ........................................................................................................ 34
5.2.2 Generate Enhancement Proxy Structure ...................................................................................... 35
5.2.3 Create Append Structure for Internal Types ................................................................................ 36
5.2.4 Implement BAdI(s) .......................................................................................................................... 38

5.3 How to Consume an Enhanced Enterprise Service in a POT ............................................................. 39


5.3.1 Enhance Counterpart Services in ESR .......................................................................................... 39
5.3.2 Generate Enhancement Proxy Structure ...................................................................................... 40
5.3.3 Create Append Structure for Internal Types ................................................................................ 41
5.3.4 Implement BAdI(s) .......................................................................................................................... 43

5.4 Summary ................................................................................................................................................. 43

References ............................................................................................................................. 45

Terms and Abbreviations ..................................................................................................... 46

Enhancement of Process Object Types PUBLIC


Preface © 2016 SAP SE or an SAP affiliate company. All rights reserved. 5
1 Preface

1.1 About this Document

This guide explains how process object types (POTs) built with SAP Process Object Builder (POB) can be
enhanced by customers and partners. It also explains what aspects have to be addressed when developing POTs
that should be enhanceable.

Scope of this Document

The scope of this guide are the following enhancements:


Additional fields in existing Details, Private Details, and Process Control Constraints (PCCs)
Consideration of additional fields in the Editing UI and Archiving UI
Consumption of enhanced back-end services that are already consumed
Implementation of BAdIs for the Check phase

Not in Scope of this Document

This guide does not cover enhancements that require changes to a POT configuration, including:
New Details, Private Details, or Process Control Constraints (PCCs)
Introduction of new node types
Consumption of other back-end services than the already consumed ones

1.2 Target Audience

Customers and partners who want to extend POTs developed by SAP or other partners
Development teams who implement POTs that should allow for later enhancements

1.3 Related Information

All referenced documents are listed in the References section of this guide.

This guide assumes that you have read the following documents:
Product documentation and developer's guide for SAP Process Object Builder
Instructions on how to enhance enterprise services in the Enterprise Services Enhancement Guide

Enhancement of Process Object Types PUBLIC


Preface © 2016 SAP SE or an SAP affiliate company. All rights reserved. 6
1.4 Disclaimer

The processes described in this guide are used as examples and merely serve to illustrate specific aspects of
process object types from a learning perspective. No claims are made as to the business validity of these sample
business processes. SAP assumes no responsibility for errors or omissions in this document.

Enhancement of Process Object Types PUBLIC


Preface © 2016 SAP SE or an SAP affiliate company. All rights reserved. 7
2 Introduction

2.1 How to Use this Guide

If you want to start without further ado, go to


Chapter 4 to build a process object type that is enhanceable
Chapter 5 to enhance an existing process object type

If you think a little background info would do no harm, read


Chapter 2's remaining sections to find reasons for enhancing a POT, and to recapitulate the sample business
process used in this guide
Chapter 3 for a quick introduction to the enhancement of enterprise services, and to the sample service used
in this guide

2.2 Reasons for Enhancing a POT

Customers and partners may want to enhance a process object type for the following reasons:
To implement additional checks in the Check phase via BAdI
To add additional fields to existing Details, Private Details, and Process Control Constraints (PCCs)
To use additional fields of a (possibly enhanced) back-end service that is consumed by the POT
To fill the back-end service requests with different (default) values in the code slots
To display additional fields of the POT in the Editing UI
To use additional fields of the POT in the Archive Search UI

Note
In the context of this guide enhancement of a structure (ESR or DDIC data type) means adding an
additional, optional field at the end of this structure.
For details on the concept of enhancements in the context of enterprise services refer to the Enterprise
Services Enhancement Guide [ES].

2.3 Sample Business Process

The sample business process used in this guide is the same as in the POT Developer's Guide [DEV]. A company
employee needs to go on a business trip. To do so, the employee needs to book a flight ticket and up to two
shuttle transfers, one from his/her home address to the airport of departure, and another one from the airport of
arrival to the destination address.

Enhancement of Process Object Types PUBLIC


Introduction © 2016 SAP SE or an SAP affiliate company. All rights reserved. 8
This simplified business process is shown in Figure 2-1:

Home Destination
Home Destination
Airport Airport
Figure 2-1: Sample Business Process – Travel Booking

In the context of this guide this process is enhanced by the possibility to request a VIP shuttle transfer. In chapter
3 we explain how the shuttle booking service has been extended by an additional field. This service serves as an
example of a standard service that has been enhanced by a customer. Chapter 4 describes what has to be done
by a POT developer to enable later enhancements of a POT. How the sample POT can be enhanced to incorporate
the optional VIP transfer is described in chapter 5.

Enhancement of Process Object Types PUBLIC


Introduction © 2016 SAP SE or an SAP affiliate company. All rights reserved. 9
3 Enhancing Enterprise Services

3.1 Reasons for Enhancing an Enterprise Service

The Enterprise Services Enhancement Guide [ES] lists the following reasons (amongst others) why a customer
may want to enhance an enterprise service:
Customers or partners have enhanced SAP‘s business functionality and want to offer additional elements in
existing services
A standard service does not expose all fields of a business object and additional fields are required in the
service signature

3.2 Standard Procedure

This document only gives a brief summary of the required steps in order to explain the enhancement of POTs later
on. For details on how to enhance enterprise services see the Enterprise Services Enhancement Guide [ES].
Figure 3-1 provides an overview of all steps that are required to enhance an enterprise service:

Enhancement of Process Object Types PUBLIC


Enhancing Enterprise Services © 2016 SAP SE or an SAP affiliate company. All rights reserved. 10
Figure 3-1: Steps for Enhancing an Enterprise Service

3.3 Sample Service

This chapter describes how we enhanced the shuttle booking service in the Enterprise Services Repository (ESR)
in order to motivate the enhancement of the sample POT in chapter 5.
The shuttle booking service is an asynchronous service. The request and the response message types are
displayed below:

Enhancement of Process Object Types PUBLIC


Enhancing Enterprise Services © 2016 SAP SE or an SAP affiliate company. All rights reserved. 11
Figure 3-2: Shuttle Booking – Request Message Type

Figure 3-3: Shuttle Booking – Response Message Type

Exemplarily, we enhanced the service signature with an indicator to request a VIP transfer. The enhanced data
types for the request and for the response are displayed below, with the enhancements being highlighted in
yellow:

Enhancement of Process Object Types PUBLIC


Enhancing Enterprise Services © 2016 SAP SE or an SAP affiliate company. All rights reserved. 12
Figure 3-4: Request Data Type with Enhancement

Figure 3-5: Data Type for Business Object with Enhancement (Response)

Enhancement of Process Object Types PUBLIC


Enhancing Enterprise Services © 2016 SAP SE or an SAP affiliate company. All rights reserved. 13
4 Building Enhanceable Process Object
Types

4.1 Overview of Enhancement Spots and BAdIs

The following tables show which code slots should be considered when making a POT enhanceable and which
enhancement spots and BAdIs should be created for which situation. Details will be described in the following
subchapters. Details about BAdIs that are generated as part of the POT generation can be found in the Application
Help [POB].

4.1.1 Phase Implementation

Code Slot Enhancement Spot BAdIs BAdI is


generated

INIT method of PIMPL Custom Enhancement Spot for INIT method


class BPON Phase Implementations

Create Phase Custom Enhancement Spot for One BAdI per service
BPON Phase Implementations operation and
request/response

Check Phase Generated Enhancement Spot Generated BAdI X (if


<MLB>ENH <MLB>CHK_BADI selected)

Execute Phase Custom Enhancement Spot for One BAdI per service
BPON Phase Implementations operation and
request/response

Post Process Confirmation Custom Enhancement Spot for One BAdI per asynchronous
BPON Phase Implementations inbound service operation

4.1.2 Archiving

Code Slot Enhancement Spot BAdIs BAdI is


generated

Archiving Write Report Custom Enhancement Spot for No BAdI but Enhancement
Archiving Sections

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 14
Code Slot Enhancement Spot BAdIs BAdI is
generated

Archivability Check Generated Enhancement Spot Generated BAdI <MLB>A_CHK X


<MLB>A_ENH

Archiving UI Search Custom Enhancement Spot for BAdI for Archiving UI


Archiving

Archiving UI Search Result Custom Enhancement Spot for BAdI for Archiving UI
Archiving

Archiving Get Field Values Enhancement Spot for Archiving BAdI for additional fields for
residence time determination

Archiving Register Fields Enhancement Spot for Archiving BAdI for additional fields for
residence time determination

4.1.3 Editing UI

Code Slots Enhancement Spot BAdIs BAdI is


generated

Mappings for Search and Search Custom Enhancement Spot BAdI for Editing UI
Result for Editing UI Search

Mappings for List and Form Feeders Custom Enhancement Spot One BAdI per Feeder
for Editing UI Class

Feeder Classes: Custom Enhancement Spot One BAdI per Feeder


GET_DEFINITION for Editing UI Class

GET_DATA
PROCESS_EVENT

Application Controller: Custom Enhancement Spot BAdI for Application


HANDLE_EVENT for Editing UI Controller

SET_BUTTON_PARAMETER

4.1.4 Others

Code Slot Enhancement Spot BAdIs BAdI is


generated

Authorization check Generated Enhancement Spot for BAdI for Custom X


Authorization Checks Authorization Checks
<MLB>ATH_ENH <MLB>ATH_CHK

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 15
4.1.5 Technical Settings for BAdIs

When creating a BAdI there are two important settings that you have to make:
Usability: Select Multiple Use
Instance Creation Mode: Select Newly Creating Instantiation

4.1.6 Naming Conventions

Usually, the guide suggests names for enhancement spots and BAdI definitions that you have to create. You can
choose different names if you like. However, always adhere to the naming conventions for custom artifacts to
make sure that these artifacts are not overwritten by the builder:

Caution
Make sure to comply with the naming convention <MLB>*_C_* for custom artifacts, with _C_ denoting a
custom artifact, when creating enhancement spots, BAdIs, class attributes etc.

For further details refer to the Developer's Guide [DEV], chapter 7.1 Custom Phase Implementation.

4.2 How to Make POT Phase Implementations Enhanceable

4.2.1 Enhancement Spot and BAdI Definitions

The enterprise services provided by a POT can be enhanced in the standard way (see chapter 3). You only have to
take care of the phase implementations of the POT:
1. Create an enhancement spot <MLB>_C_PIMPL_ENH for the phase implementation in the custom package
(<MLB>CUST) of the POT.
2. Create a BAdI definition and a corresponding interface for each node type. The interfaces should contain
methods for all back-end services of a node, one per phase and service call. For synchronous service calls
there should be one method per direction (request and response).
The following are examples for the method signatures of the BAdI methods.
Method signature for the request of a synchronous message:

Method Name <METHOD_NAME>, e.g. <PHASE>_<BO>_<OP>_RQ

Short <Provide a description>


Description

What to do Change the service request, if required

Preconditions None

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 16
Result The service request is filled correctly

Parameter name Parameter Ref. Data Type


Type

I_BPON Importing <MLB>IF_IT_COMP=>


TS_BPON_<BPON>_PUBLIC_COMPLETE

I_PHASE_HELPER Importing <MLB>IF_PHSH

C_REQUEST Changing <SERVICE_REQUEST_TYPE>

Exception X <MLB>CX_IM

Method signature for the response of a synchronous message:

Method Name <METHOD_NAME>, e.g. <PHASE>_<BO>_<OP>_RS

Short <Provide a description>


Description

What to do Change the mapping of the response, if required

Preconditions None

Result The service request is filled correctly

Parameter name Parameter Ref. Data Type


Type

I_RESPONSE Importing <SERVICE_RESPONSE_TYPE>

I_PHASE_HELPER Importing <MLB>IF_PHSH

C_BPON(S) Changing <MLB>IF_N_<BPON>_PIMPL=><TYPE_DEPENDENT_O


N_PHASE> (e.g. TY_REF_TO_CREATE_REQUEST)

Exception X <MLB>CX_IM

Error! Reference source not found. contains naming suggestions for all artifacts concerned in the enhancement of
the phase implementations:

Artifact Suggested Name Example

Enhancement spot <MLB>ES_C_PIMPL /PL9/ES_GXX_FE01_C_PIMPL

BAdI definition <MLB>BD_C_PIMPL_<BPON> /PL9/BD_GXX_FE01_C_PIMPL_SB

BAdI interface <MLB>IF_C_PIMPL_<BPON>_BD /PL9/IF_GXX_FE01_C_PIMPL_SB_BD

BAdI method for <PHASE>_<BO>_<OP>_RQ EXECUTE_SBO_CRT_RQ


synchronous request

BAdI method for <PHASE>_<BO>_<OP>_RS EXECUTE_SBO_CRT_RS


synchronous response

BAdI method for <PHASE>_<BO>_<OP> EXECUTE_SBO_CRT


asynchronous request

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 17
Table 1: Suggested Artifact Names

4.2.2 Call BAdIs in Phase Implementations

Instantiate the BAdIs in the INIT methods of the phase implementation classes (<MLB>CL_N_<NODE>_PIMPL):

Figure 4-1: BAdI Instantiation in INIT

In the code slots of the phase implementation classes insert a call to the corresponding BAdI methods before
(request) and after (response) each back-end service call.
Error! Reference source not found. shows the call of the BAdI method for the shuttle booking service in the code
slot of the Execute phase. As this service is an asynchronous one, the BAdI is only called before the back-end
service.

Figure 4-2: BAdI Call before Back-end Service Call in EXECUTE

4.3 How to Make POT Archiving Enhanceable

4.3.1 Enhancement Spots

The enhancement options for archiving have to be covered by two enhancement spots, because two different
enhancement technologies come into play: ABAP source code enhancements and BAdIs. For details on both
technologies refer to [ENH].

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 18
Create an enhancement spot <MLB>_C_ARCH_ENH for the BAdI technology in the custom package. The other
enhancement spot is created together with the enhancement section in chapter 4.3.2 below.

4.3.2 Selection Screen of Archiving Write Program

The archiving write program can be made enhanceable to enable the possibility to enhance the selection by
provider IDs and / or reference IDs. Details about these possibilities in general can be found in [DEV].
To make the program enhanceable an enhancement spot and two enhancement sections have to be created (one
for each code slot). The enhancement spot can be created together with the first enhancement section.
The following example shows the steps to create an enhancement section for the selection screen of the archiving
write program:
1. Place the cursor inside the code slot and select Edit > Enhancement Operations > Create Option from the
menu.
2. Enter <MLB>_C_A_SELECTION as name for the enhancement section and <MLB>_C_A_ARCH_PROG_ENH as
name for the enhancement spot (it will be created if not yet existing). For Inclusion in Source Code select as
unconditional call.

Figure 4-3: Creation of Enhancement Section

The result looks as follows:

Figure 4-4: Enhancement Section for Selection

Repeat the two steps to create another enhancement section <MLB>_C_A_MAPPING for the mapping code slot.

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 19
4.3.3 Additional Fields for Determination of Residence Time

As described in [DEV] it is possible to define additional fields to determine the residence time based on any value
contained in the POT object model .For that a POT provides the class <MLB>CL_A_FVD_C with the two methods
GET_FIELD_VALUES and REGISTER_FIELDS.
Create a BAdI definition with the name <MLB>_C_A_FLDVAL. The BAdI should contain two methods with the same
name and the same signature as the methods of the mentioned class. In addition, you should add the data helper
(MR_DATA_HELPER of <MLB>CL_A_FVD_C) as importing parameter to the GET_FIELD_VALUES method. The
method should also raise the exception for archiving <MLB>CX_ARC.
The following examples show the BAdI calls in the code slots of the two methods:

Figure 4-5: Code Slot in REGISTER_FIELDS

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 20
Figure 4-6: Code Slot in GET_FIELD_VALUES

The commented code is pre-generated into the code slots. Adapt it according to your requirements and insert the
BAdI calls at the indicated places.
The initialization of the instance variable MR_C_ARCH_FIELDS_BADI should be done in the INIT method of the
class.

4.3.4 Archive Search UI

To allow the enhancement of the archive search UI the code slots in class <MLB>CL_A_SEA_C should contain BAdI
calls that allow to adopt the standard mapping (see [DEV]).
Create a BAdI definition with the name <MLB>C_A_SEARCH. It should contain two methods with the same names
as the methods of the mentioned class:
MAP_SELECTION_TO_SEARCH
MAP_SEARCH_RESULT_TO_FEEDER

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 21
The interfaces of the BAdI methods should be similar to the interfaces of the methods where they are called, with
the difference that instead of the returning parameter R_CUSTOM_SEARCH of method
MAP_SELECTION_TO_SEARCH a changing parameter (C_CUSTOM_SEARCH) should be used.
The following examples show the BAdI calls in the code slots of the two methods:

Figure 4-7: Code Slot in MAP_SELECTION_TO_SEARCH

Figure 4-8: Code Slot in MAP_SEARCH_RESULT_TO_FEEDER

The initialization of the instance variable MR_C_ARCHIVE_SEARCH_BADI should be done in the INIT method of
the class.

4.4 How to Make the Editing UI Enhanceable

The implementation of the Editing UI is described in detail in [DEV]. Based on the most common use cases the
following subchapters describe where enhancement options for the Editing UI should be implemented.
All BAdIs described here can be assigned to a single enhancement spot <MLB>_C_UI_ENH that is to be created in
the custom package (<MLB>CUST).

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 22
4.4.1 Adding Fields to Search and Search Result

The custom feeder class for the search (<MLB>CL_FS_SBA_C) contains two code slot methods to map the feeder
data from the selection screen to the search structure (MAP_SELECTION_TO_SEARCH) and to map the search
result to the result feeder (MAP_SEARCH_RESULT_TO_FEEDER). To allow a customer to map fields in addition to
the fields provided by the standard implementation these two methods should be made enhanceable.
Create a BAdI with the name <MLB>_C_UI_SBA and a corresponding interface <MLB>IF_C_UI_SBA_BD within the
above mentioned enhancement spot. The BAdI should contain two methods that correspond to the methods of
the feeder class:
MAP_SELECTION_TO_SEARCH:
o The signature of the method should look similar to the signature of the method where it is called. A
changing parameter C_CUSTOM_SEARCH should be used instead of the returning parameter
R_CUSTOM_SEARCH.
MAP_SEARCH_RESULT_TO_FEEDER:
o The signature of the method should look like the signature of the method where it is called.
The BAdI methods should be called at the end of the corresponding code slot implementation.

Figure 4-9 and


Figure 4-10 show the calls of the BAdI methods in the code slots of the custom search feeder class:

Figure 4-9: BAdI Call in MAP_SELECTION_TO_SEARCH

Figure 4-10: BAdI Call in MAP_SEARCH_RESULT_TO_FEEDER

The initialization of the instance variable MR_C_SEARCH_BADI should be done in the INIT method of the class:

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 23
Figure 4-11: BAdI Instantiation in INIT

4.4.2 Adding Fields to List and Form Feeders

A customer might want to add additional fields to a list or a form feeder of the Editing UI. Besides enhancing the
FPM UI configuration and the feeder structures he has to enhance the mappings "model to feeder" and "feeder to
model".
Every generated custom feeder class contains corresponding methods for each assignment of the feeder in the
object hierarchy. In each code slot within these methods a BAdI method has to be called.
1. Create a BAdI for each generated class using the following naming convention:
<MLB>_C_UI_<SUFFIX_OF_CORRESPONDING_FEEDER_WITHOUT_C>.
Examples (list feeder of Shuttle Booking node):
o Name of the feeder class: <MLB>CL_FL_SBOKL_C
o Name of the BAdI: <MLB>_C_UI_FL_SBOKL
o Name of the BAdI Interface: <MLB>IF_C_UI_FL_SBOKL_BD
2. In each BAdI interface create the same MAP_MODEL2FEEDER and MAP_FEEDER2MODEL methods as in the
corresponding feeder class. In the MAP_MODEL2FEEDER methods use a changing parameter C_FEEDER_DATA
instead of a returning parameter (R_FEEDER_DATA).
3. Call the BAdI at the end of the corresponding code slot.

The following examples are taken from the custom list feeder class (<MLB>CL_FL_SBOKL_C) of the Shuttle
Booking node:

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 24
Figure 4-12: BAdI Call in MAP_MODEL2FEEDER_XX

Figure 4-13: BAdI Call in MAP_FEEDER2MODEL_XX

The initialization of the instance variable MR_C_FEEDER_BADI should be done in the INITIALIZE method of the
feeder class.

4.4.3 Adding Buttons to Feeders

In order to add new buttons to a UIBB a customer requires the possibility to define and handle new FPM actions.
To define a new action a BAdI method has to be called in method GET_DEFINITION of the feeder class. To change
an action (e.g. to disable it) a BAdI method has to be called in method GET_DATA. Finally, a BAdI method call is
required in method PROCESS_EVENT to handle the event.
Within the BAdIs for the feeder classes (see chapter 4.4.3) create the following methods:
GET_DEFINITION
GET_DATA
PROCESS_EVENT
The signatures of the methods should be exactly the same as for the corresponding methods in the feeder class.
Call the BAdI methods at the end of the corresponding code slot implementation.

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 25
The following examples are taken from the custom list feeder class (<MLB>CL_FL_SBOKL_C) of the Shuttle
Booking node:

Figure 4-14: Code Slot in GET_DEFINITION

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 26
Figure 4-15: Code Slot in GET_DATA

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 27
Figure 4-16: Code Slot in PROCESS_EVENT

The initialization of the instance variable MR_C_FEEDER_BADI should be done in the INITIALIZE method of the
feeder class.

4.4.4 Adding Buttons to the Global Application Toolbar

The generated overview page of the Editing UI provides a standard set of buttons. A customer can add additional
buttons to the UIBB configuration. To implement the event handler for a button and to change its behavior during
runtime the following two methods of the custom application controller class <MLB>CL_FPM_ACC_C require a
BAdI method call. Create a BAdI with name <MLB>_C_UI_ACC and add the following methods to its interface:
HANDLE_EVENT:
The interface of the BAdI method should be similar to the interface of the corresponding application controller
method (including the exception).
SET_BUTTON_PARAMETER:
The interface of the BAdI method should be similar to the interface of the corresponding application controller
method (including the exception). However, use a changing parameter C_BUTTON_PARAMETER instead of the
returning parameter R_BUTTON_PARAMETER.
Call the BAdI methods at the end of the corresponding code slot implementation.

Note
Only actions with the prefixes PL1 (for generation actions) and CPL1 (for custom actions) are forwarded
to the custom application controller. Therefore define and document a naming convention for actions
defined as part of an enhancement. For example, you could use CPL1_Z as prefix for such actions.

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 28
Examples:

Figure 4-17: Code Slot in HANDLE_EVENT

Figure 4-18: Code Slot in SET_BUTTON_PARAMETER

The initialization of the instance variable MR_C_ACC_BADI should be done in the INIT method of the custom
controller class.

Enhancement of Process Object Types PUBLIC


Building Enhanceable Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 29
5 Enhancing Process Object Types

Caution
When you enhanced a POT and want to make changes to these enhancements after you used your POT
productively, keep in mind that the same rules as for changing the structure of a POT apply. In particular it
might not be possible to read old instances anymore.

5.1 Enhancement Options

5.1.1 POT Object Model

When the POT developer has foreseen enhancements to the POT object model, these enhancements concern the
details of the root and child nodes (if details are available), the private details of the child nodes (if private details
are available), as well as the PCC of the root and child nodes (if PCC are available). Figure 5-1 shows the POT
object model template with possible enhancement options highlighted in yellow:

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 30
Figure 5-1: POT Object Model with Enhancement Options

5.1.2 Custom Checks in Check Phase

In step "Define Process Object Nodes" of the POB Modeling Wizard a POT developer can select for which nodes
(including the root node) a BAdI definition should be generated for the Check phase. If this was done for your POT
there will be an enhancement spot and a BAdI in the package <MLB>API for additional custom checks:
Enhancement spot: <MLB>ENH
BAdI definition: <MLB>CHK_BADI
BAdI interface:<MLB>IF_CHK_BADI
The BAdI interface contains one check method for each selected node.

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 31
5.1.3 Archiving

A POT provides a BAdI for custom archivability checks. The enhancement spot and the BAdI can be found in the
API package <MLB>API:
Enhancement spot: <MLB>A_ENH
BAdI definition: <MLB>A_CHK
BAdI Interface: <MLB>IF_A_CHK_BD
The interface provides the method IS_ARCHIVABLE which is called per POT instance during the archiving run.
Within the implementation you can overrule the decision if an instance is archivable. However, you can only set
instances to not archivable which were set to archivable by the standard implementation. The implementation will
not be called for an instance that has been set to not archivable already by the standard implementation.
Apart from that the generated code for the POT archiving integration is not enhanceable. If your specific POT
provides additional BAdIs for enhancing the archiving write report, archiving search UI, or the additional fields for
residence time determination, you can enhance the functionality accordingly. Refer to the documentation of your
POT for further details.

5.1.4 Authorization

In step "Define Authorization Checks" of the POB Specification Wizard a POT developer can select to generate a
BAdI for custom authorization checks. If this was done for your POT you will find the following BAdI in the general
package <MLB>GENRL:
Enhancement spot: <MLB>ATH_ENH
BAdI definition: <MLB>ATH_CHK
BAdI interface: <MLB>IF_ATH_CHK_B
The interface contains the method CHECK_AUTHORIZATION:

Method Name CHECK_AUTHORIZATION

Short Performs authorization check


Description

What to do Execute a custom authorization check according to your requirements

Preconditions None

Result An exception is thrown or not

Parameter name Parameter Ref. Data Type


Type

I_ACTIVITY Importing <MLB>CE_ATH_ACT

I_NODE_TYPE Importing <MLB>CE_NODE_TY_C

I_OPERATION Importing <MLB>CE_OP_PURP

I_REQUEST_DATA Importing DATA

I_BPO_TOTAL Importing <MLB>IF_IT_COMP=>TS_BPO_PUBLIC_TOTAL

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 32
Exception X <MLB>CX_ATH

This method is called for every service call. If a user has no authorization an exception has to be thrown. With this
method the authorization checks of the standard can only be restricted further. So if the standard authorization
check fails the method will not be called.

5.1.5 Editing UI

The generated DDIC structures for the feeder classes are enhanceable. Apart from that, the generated code of the
Editing UI is not enhanceable as no BAdIs are generated to adopt the mapping between the UI model and the
feeder classes, to add new buttons to feeders or the overview page, or any other change of the UI behavior.
If your specific POT provides BAdIs for enhancing the Editing UI, you can enhance it accordingly. Refer to the
documentation of your POT for further details. For details on enhancing FPM configuration using the Application
Enhancement Tool (AET), please refer to [AET].

Caution
If you have the option to enhance the Editing UI of your specific POT and define actions for additional
buttons, make sure to adhere to the naming convention for additional actions described in the
documentation of your POT. Do not use the prefix PL1 as this prefix is reserved for the generated actions.

5.2 How to Enhance POT Services and Object Model

Enhancing a POT comprises similar steps as enhancing an enterprise service, because enhancing a POT first of all
means enhancing its services. Figure 5-2 depicts all steps that are required to enhance a POT. You might notice
that the diagram is very similar to the one showing the standard enhancement procedure for enterprise services
in chapter 3.2.

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 33
Figure 5-2: Steps for Enhancing a POT

The steps highlighted in gray are considered a prerequisite and only the steps depicted in yellow will be described
in the following subsections.

5.2.1 Enhance POT Services in ESR

The enhancement of a POT starts in the ESR. When you want to enhance the details of the process object itself,
you have to create an enhancement for the Details data type. When you want to enhance the details of a node, you
have to create an enhancement for the <Node>Details data type. Accordingly, when you want to enhance the
(<Node>)Process Control Constraints or <Node>PrivateDetails, you have to enhance the (<Node>)PCC or
<Node>PrivateDetails data type.
Table 2 contains the relationship between enhancements and corresponding data types:

Enhancement of Data Type to Enhance

Details <BPO><Version><Application>_BPO_Details

<Node>Details <BPO><Version><Application>_BPON_<Node>_Details

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 34
Enhancement of Data Type to Enhance

<Node>PrivateDetails <BPO><Version><Application>_BPON_<Node>_PrivateDetails

PCC <BPO><Version><Application>_BPO_PCC

<Node>PCC <BPO><Version><Application>_BPON_<Node>_PCC

Table 2: Enhancements and Corresponding Data Types

In our example we enhance the details of the shuttle booking node. Figure 5-3 shows the corresponding data type
enhancement:

Figure 5-3: Enhancement for Details of Shuttle Booking

5.2.2 Generate Enhancement Proxy Structure

As a next step you have to generate the proxy structure for the enhancement using transaction SPROXY. After that
the enhancement is visible as an append structure of the enhanced proxy structure:

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 35
Figure 5-4: Enhanced Proxy Structure with Append Structure

5.2.3 Create Append Structure for Internal Types

Internally, a POT uses so-called internal types instead of the generated proxy data types. Refer to chapter 7.4
Internal Types of the Developer's Guide for more details. Therefore, you also have to enhance the internal
equivalent of the enhanced proxy data type. The internal type is named like the proxy type with the proxy prefix
being replaced by the prefix for common internal types.

Caution
It is important that you give the components of the append structure exactly the same names as the
components of the enhancement proxy structure. Otherwise the mappings in the POT services do not
work.
In the example the name given by SPROXY is /PL9/FEXXVIPTRANSFER_INDICATOR. The same name is
used for the component of the internal type.

Figure 5-5 shows the internal types structure from our example together with its append structure:

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 36
Figure 5-5: Internal Types Structure with Append Structure

How to Find the Corresponding Internal Type for an SPROXY Type

Start transaction SPROXY, look up the enhanced proxy type and note down the proxy prefix (blue box in Figure
5-6):

Figure 5-6: Prefix of Proxy Type in SPROXY

Start transaction SE11, enter the name of the proxy type and replace the prefix with an asterisk (*). Press F4 and
select Search for Structures. You will get a list with two or three types that looks like the following:

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 37
Figure 5-7: Search Result in SE11

In this case the type we are looking for is the first entry, because the second one is our enhancement and the third
one the proxy type we used for searching. In case you get more hits you can restrict the result by specifying a
package after pressing "New selection":

Figure 5-8: Restrict Search by Package

5.2.4 Implement BAdI(s)

So far the additional data from the enhancement arrives in the code slots of the phase implementation classes.
Now you have to implement one or more BAdIs to map this data to the request types of the concerned back-end
services. To do so, create an enhancement implementation, a BAdI implementation and a corresponding BAdI
implementation class. For details on BAdI implementations refer to [BADI]. Then implement the required BAdI
methods and map the additional fields.
Figure 5-9 shows the implementation of the BAdI method for the call of the shuttle booking service in the Execute
phase:

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 38
Figure 5-9: Implemented BAdI Method

In the example the POT was enhanced to make use of a field that had previously been added to the shuttle
booking back-end service by an enhancement itself.

5.3 How to Consume an Enhanced Enterprise Service in a


POT

When you enhanced an enterprise service (see chapter 3 for details) that is consumed by a POT and want to use
these enhancements in the POT, you have to enhance the corresponding counterpart services of the POT. The
procedure is the same as described in the previous chapter. The only difference is that the field name of the POT
enhancement cannot be chosen freely but has to match the field name of the enhancement of the enterprise
service.

5.3.1 Enhance Counterpart Services in ESR

Again, the enhancement starts in the ESR. In our example we want to use the enhancement of the shuttle booking
service from chapter 3.3 in our POT. In order to do this we have to enhance the counterpart services of the shuttle
booking back-end service.
Figure 5-10 shows the data type enhancement for the create request of the shuttle booking service:

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 39
Figure 5-10: Enhancement for Shuttle Booking Create Request

Figure 5-11 shows the enhancement for the business object as contained in the service response:

Figure 5-11: Enhancement for Shuttle Booking

As you can see, the enhancements exactly match the enhancements of the back-end service.

5.3.2 Generate Enhancement Proxy Structure

Next, you have to generate the proxy structures for the enhancements using transaction SPROXY.
After that the enhancements are visible as append structures of the enhanced proxy structures:

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 40
Figure 5-12: Create Request with Append Structure

Figure 5-13: Business Object with Append Structure

5.3.3 Create Append Structure for Internal Types

Next, you have to enhance the internal types that correspond to the enhanced proxy data types. The internal
types are named like the proxy types with the proxy prefix being replaced by the prefix for common internal types
(see chapter 5.2.3. for help on finding the corresponding internal type for a proxy type).

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 41
Caution
It is important that you give the components of the append structures exactly the same names as the
components of the enhancement proxy structures. Otherwise the mappings in the POT services do not
work.
In the example the name given by SPROXY is /PL9/FEXXVIPTRANSFER_INDICATOR. The same name is
used for the component of the internal type.

The following figures show the internal types structures from our example together with their append structures:

Figure 5-14: Internal Representation of Request with Append Structure

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 42
Figure 5-15: Internal Representation of Business Object with Append Structure

5.3.4 Implement BAdI(s)

Finally, you have to fill the additional service fields in the phase implementation by implementing the
corresponding BAdI methods.
In our example we implement the BAdI method for the call of the shuttle booking service in the Execute phase. It is
the same implementation as in chapter 5.2.4:

Figure 5-16: Implemented BAdI Method

5.4 Summary

You can enhance a POT in the following places, if the POT developer has foreseen the corresponding
enhancement points (BAdIs):
Services and object model

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 43
Custom checks in the Check phase
Additional authorization checks
Archiving integration
Editing UI
For concrete information on available enhancement possibilities refer to the documentation of your POT.

Enhancement of Process Object Types PUBLIC


Enhancing Process Object Types © 2016 SAP SE or an SAP affiliate company. All rights reserved. 44
References

Reference Document Type Document

[AET] Application Help Application Enhancement Tool

[BADI] Application Help Enhancement Concept: BAdIs

[DEV] Guide Design & Implementation of Process Object Types

[ENH] Application Help Enhancement Concept

[ES] SCN Enterprise Services Enhancement Guide

[ESR] Application Help SAP NetWeaver Process Integration

[GDT] SCN SAP Global Datatype Catalog

[POB] Product Page SAP Process Object Builder

[SPROXY] Application Help Working with ABAP Proxies

Enhancement of Process Object Types PUBLIC


References © 2016 SAP SE or an SAP affiliate company. All rights reserved. 45
Terms and Abbreviations

Term/Abbreviation Full Name/Definition

PCC Process Control Constraints

ESR Enterprise Services Repository

POB SAP Process Object Builder

POT Process Object Type

Enhancement of Process Object Types PUBLIC


Terms and Abbreviations © 2016 SAP SE or an SAP affiliate company. All rights reserved. 46
www.sap.com/contactsap

© 2016 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any
form or for any purpose without the express permission of SAP SE
or an SAP affiliate company
SAP and other SAP products and services mentioned herein as well
as their respective logos are trademarks or registered trademarks of
SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the
trademarks of their respective companies. Please see
www.sap.com/corporate-en/legal/copyright/index.epx#trademark
for additional trademark information and notices.

You might also like