End of Purpose Check Adaption For Applications Consuming SAP Business Partner in SAP S4HANA
End of Purpose Check Adaption For Applications Consuming SAP Business Partner in SAP S4HANA
End of Purpose Check Adaption For Applications Consuming SAP Business Partner in SAP S4HANA
AND HOW
Document Version
1.0 (July 2016)
Target Group
SAP partners and customer solutions developers in charge of compliance for security requirement SEC-256:
"SAP software shall support deletion of personal data (including personally identifiable information)".
TYPOGRAPHIC CONVENTIONS
Type style / icon Description
Quotation Words or characters quoted from the screen. These include field
names, screen titles, pushbuttons labels, menu names, menu paths,
and menu options. Cross-references to other documentation.
Emphasis Emphasized words or phrases in body text, graphic titles, and table
titles.
All names File and directory names and their paths, messages, names of
variables and parameters, source text, and names of installation,
upgrade and database tools.
User entry User entry texts are words or characters that you enter in the system
exactly as they appear in the documentation.
<Variable user entry> Angle brackets indicate that you replace these words and characters
with appropriate entries to make entries in the system.
KEY Keys on the keyboard, for example, F2 or ENTER.
Note
Caution
Example
Recommendation
DOCUMENT HISTORY
Document version Date Description
1 Introduction ................................................................................................................................. 5
2 Overview of the End of Purpose (Blocking) Process .................................................................. 6
2.1 Key information about available master data blocking functionality................................... 6
2.1.1 Central Business Partner ............................................................................................... 6
2.1.2 Customer and Supplier .................................................................................................. 7
2.2 Handling of blocked master data in dependent applications ................................................ 7
2.2.1 Central Business Partner Data ....................................................................................... 7
2.2.2 Customer/supplier ......................................................................................................... 8
3 How-To COMPLETE an EoP Check Implementation ............................................................... 9
3.1 Maintenance of Application-Specific Residence and Retention Periods overview ............. 9
3.2 Purpose of application names ............................................................................................... 9
3.3 Purpose of application rule variants ................................................................................... 10
3.4 Requirements for the EoP Check Implementation ............................................................. 10
3.5 Step 1 – Collect Condition Field Values ............................................................................ 10
3.6 Step 2 – Map the Condition Field Values to the Application Rule Variants ...................... 11
3.7 Step 3 - Calculate the End of Residence Date .................................................................... 12
3.8 Step 4 - Return new SoRT data .......................................................................................... 12
3.9 Mapping of Condition Fields to Application Rule Variants using ILM Rule Groups ....... 12
3.10 Store SoRT Information before the central EoP check run ............................................ 14
4 EoP Check for Central Business Partner Data .......................................................................... 15
4.1 Registration of Applications ............................................................................................... 15
4.2 The End Of Purpose Check Interface ................................................................................. 15
4.3 The Unblocking Check Interface ........................................................................................ 17
4.4 Enterprise Service Methods ................................................................................................ 18
4.4.1 End of Purpose Check for Central Business Partners ................................................. 19
4.4.2 Block Notification for Central Business Partners ....................................................... 20
4.4.3 Interim Check Results Notification for Central Business Partners ............................. 20
4.4.4 Unblock check for Central Business Partners ............................................................. 20
4.4.5 Unblock notification for Central Business Partners .................................................... 21
4.5 Business Add-Ins (BAdIs) .................................................................................................. 21
4.5.1 Business Partner Key Mapping ................................................................................... 21
4.5.2 Restriction of Business Partner from EoP Check........................................................ 21
4.5.3 Export SoRT Details of Blocked or Unblocked Business Partners ............................ 22
4.6 Adaption by Dependent Applications................................................................................. 23
5 EoP Check for Customers and suppliers ................................................................................... 25
Partner or customer specific applications that consume, respectively reference, business partner master
data, shall adapt to the business partner end of purpose (EoP) check functionality. This includes functionality
to determine per business partner (including linked customer/supplier data) the usage in dependent
applications, to realize blocking after end of purpose in master data including all dependent application data
and to store relevant start of retention information. In a nutshell, the blocking and deletion concept for
business partners provides the following features:
For each business interaction, e.g. order, delivery, and invoice, it is possible to maintain different
residence and retention periods based on country- and customer specific requirements. In case
more than one residence/retention period is valid, the longest is applied.
After expiration of the longest residence period the business partner is blocked.
After expiration of the longest retention period the business partner and all related data is destroyed.
In consequence, the blocking of business partner master data requires the following deliverables by relevant
partner or customer specific applications:
Application objects with a reference to the business partner master data have to provide an end of
purpose (EoP) check to enable blocking and deletion of business partners.
Application objects with a reference to the business partner master data have to consider a blocked
business partner by preventing new business and providing display access only for authorized
users.
This document provides a technical overview of the available business partner master data blocking
functionality and the interfaces to be considered for the creation of an end of purpose check for an
application.
It includes information about the necessary adaptions in the corresponding functionality for handling blocked
business partners.
You can find more information about data protection in the product assistance for SAP S/4HANA 1610:
Product assistance for data protection
Navigation path: http://help.sap.com/s4hana_op1610/ -> Product Assistance -> Cross Components -> Data
Protection
Blocking Indicator Field CVP_XBLCK* in database tables LFA1, LFB1, KNA1, KNB1, KNVV,
KNVK
Unblocking BUPA_REQ_UNBLOCK
Request BUP_REQ_UNBLK
Transaction
One of the central aspects of the blocking concepts of the central business partner (CBP) (the customer and
supplier) is that application-specific retention periods must be maintained twice using transaction IRMPOL for
the ILM object of the application and the assigned master data object.
The same condition fields as in the application are not available for the master data object. Therefore, the
application rule variant concept was introduced to provide a mapping possibility for customers to maintain
the same retention periods in the master data ILM object and the application object.
Residence Residence periods are maintained for the Blocking and maintenance of
Periods master data ILM objects for the following: residence periods for the ILM object
of a dependent application object
Master data itself (for example, if new master are not required.
data without usage should not be blocked too
early)
Each dependent application object maintained
using the application name/application rule
variant concept to consider these periods
according to the master data object ID before
blocking
Retention Retention periods are maintained for the Retention periods are maintained for
Periods following: the ILM object of a dependent
application object to ensure
Master data (for example, if master data without destruction of application data after
usage should not be destroyed too early) the end of the retention period.
Each dependent application object maintained
using the application name/application rule
variant concept to consider the application-
specific retention period before destruction of a
particular master data object ID
For the mapping of dependent applications to the relevant master data object, the application name is
provided, which groups similar application objects. It is important to know which ILM objects of the
application are relevant for which application name to understand for which application names the (double)
maintenance of retention policies and residence policies is necessary.
Application-specific retention policies in the master data ILM objects, which are maintained only for the
application name, allow the definition of only one retention period. However, depending on the scope of the
application name and the related ILM objects, there can be a requirement to define several application
object-specific retention periods. You may also be required to maintain several retention periods for a single
application object, especially if retention periods from several countries must be considered. The application-
specific ILM objects offer several condition fields, which are not all available in the master data ILM objects.
The application rule variant is provided as an additional condition field, which serves as a mapping field to
differentiate several required retention periods of an application name.
A dependent application, which needs to support the EoP check of the CBP or customer or supplier, requires
more information to find the correct values for the SoRT information to be provided to the master data.
The tasks to be fulfilled by the EoP check implementation are the following:
1. Find existing data in your application objects with relation to a given list of master data object IDs
and collect all values of the condition fields for the related application ILM object.
2. Map the condition field values to the application rule variants, which are maintained for your
application name.
3. Call the ILM method to calculate the end of residence date for each combination of application name
and application rule variant.
4. Return new SoRT data for each combination of application name and application rule variant.
The registered EoP check functionality of an application is called for the given application name and a list of
master data object IDs. During the creation of the EoP check, the application objects and related ILM objects
that are in scope for the implementation and the application name must be defined. If relevant the ILM
objects to be considered can be also determined at the beginning of the EoP check using method
CL_LRM_BS_RULE_EXEC=>GET_OBJECT_TYPE_FOR_BOR_OBJ by specifying the name of the business
object repository (BOR).
Existing data for the given master data object IDs must be selected from the corresponding database tables
for these ILM objects. To consider archived application data, see the Store SoRT Information before the
Central EoP Check Run chapter.
The start of retention date as aggregated result (usually the most recent date) of all relevant application-
specific time references has to be determined. The application-specific status checks for end of business
must also be done.
If no business is found for a master data object ID, this information has to be returned for the application
name as described in step 4.
If data with ongoing business is found, it should be checked if the data should be considered in the next
steps. You do not need to check then the end of residence time for data in status End of Business.
Performance is better if only the required data is processed.
The task in this step is to find the application rule variant values of your application name, which are
assigned to the condition fields determined in step 1.
Note:
The simple case is a 1:1 relation between a valid ILM retention rule and existing application data and
application rule variant. In more complex cases there can be several valid application rule variants
depending on the available data and the relevant ILM retention rules. Therefore, the EoP check
implementation must consider if several application rule variants are found that are valid at the same time. If
no application rule variant can be found, the processing has to continue with the application name and an
initial application rule variant value.
A basic method to find the correct application rule variants related to the collected condition field values is to
create an application-specific mapping in Customizing. Customizing should link all possible condition fields
to an application rule variant value. This is application-specific and results in one Customizing per relevant
ILM object.
The ILM rule group concept is also available. This concept uses the valid mapping for the ILM object of an
application in transaction IRMPOL for each required or defined retention rule. These retention rules can be
linked to an ILM rule group value. You can define an ILM rule group in transaction IRM_CUST_CSS. It
stores the time period information, which must be defined for each rule. It can be used to group equal
retention periods per application.
Customizing for application rule variants offers a mapping to an ILM rule group value as a 1: n relation.
Therefore, you can find which application rule variants have to be used for the following steps of the EoP
check implementation based on the assigned ILM rule groups. The following figure shows a Customizing
example for the maintenance of application rule variants for a customer/ supplier and the assignment of ILM
rule groups.
Figure 3-1 Example of Customizing for application rule variants for a customer/ supplier and the
assignment of ILM rule groups
The details for how to implement this step using ILM rule groups is explained in the Mapping of Condition
Fields to Application Rule Variants using ILM Rule Groups chapter.
To find the assigned application rule variants for your application name depends on the master data object:
For the CBP, you can call function module BUPA_BUTEOPARV_GET with import parameters
IV_APPL_NAME (the application name) and IT_APPL_RULE_GROUP (the determined list of ILM rule
groups).
For the customer and/or supplier, you can call method GET_BY_RULE_GROUPS of class
CVP_CL_EOPARV. The import parameters are IV_ID_TYPE (customer, supplier or contact person),
IV_APPL_NAME (the registered application name), and IT_RULE_GROUP (the determined list of ILM
rule groups).
The result of step 2 is a list of application rule variants that are relevant for the master object ID.
It is important to separate the list by the End of Business status. The following calculation for the end of
residence period is not required for ongoing business. The information about ongoing business has to be
returned by application name and application rule variant to the blocking report as described in step 4.
For each combination of application name and application rule variant, the end of residence date has to be
calculated using method GET_RESIDENCE_RULE_F_VALUES of class CL_LRM_BS_RST_RULE_EXEC.
For the ILM objects of the business partner master data objects, you can maintain different residence
periods. The policy type to be used is the audit area name “BUPA_DP”. This is specified in the method call
with the instance origin containing the current system ID and client. You must fill all condition values in the
source fields table. This includes the application name and application rule variant for each entity and
condition fields like the business partner type (CBP: BP_TYPE), the account group (customer/ supplier:
KTOKD), or the company code (customer/ supplier: BUKRS). The technical source field values must be
provided with the corresponding table and field name.
The condition field input values and the determined input value for the time reference parameter
START_RET_DATE (CVP_SORT-ST_RET_DATE or BUTSORT-ST_RET_DATE) must be added.
The date value returned in the variable LV_RES_TIME_END as result of the method call in step 3 holds the
end of residence date. This date should be compared to the current date. If the end of residence date is later
than today’s date, field PURPOSE_COMPLETION_STATUS is set to 2 (Business Ongoing).If the start of
retention date is earlier than today’s date, the purpose completion status field is set to 3 (Business
Completed).
If no data was found in step 1 for a master object ID, the purpose completion status field is set to 1 (no
business with BP). This information is returned for the registered application name.
It is returned in the exporting table for the SoRT data with the master data object ID and the business system
ID for each entity of application name and application rule variant. You should set a next check date (if the
end of residence date is in the future) for ongoing business.
Otherwise, the ST_RET_DATE with the highest start of retention date that was determined in step 1 is
returned.
The ILM framework provides the method GET_VALID_RULES of class CL_LRM_API, which can be used to
find the assigned ILM rule groups according to active retention policies of transaction IRMPOL for given
condition fields as input values. The API has to be called for each application-specific ILM object and for
each set of condition parameters.
One restriction of method GET_VALID_RULES of class CL_LRM_API is that the technical source field values
with the table and field name for method GET_RESIDENCE_RULE_F_VALUES of class
CL_LRM_BS_RST_RULE_EXEC is not used. Instead, the logical field name of the condition field is specified.
The field value must be determined especially if the indirect value determination using method
GET_FIELDVALUES of BAdIs BADI_IRM_OT_FLD or BADI_IRM_OC_SF is used for the standard condition
field.
You can find an example program to call method GET_VALID_RULES of class CL_LRM_API in the following:
REPORT zlrm_api_test_template.
PARAMETERS:
p_oc TYPE lrm_object_category DEFAULT 'OT_FOR_BS',
p_pc TYPE lrm_policy_category DEFAULT 'RTP',
p_ot TYPE lrm_object_type DEFAULT 'FLIGHT_BOOKINGS'.
DATA:
lt_valid_rules TYPE if_lrm_types=>ty_t_rules_with_policy.
DATA:
lt_re_values TYPE if_lrm_re_exec=>ty_t_field_values,
lv_carrid TYPE s_carr_id VALUE 'AA'.
FIELD-SYMBOLS:
<lv_value> TYPE any,
<ls_re_field_value> TYPE if_lrm_re_exec=>ty_s_field_value.
DATA:
lt_conditions TYPE if_lrm_types=>ty_th_field_name_and_value,
ls_condition TYPE if_lrm_types=>ty_s_field_name_and_value.
ls_condition-v_field_name = 'CARRID'.
CREATE DATA ls_condition-r_field_value TYPE s_carr_id.
ASSIGN ls_condition-r_field_value->* TO <lv_value>.
<lv_value> = lv_carrid.
INSERT ls_condition INTO TABLE lt_conditions.
CLEAR ls_condition.
ls_condition-v_field_name = 'CLIENT'.
CREATE DATA ls_condition-r_field_value TYPE sy-mandt.
ASSIGN ls_condition-r_field_value->* TO <lv_value>.
<lv_value> = sy-mandt.
INSERT ls_condition INTO TABLE lt_conditions.
CLEAR ls_condition.
ls_condition-v_field_name = 'SYSTEM_ID'.
CREATE DATA ls_condition-r_field_value TYPE sy-sysid.
ASSIGN ls_condition-r_field_value->* TO <lv_value>.
<lv_value> = sy-sysid .
INSERT ls_condition INTO TABLE lt_conditions.
CLEAR ls_condition.
In step 1 of the EoP check, the existing data for the given master data object IDs is selected from the
corresponding database tables. For performance reasons, a lookup of archived application data should be
avoided, even if they also can contain SoRT information that has to be considered for the destruction of the
master data object. For this reason, we recommend storing SoRT information for relevant application data
before the central EoP check run is executed. You can implement the following options:
Use a shadow database table to store SoRT information for the application objects and consider this
data during the EoP check (in step 1)
Store SoRT information for the related CBP (in database table BUTSORT) or customer or supplier (in
database table CVP_SORT) for the registered application name and the corresponding application
rule variants
Use of the archive information system with the appropriate archive information structure within the
EoP check implementation to select archived data
You can use the first or second option before or during application data archiving when the end of business
for the application data is known. This option provides performance advantages during the EoP check for the
application.
The disadvantage of the first option is that an additional database table has to be used, which aggregates
existing application data and transferred into database tables BUTSORT and CVP_SORT. A separate deletion
concept is required to delete the relevant entries after the archiving of business partner master data.
The second option requires the determination of the application rule variants based on the archived data as
described in step 2 of the EoP check. You can store the SoRT data (with completion status 3 Business
Completed and a given start of retention date) for the CBP by calling function module
BUPA_SORT_CHANGE_DETAIL and for the customer or supplier using the methods of class
CVP_CL_SORT_API. A disadvantage of this approach can be, that based on this data no reference to the
application data is possible, for which the entries have been created.
The third option requires the use of the archive information system (transaction SARI). The relevant archive
information structures must be activated and filled with data before the central EoP check is run. You must
consider the negative effect on performance during the central EoP check run.
Every consuming application of the CBP that wants to enable the CBP deletion process must register its
application name. The blocking process is based on the registered applications.
1. Run transaction SPRO and choose Cross-Application Components > Data Protection > Blocking and
Unblocking of Data > Business Partner.
2. Add the application name to Customizing for Define and Store Application Names for EoP Check:
The next step in the ILM-enablement of business partner depending applications is the creation of the end of
purpose check function module. Every depending CBP application must create end of purpose check
function modules for their respective application.
1. Run transaction SPRO and choose then Cross-Application Components > Data Protection > Blocking
and Unblocking of Data > Business Partner.
2. Add an entry for each function module with its corresponding application name in Customizing
activity Define Application Function Modules Registered for EoP Check:
Figure 4-2 Example of Customizing of registered function modules for the EoP check of the CBP
These function modules calculate the residence period by integrating with ILM. These application-specific
end of purpose check FMs are called by the central blocking report during the blocking process. They return
the SoRT information to the blocking report, which decides whether or not to block. The CBP depending
applications decide if there is a business purpose reason for storing business partner data. If business is
complete from the application perspective, the application returns end-of-business status and the start-of-
retention time date. The following table shows the expected signature of the end of purpose check function
module:
The end of purpose signature has two import parameters: IT_PARTNERS_GUID and IV_APPL. The
blocking report uses the IT_PARTNERS_GUID parameter to pass the list of business partners to be checked
with a partner ID and partner GUID. The applications can use either of these unique identifiers. Using the
IV_APPL parameter, the application name is passed to the end of purpose check module and is used in the
end of purpose check module logic.
The end of purpose signature has one export parameter: ET_PUR_CMPLT_PARTNERS. The blocking report
stores the returned data in central table BUTSORT for each business partner to be checked. The following
fields are included:
BUSINESS_SYSTEM is the system where the end of purpose module has been executed for
residence rule calculation, which is important in the remote run of the blocking report where the
same partner’s end of purpose must be calculated in a distributed environment. The logical name of
the local system is returned, which can be determined as follows:
DATA: l_own_logical_system type logsys,
call function 'OWN_LOGICAL_SYSTEM_GET'
importing
own_logical_system = l_own_logical_system
exceptions
own_logical_system_not_defined = 1
others = 2.
if sy-subrc <> 0.
l_own_logical_system = sy-sysid.
endif.
You can request the unblocking of a central business partner (CBP) with transaction BUP_REQ_UNBLK. If the
unblocking request is approved in transaction BUPA_PRE_EOP, an additional consistency check by
dependent applications is possible. Every consuming application of the CBP can create an unblocking check
function module for their respective application.
1. To register these function modules in Customizing, run transaction SPRO and choose Cross-
Application Components > Data Protection > Blocking and Unblocking of Data > Business Partner.
2. In Customizing activity Define Registered Function Modules for Unblock BP, add an entry for each
function module with its corresponding application name.
Figure 4-3 Example of Customizing of function modules registered for unblocking check of the CBP
The unblocking check signature has two import parameters: IT_PARTNERS_GUID and IV_APPL. The
unblocking report uses the IT_PARTNERS_GUID parameter to pass the list of business partners to be
checked by partner ID and partner GUID. The applications can use either of these unique identifiers. The
IV_APPL parameter passes the application name to the unblocking check module as optional information.
The end of purpose signature has one export parameter: ET_UNBLK_STATUS. For each business partner for
which unblocking is allowed, the unblocking report expects the business partner key information in the
PARTNER field and the value X in the UNBLK_STATUS field to allow unblocking.
To integrate external applications and systems (non-ABAP systems) into the blocking and unblocking
reports, the following Web services are provided:
A service is called in the blocking report during the following:
o During the EoP check to collect EoP results from registered service providers
o After blocking a business partner to notify registered service providers about a successful
blocking
o During the execution of the blocking report in a dependent system with interim mode to
notify a registered service provider (leading system) with the interim EoP check results
A service is called in the unblocking report during the following:
o During the unblocking check to report permission from registered service providers
o After unblocking a business partner to notify registered service providers about a successful
unblock
If the corresponding service configuration is available, all registered service providers are executed in the
receiving systems. The listed service providers can be used in ABAP-based systems (starting with SAP
NetWeaver 7.40) for the integration of the blocking and unblocking functions between business partners
stored in master and dependent systems. Other systems can create service providers in their own
namespace with the same interface as the service consumers. Therefore, you can implement the integration
for the CBP EoP check function with non-ABAP systems. For the integration of external systems, the
following use cases must be supported:
The blocking report was started in the leading system to collect EoP information from dependent
systems and notify after successful blocking
The interim mode of the blocking report that is called in a dependent system to notify the master
system about the recent EoP information
The unblocking report that is used to unblock requested business partners.
The unblocking report can be started in the leading system. During unblocking, a service calls
the connected system to verify if the unblocking is allowed and another service is called after a
successful unblocking in the master system.
The enterprise service for the end of purpose (EoP) check is a synchronous query response service for the
central business partner (CBP).
The query sends the business partner ID and GUID (PARTNER and PARTNER_GUID) in table element
PartnerRemote and the business partner type (PARTNER_TYPE) and mapping information about the
correct business partner ID in a target system as set in a possible implementation of BAdI
BUP_PARTNER_KEYMAP (TARGET_SYSTEM, RECEIVER_PARTNER, RECEIVER_PARTNER_GUID).
The query contains the following elements to determine the processing conditions:
The response expects to receive a set of EoP results for each level of data. The EoP results are returned in
table element BusinessPartnerRemote. The contained elements are the same as the export parameter
ET_PUR_CMPLT_PARTNERS in the end of purpose check interface as previously described.
There is also a log table (BusinessPartnerRemoteMsg) that returns messages.
At the end of the blocking run, a notification is sent out to all registered service providers of blocked data.
The message contains table element Partnercomplete, which contains collected SoRT information for
the new blocked business partners. The contained elements are the similar to the export parameter
ET_PUR_CMPLT_PARTNERS of the end of purpose check interface as previously described.
Each connected (registered) dependent system is allowed to proactively provide SoRT information to the
master system. The interim results must be provided in the same structure as the response of the EoP
check; however, there is no log information. The message contains table element Partnercomplete,
which includes all collected SoRT information. The contained elements are the same as the export
parameter ET_PUR_CMPLT_PARTNERS of the end of purpose check interface as previously described.
The unblocking check service is a query response service. The service is called for the central business
partner (CBP) for dependent systems to confirm that unblocking the business partner is allowed.
The query sends the business partner ID and GUID (PARTNER and PARTNER_GUID), the business partner
type (PARTNER_TYPE), and mapping information about the correct business partner ID from table element
IT_PARTNERS to a target system based on a possible implementation of BAdI BUP_PARTNER_KEYMAP
(TARGET_SYSTEM, RECEIVER_PARTNER, RECEIVER_PARTNER_GUID).
When permission to unblock is granted for each business partner, the response expects to receive the value
X in table element ET_UNBLK_STATUS in element UNBLK_STATUS,.
Log table element ET_MESSAGES records return messages.
At the end of the unblocking run, a notification is sent out to all registered service providers of all unblocked
data. The message includes table element PartnerReset, which contains information for the unblocked
business partners in elements PARTNER and PARTNER_GUID.
The Business Add-In (BAdI) BUP_PARTNER_KEYMAP is used to find out the business partner ID and GUID of
the target system. This BAdI is called before the remote function call (RFC) or Web service call to registered
dependent systems is called for the following:
EoP check before blocking
Check before unblocking
Unblocking notification
When the business partner GUID is not unique for business partners in the same landscape, you can
enhance the changing parameter CT_KEYMAP with an additional entry for each target system. The
information about the business partner ID in the local system is provided in the components PARTNER and
PARTNER_GUID. You can add information about the target system in components RECEIVER_PARTNER
and RECEIVER_PARTNER_GUID with the corresponding name of the target system in component
TARGET_SYSTEM.
The Business Add-In (BAdI) BUP_PARTNER_EXLIST is used to restrict business partners from going
through the EoP check. The restriction is carried out when the blocking report removes the partners from the
list that is included in the check. The BAdI is used as an optimization measure.
Import Variant
IV_FLT_VAL BUS_DA_SELECT_VARIANT BAdI filter for
selection of
data
Import parameters IV_FLT_VAL and IV_DIFFERENTIATION provide filter information from the selection
screen of blocking report BUPA_PREPARE_EOP to implement the BAdI accordingly to these values and to
exclude certain business partners. The changing parameter CT_PARTNER_EXCLIST contains the list of
business partner IDs based on the selection criteria from blocking report BUPA_PREPARE_EOP.
The Business Add-In (BAdI) BUPA_PURPOSE_EXPORT is used to export SoRT details of a blocked or
unblocked business partner to application-specific memory. The BAdI is called when the blocking indicator
(field XPCPT in database table BUT000) is set or reset. The BAdI is not called for a partner when business is
ongoing.
BAdI method BUPA_PURCOMPL_EXPORT is called in the blocking report and the RFC function module
BUPA_PURPOSE_COMPLETE to replicate the unblocking information to registered dependent systems. A
dependent application can use the method to set additional blocking indicators, which should be set in
addition to the blocking indicator of the business partner.
Import parameter IV_TIMESTAMP_BUS is set with the current UTC time stamp. If the external data or
memory handling in Financial Services is active, import parameter IV_CHECKMODE has a value of X.. The
parameter is only relevant for the delivered implementation of this application. Import parameter
IT_BUTSORT contains all SoRT information for business partners for which the blocking indicator is set.
The BAdI method BUPA_PURERESET_EXPORT is called in the unblocking report and the RFC function
module BUPA_PURPOSE_RESET to replicate the unblocking information to registered dependent systems. A
dependent application can use the method to reset additional blocking indicators, which were set in addition
to the blocking indicator of the business partner.
Import parameters IV_TIMESTAMP_BUS and IV_CHECKMODE and changing parameter CT_RETURN have
the same use as in BAdI method BUPA_PURCOMPL_EXPORT. Import parameter IT_PARTNERS contains the
list of partners for which the blocking indicator is reset.
A blocked business partner should not be changed or displayed by an unauthorized user. Authorized users
can display the details of a blocked business partner but should not be able to change the partner details.
Internal change and read function modules of the central business partner, which are consumed by the
dependent applications, are enhanced with the optional import parameter IV_REQ_BLK_MSG. If consuming
applications want to receive an error message or exception during unauthorized access to the blocked
business partner, you must set this parameter value to X while calling the central business partner function
modules. If the parameter is not set and the partner status is blocked, no message and no data are returned.
The central business partner (CBP) function modules (FM) do not return the error message or an exception
blindly due to possible disruptions in the consuming applications flow. The consuming applications are
requested to adapt their calls to the CBP modules so that the necessary calls to the CBP modules are
executed when necessary by setting optional parameter IV_REQ_BLK_MSG to X and handling the error
message or exception.
In difference to this are the changes to function modules, which are used for example within the BAPI
methods of the following business objects:
BUS1006 Business partner
BUS1006001 Business partner employee
BUS1006002 Business partner contact person relationship
BUS1006003 Business partner employee relationship
BUS1006004 Business partner group hierarchy
BUS1006006 Business partner shareholder relationship
These function modules have also been authorization enabled to check for the unauthorized access to a
blocked business partner. But the difference is that there is no new import parameter IV_REQ_BLK_MSG.
Instead for a blocked business partner an error message appears in the Return table, which refers to the
structure BAPIRET2.
Every consuming application of the customer and supplier that wants to enable ILM for the business partner
deletion process must first register its application name. The blocking process is based on the registered
applications.
1. For the registration, run transaction CVP_CUST or SPRO and choose Logistics - General > Business
Partner > Deletion of Customer and Supplier Master Data.
2. In Customizing activity Define and Store Application Names for EoP Check, add the application
name.
Make sure to add an entry for each ID type.
Figure 5-1 Example of Customizing for application names of customers and suppliers
The customer and supplier blocking functionality enables registered applications to execute different actions
during the end of purpose (EoP) check during the unblocking process of customers or supplier s. The
CVP_IF_APPL_EOP_CHECK class interface is delivered for this purpose. Each application must develop a
class to implement this interface and must register the class in Customizing.
1. Run transaction CVP_CUST or SPRO and choose Logistics - General > Business Partner > Deletion
of Customer and Supplier Master Data.
2. In Customizing activity Define Application Classes Registered for EoP Check, add the application
class name.
Make sure you add an entry for the previously defined application name and each ID type. Select the
organizational level (General or Company Code) for which the EoP check can be done in the
application.
INITIALIZE Method
Registered applications may need to be initialized and know the current parameters of the blocking report.
The INITIALIZE method is called after instantiation of the registered application class.
Import Application
IV_APPL CVP_APPL_NAME name
FINALIZE Method
Registered application classes may need to perform some cleanup and dequeue activities. The FINALIZE
method is called before destructing the class instance.
It provides the tables, which are used during the calling of EoP methods CHECK_PARTNERS and
CHECK_CPD_PARTNERS
The system informs applications about the partners to be checked for end of purpose in the entries in the
IT_EOP_CHECK_PARTNERS import parameter. In export parameter ET_SORT_RESULT_PARTNERS,
applications return their check results. Errors and information messages are returned in table
ET_MESSAGES.
Parameter Type Associated Type Description
Import Application
IV_APPL CVP_APPL_NAME name
Import parameter IV_APPL contains the registered application name based on Customizing settings. It is
required for checks and to enable reuse of the implementation for other applications names too.
Import parameter IT_EOP_CHECK_PARTNERS contains a list of customer, supplier, and contact person IDs
for which the EoP check must be executed. The partner entries are differentiated by the value in the
ID_TYPE (1 = customer master data, 2 = supplier master data, 3 = contact person) field. The BUKRS field
contains the company code for which a selected customer or supplier is to be checked for the EoP for
application data related to this company code. The VKORG field is not used and has a value of initial. The
ACCOUNT_GROUP field contains the account group for which the customer or supplier is created and is
required as the input value for the end of residence period calculation during the EoP check.
Entries in the IT_EOP_CHECK_PARTNERS import parameter depend on the execution mode of the
CVP_PREPARE_EOP blocking report. You can run the report for customers or suppliers but not for both at the
same time. The import parameter contains entries for either customers or suppliers and their related contact
persons. Further entries depend on the Data to be processed selection parameter. You can select the data
to be processed based on the following:
Process all data levels
The blocking report selects data for customers or suppliers on the general level (corresponding to
database table KNA1/LFA1 and existing contact persons (KNVK).
Process only company code specific data
The blocking report selects data for customers or suppliers at the company code level (KNB1/LFB1).
Process only contact persons
The blocking report selects data for contact persons of customers or suppliers (KNVK).
Entries in the IT_EOP_CHECK_PARTNERS import parameter depend on the registration of the EoP check
class for the application name in Customizing. It is based on the ID type and organizational levels (general
and company code).
The end of purpose signature has one export parameter: ET_PUR_CMPLT_PARTNERS. The blocking report
stores to the returned data in the CVP_SORT central table for each entry in IT_EOP_CHECK_PARTNERS
import parameter based on the ID, ID_TYPE, and BUKRS key information fields. Other field types are
described as follows:
BUSINESS_SYSTEM is the system where the end of purpose check has been executed for residence
rule calculation. It is used in the remote run of the blocking report where the same partner’s end of
purpose must be calculated in a distributed environment. The logical name of the local system is
returned, which can be determined as follows:
DATA: l_own_logical_system type logsys,
call function 'OWN_LOGICAL_SYSTEM_GET'
importing
own_logical_system = l_own_logical_system
exceptions
own_logical_system_not_defined = 1
others = 2.
if sy-subrc <> 0.
l_own_logical_system = sy-sysid.
endif.
After the EoP check is run, the calling report may block some data. This method provides the list of data that
will be blocked in the IT_EOP_PARTNER_PURCMPL_EXP parameter to the registered applications.
Applications can use this data to set further application-specific blocking indicators. Errors that occur during
updates in the application are returned in table ET_MESSAGES.
The following process flow describes how the blocking report runs and at which time and for which purpose
calls to registered applications are done.
Blocking Report starts
Loop for all registered applications
Method INITIALIZE
Provides info about the parameters of the blocking report. Applications can implement their
own initialization.
Endloop
Loop for all registered applications
Method CHECK_PARTNERS
Application to perform EoP checks for normal customer and suppliers
Method CHECK_CPD_PARTNERS
Application to perform EoP checks for one-time customer and suppliers
Endloop
Loop for all registered applications
Method PARTNERS_PURCMPL_EXPORT
Provides information to application about partners to be blocked
Endloop
Loop for all registered applications
Method FINALIZE
Application to release their own objects (enqueue, memory)
Endloop
Blocking report ends
Customer and supplier blocking also supports the unblocking of partners. Applications may need to run a
consistency check before unblocking is allowed or unblock some of their blocked data with unblocked
partners. Several interface methods in the CVP_IF_APPL_EOP_CHECK interface are available for this
unblocking process:
INITIALIZE_UNBLOCK
Registered applications may need to perform some initialization and need to know what the current
parameters of the unblocking report are. This method will be called after instantiation of the registered
application class.
Import Application
IV_APPL CVP_APPL_NAME name
FINALIZE_UNBLOCK
Registered application classes may need to perform some cleanup and dequeue activities. This method is
called before destructing the class instance.
PARTNERS_PREP_PURCMPL_RESET
This is the preparation method. Applications are informed about the partners that are requested to be
unblocked. Applications may refuse to unblock a partner by adding corresponding entries returned in table
ET_PARTNERS. The reason and explanation are written to the ET_MESSAGES table.
PARTNERS_PURPCMPL_RESET
This method provides information to applications about the partners to be unblocked in table IT_PARTNERS.
Errors that occur during updates in the application are returned in table ET_MESSAGES.
The following process flow describes how the unblocking report runs and how it calls registered applications.
Unblocking report starts
Loop for all registered applications
Method INITIALIZE_UNBLOCKED: Provides info about the parameters of the unblocking
report. Applications can implement their own initialization.
Endloop
Loop for all registered applications
Method PARTNERS_PREP_PURPCMPL_RESET: Application checks if partners can be unblocked.
Endloop
Loop for all registered applications
Method PARTNERS_PURCMPL_RESET: Provides information to application about
partners to be unblocked
Endloop
Loop for all registered applications
Method FINALIZE_UNBLOCK: Application to release objects (enqueue, memory )
Endloop
Unblocking report ends
Some account groups are one-time accounts (CPD functionality). These are accounts that have a business
transaction with you only once or rarely. One-time accounts require no master records because you do not
need this master record after the business transaction. You create collective master records for one-time
customers and one-time suppliers where certain data (such as address and bank details) is not entered in
the master record but in the actual document.
Example
You create a collective master record for a dummy customer that includes data for all customers in a certain
region. This collective master record can include the following fields: master record name, language,
currency, and sales office processing the data.
If a one-time customer from this region orders goods from your company, you use the customer number of
the collective master record when processing the sales order. You enter the address and other data that is
not in the collective master record in the sales order.
Each application object must block its own data at the end of its residence period. Therefore, you cannot
indicate the blocking status with the master data. Instead, each application must introduce its own blocking
indicator, which is set in the central blocking report. You can set this in the application-specific EoP check
(but not in active test mode). A differentiation between overall or interim check modes does not apply since
the data is blocked locally.
This end-of-purpose check method is called for master records that are selected as one-time accounts.
Applications are given the partners for the end-of-purpose check in table IT_EOP_CHECK_PARTNERS_CPD.
Errors and success messages are returned in table ET_MESSAGES.
To integrate external applications and non-ABAP systems into the blocking and unblocking reports, the
following enterprise services are provided:
Services are called in the blocking report during the following:
o During the EoP check to collect EoP results from registered service providers
o After blocking a business partner to notify registered service providers about a successful
blocking
o During the execution of the blocking report in a dependent system with interim mode to
notify a registered service provider (leading system) with the interim EoP check results
o A service is called in the unblocking report during the following:
o During the unblocking check to report permission from registered service providers
o After unblocking a business partner to notify registered service providers about a successful
unblock
The blocking and unblocking functionality of the customer provides the following service methods in the
http://sap.com/xi/APPL/Global2 namespace:
Service Consumer Service Provider Purpose
CustomerERPEndOfPurposeChe CustomerERPEndOfPurposeCh Integration of the EoP check
ckQueryResponse_Out eckQueryResponse_In with dependent systems
CustomerERPEndOfPurposeInt CustomerERPEndOfPurposeIn Notify master system about
erimCheckNotification_Out terimCheckNotification_In local EoP check interim results
from a dependent system
CustomerERPEndOfPurposeBlo CustomerERPEndOfPurposeBl Notify dependent systems
ckNotification_Out ockNotification_In about blocked customers with
corresponding SoRT
information
CustomerERPEndOfPurposeUnb CustomerERPEndOfPurposeUn Integration of the unblocking
lockCheckQueryResponse_Out blockCheckQueryResponse_I check with dependent systems
n
CustomerERPEndOfPurposeUnb CustomerERPEndOfPurposeUn Notify dependent systems
lockNotification_Out blockNotification_In about unblocked customers
The blocking and unblocking functionality of the supplier (vendor) provides the following service methods in
the http://sap.com/xi/APPL/Global2 namespace:
Service Consumer Service Provider Purpose
SupplierERPEndOfPurposeChe SupplierERPEndOfPurposeCh Integration of the EoP check
ckQueryResponse_Out eckQueryResponse_In with dependent systems
SupplierERPEndOfPurposeInt SupplierERPEndOfPurposeIn Notify master system about
erimCheckNotification_Out terimCheckNotification_In local EoP check interim results
from a dependent system
SupplierERPEndOfPurposeBlo SupplierERPEndOfPurposeBl Notify dependent systems
ckNotification_Out ockNotification_In about blocked suppliers with
corresponding SoRT
information
SupplierERPEndOfPurposeUnb SupplierERPEndOfPurposeUn Integration of the unblocking
lockCheckQueryResponse_Out blockCheckQueryResponse_I check with dependent systems
n
SupplierERPEndOfPurposeUnb SupplierERPEndOfPurposeUn Notify dependent systems
lockNotification_Out blockNotification_In about unblocked suppliers
The blocking and unblocking functionality of the customer and supplier uses the listed service consumer
methods. If the corresponding service configuration is available, registered service providers are executed in
the receiving systems. You can use the above service providers in ABAP-based systems (starting with SAP
ERP 6.0 EhP7 SP06) for the integration of the blocking and unblocking functionality between customers and
suppliers stored in master and dependent systems. Systems can create service providers in their own
namespace with the same interface as the service consumers. Therefore, you can also implement the
The enterprise service for the end of purpose (EoP) check is a synchronous query-response service
supporting customer and supplier-integrated into the customer and supplier business object.
The query part sends the customer and supplier (InternalID) on the general level with an indicator
(CheckCustomerIndicator; CheckSupplierIndicator) noting if a check on general level is
requested. The company code (ID) information and relationship, which contains the contact person
(InternalID; ContactPersonInternalID) information to be checked, is available one level down.
The query part contains a processing condition segment (ProcessingConditions). The
ProcessingConditions parameters are as follows:
Parameter Description
TestModeIndicator true when called in test mode
FinalIndicator true when called in final mode;
false indicates that the run is an interim check
SkipWhenOngoingBusinessIndicator true when the first occurrence of the ongoing process
hasn’t lead to no further checks
ValidateNextCheckDateIndicator true to skip further application checks when a future date is
available or determined
CreateApplicationLogIndicator true when the creation of the application log is requested
LogDetailLevelCode Values as listed in listID 11105 in global data type
Catalog (1 = no details; 3 = abortions; 5 = abortions and
errors; 7 = Abortions, errors, and warnings; 9 = all details)
The response part expects to receive a set of EoP results for each level of data. The EoP results are as
follows:
Parameter Description
ApplicationName Name of the application returning the result information
(mandatory)
RuleVariantName Name of the ILM rule variant is used to calculate the dates
PurposeCompletionCode Value as listed in the global data type catalog (1 = n/a (no
business); 2 = No (business is ongoing); 3 = yes (business
is complete and residence time is over)
(mandatory)
StartOfRetentionDate Start of retention date
NextCheckDate Data after which the next EoP check is allowed
A log segment to which messages are returned in case of complications is available on the same level as
the EoP check results.
At the end of the blocking run, a notification is sent to the registered service providers of all blocked data. On
each level (customer and supplier, contact person, company code), an indicator is selected when the data is
blocked.
Each connected (registered) dependent system is allowed to provide SoRT information to the master
system. These interim results must be provided in the same structure as the response of the EoP check;
however, there is no log information.
The master system takes over the role of service provider.
The unblock check service is a query response service. The service is called for customers and supplier to
let dependent systems can confirm that the unblocking of the given customer or supplier and contact person
is allowed.
The query sends the customer or supplier (InternalID) with an indicator (CheckCustomerIndicator;
CheckSupplierIndicator) that specifies whether or not a check on the general level is requested.
Information one level below the company code (ID) and the relationship that contains the contact person
(ID; ContactPersonInternalID) must be checked.
This query contains a processing condition segment (ProcessingConditions) to influence general
behavior.
The ProcessingConditions parameters are as follows:
Parameter Description
TestModeIndicator The value is true when called in test mode
CreateApplicationLogIndicator The value is true when the creation of the application log is
requested
LogDetailLevelCode Values as listed in listID 11105 in global data type catalog
(1 = no details; 3 = abortions; 5 = abortions and
errors; 7 = abortions, errors, and warnings; 9 = all details)
At the end of the unblocking run, a notification is sent to the registered service providers of unblocked data.
The EndOfPurposeUnblockIndicator indicator is provided on each level (customer and supplier,
contact person, company code) and is true when the data is blocked.
The BAdI provides methods that are called during the EoP preparation check or during master data
unblocking. There are separate methods called from the master system or dependent system by the RFC
interface functionality. This allows mapping to the IDs of the connected system as specified in the
IV_MASTER_SYSTEM respectively IV_DEPENDENT_SYSTEM import parameter in the system where the
mapping information is available. The implementation changes the IDs in the changing parameters to the IDs
in the called system. They are changed back to the original IDs of the calling system after execution so that
the processing can continue with the results of the called systems.
Business Add-In (BAdI) CVP_CHG_DOC is called during the execution of the end of purpose check for the
ERP_CUST or ERP_VEND registered application names. During this process ERP_CUST or ERP_VEND
determines the last change date of the customer or supplier master data based on the stored change
documents. The BAdI can be used handle custom-based change documents.
Blocked customer and supplier master data should not be changed and should be not displayed by an
unauthorized user. To simplify the adaption by dependent applications, all internal read function modules are
enhanced. The default behavior of adapted read function modules is as follows:
Return the block indicator if available
Initialize personal and private data
Do not touch technical fields
Most of the adapted read function modules have new import parameter IV_BEHAVIOR to set for a specific
call one of the following behavior modes:
' ' = use global default behavior
1 = block indicator is returned; personal and private data are initialized
2 = (only for single-read API) raise a new exception when the data is blocked and the user is not
authorized
3 = return data as if the data privacy enhancement was not active (like before)
4 = (only for mass-read API) filter blocked data
For some applications there is the need to set a different default behavior without changing the call of each
read function module. You may need to set a global behavior or have a leveled behavior for the application.
To support leveled default and global behavior, static class CVP_CL_READ_API_DEFLT_BEHAVIOR is
available to manipulate the default behavior as a stack. For example, a leveled stack behavior could look like
the following:
Start application
Default behavior is 1
o CVP_CL_READ_API_DEFLT_BEHAVIOR=>PUSH behavior 2
The IV_BEHAVIOR as specified in a call of an adapted read function module has priority compared to the
default behavior.
Import parameters
The new optional import parameter IV_BEHAVIOR type CVP_API_BEHAVIOR is provided.
Export/changing/table parameters
If the corresponding returned data relates to a table where a block indicator is available, the returned data
structures are extended with the block indicator (for example, the returned structure contains KNA1 data but
CVP_XBLCK was not available).
The block indicator in the export or changing parameter of read function modules can be set with the
following t values:
‘’
Not blocked
X
Blocked; data masked or initialized, or special behavior according to optional parameter
CVP_API_BEHAVIOR.
A
Blocked but data is unmasked because current user is allowed to display blocked data.
The Domain CVP_XBLOCK will still be untouched (only values ‘ ‘ and ‘X’ allowed), because the database will
only support these 2 values.
Behavior mode 4 to filter out table entries for blocked data is not supported for single read function modules.
Single read function modules have to support behavior mode 2 to raise a new exception when the data is
blocked and the user is not authorized. If behavior 2 is active, a new exception is raised. If the functionality
already has exceptions, a new exception like KUNNR_BLOCKED is added.
Function modules that check the existence of master data can raise exception errors and/or return error
messages. When the checked functionality deals with blocked data, an error or new exception is returned.
Import parameters
A new optional import parameter IV_BEHAVIOR, type CVP_API_BEHAVIOR is provided. It allows behavior
mode 3. Mode 1 and 2 has the same meaning for this kind of function modules; an exception is raised for
both modes. If the functionality already has already, a new exception like KUNNR_BLOCKED is added.
If the function module does not have exceptions, behavior mode 2 has an adapted behavior.
The default behavior for search function modules is to not return blocked data.
Import parameters
A new optional importing parameter IV_BEHAVIOR, type CVP_API_BEHAVIOR is provided. It allows
behavior mode 3. Mode 1 and 2 has the same meaning for this kind of function module.
No interface changes are done for function modules used in BAPI methods.
The behavior mode is based on from where the function module is called:
If the function module is called from the same system (normal call or destination NONE), it has to
behave like a read function module as described above.
If the function module is called from the outside, the behavior can be set beforehand. In this case,
the behavior mode is used as described above. If no behavior was set, the following is true:
o For a single read or an existence check function module, an error is returned if the data is
blocked. Therefore, behavior mode 2 is used.
o The blocked data is filtered by default for a search function module. Therefore, behavior
mode 4 is used.
No interface changes are done for the adaption of enterprise services. The following behavior has been
implemented:
Read services raise an error for blocked data
Find services will filter results
Other services consider blocked data. For example, an updated or changed data service must not
be able to change blocked data.