Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Andi_M
Product and Topic Expert
Product and Topic Expert
2,346

Introduction

You are in the preparation phase to convert your system to SAP S/4HANA. During the execution of the Readiness Check, you encounter the following Simplification Item.

00-simplification Item.jpg

2340095 - S4TWL - Conversion of Employees to Business Partners

One of the initial steps is the conversion of customers and vendors into Business Partners, specifically converting employee vendors/customers to Business Partners.

This blog post outlines a method for establishing number logic during CVI conversion to achieve HCM-BP-Integration number logic in SAP S/4HANA for Employment Business Partners.

For detailed information on the new HCM-BP-Integration data model in SAP S/4HANA, please refer to this blog post.
New Employee Business Partner Data Model in SAP S/4HANA 2020 On-Premise

For detailed description of setting up HCM-BP-Integration at SAP S/4HANA you can follow instructions at

SAP S/4HANA Cookbook - Employee Business Partner Integration as of SAP S/4HANA 2020 with new data mo...

Target audience: Functional expert, Development expert

Version: SAP ECC 6.0 or higher

 

Prerequisites

When implementing the new model in HCM-BP-Integration with SAP S/4HANA, there is an option to integrate employee vendors and customers into the HCM-BP-Integration model.

Unlike ECC, in SAP S/4HANA, vendor master data can be automatically created based on the provided employment data.

In ECC, the transaction PRAA can be used to generate a vendor based on the given personnel number, with the assignment between vendor and personnel number occurring at the company code level.

In SAP S/4HANA, a Business Partner is initially created using the provided employment data. Depending on the customizing settings, the Business Partner can be extended with a vendor role and associated vendor master data.

One possible option for Business Partner numbering, based on employment data, is to use a combination of the personnel number and an alphanumeric prefix, as shown in this example:

Personnel number: 22345
Business Partner number: PN00022345

01-target model.jpg

 

Target

To ensure consistent numbering logic for both new and existing employment vendors, it is necessary to consider the numbering logic at the CVI conversion stage. Presently, there is no standard solution for creating a Business Partner from a vendor while taking into account the personnel number at the vendor company code segment.

In this blog, I aim to outline a method involving customization and a minor BAdI implementation to achieve a Business Partner number, such as PN00022345, based on the personnel number.

02-target CVI.jpg

During the CVI conversion, a Business Partner designated as PN00022345 should be established from vendor 114, with the personnel number assignment of 22345.

 

Initial Situation

Employment data

03-display employment.jpg

At this screenshot you can see employment assignment to company code DE01.

Vendor data

04-display vendor.jpg

At this screenshot you can see personnel number assignment of vendor 114 at company code DE01.

 

Configuration

Given Account Group REIS is assigned to Number Range 01 at vendor Account Group setup.

Account Group

REIS

Number Range

01   0000000001 - 0000099999

To achieve the goal of Business Partner numbering based on the Personnel Number of the vendor, we will utilize a "backdoor" in CVI customizing. We will implement external numbering for the Business Partner, which necessitates identical numbering for both the vendor and Business Partner due to CVI customizing constraints.

The "backdoor" involves initially defining the target Business Partner number range to match the vendor number logic precisely. With this configuration, we can proceed with CVI customizing using the same numbering logic. Subsequently, we can adjust the target Business Partner number range to our specific requirements.

Create Business Partner Grouping and Number Range

IMG: Cross-Application Components->SAP Business Partner->Business Partner->Basic Settings->Number Ranges and Groupings->Define Number Ranges

05-BP number range.jpg

IMG: Cross-Application Components->SAP Business Partner->Business Partner->Basic Settings->Number Ranges and Groupings->Define Groupings and Assign Number Ranges

06-BP Grouping.jpg

Note: Business Partner Grouping typically uses four characters. However, for future HCM-BP Integration setups, only two characters are utilized due to character limitations in the SAP S/4HANA HCM-BP Integration scenario.

CVI Mapping

IMG: Cross-Application Components->Master Data Synchronization->Customer/Vendor Integration->Business Partner Settings->Settings for Vendor Integration->Field Assignment for Vendor Integration->Assign Keys->Define Number Assignment for Direction Vendor to BP

 

07-CVI Mapping.jpg

IMG: Cross-Application Components->Master Data Synchronization->Customer/Vendor Integration->Business Partner Settings->Settings for Vendor Integration->Define BP Role for Direction Vendor to BP

07-CVI Mapping_role.jpg

Change Business Partner number range "Backdoor"

IMG: Cross-Application Components->SAP Business Partner->Business Partner->Basic Settings->Number Ranges and Groupings->Define Number Ranges

08-BP number range.jpg

At this stage of configuration, we have established CVI Mapping such that, for example, vendor 114 corresponds to a Business Partner number range from PN00000000 to PN99999999 with identical numbering. This will inevitably lead to a synchronization error, but we will address this number mapping with a BAdI implementation in the subsequent step.

 

BAdI Implementation

Create your own implementation for BAdI CVI_CUSTOM_MAPPER with method IF_EX_CVI_CUSTOM_MAPPER~MAP_VENDOR_TO_BP

You can find an example in the following coding sample:

 

 

  METHOD if_ex_cvi_custom_mapper~map_vendor_to_bp.
    DATA: lv_pernr   TYPE lfb1-pernr,
          lv_partner TYPE bu_partner,
          ls_company TYPE vmds_ei_company.

    CHECK i_vendor-central_data-central-data-ktokk = 'REIS'.

    READ TABLE i_vendor-company_data-company INTO ls_company INDEX 1.

    CONCATENATE 'PN' ls_company-data-pernr INTO lv_partner.
    MOVE lv_partner TO c_partner-header-object_instance-bpartner.
  ENDMETHOD.

 

 

 

Convert vendor with MDS_LOAD_COCKPIT

Execute the MDS_LOAD_COCKPIT transaction, ensuring that the synchronization direction from Vendor to Business Partner is enabled. Following the conversion, Business Partners will be generated according to your specified numbering logic.

 

Check result

To check conversion result with transaction CVI_LINKS.

09-cvi_links.jpg

To check a Business Partner, directly run transaction BP with number PN00022345.

10-bp.jpg

To check assigned vendor to Business Partner choose role FLVN00 and navigate to tab "Vendor: General Data".

11-BP.jpgYou can check assigned personnel number by navigating to Company Code data.

12-BP.jpg13-BP.jpg

 

Conclusion

You have now implemented your own numbering logic for the initial Business Partner conversion. This logic will be applicable for all new vendors of Account Group REIS where a personnel number is provided. Ensure that the personnel number is set as a mandatory field for Account Group REIS to prevent synchronization issues. Alternatively, you could implement an error message in your BAdI implementation if the field LFB1-PERNR is not populated.