Skip to Content
Technical Articles

Easy way to create custom country-specific replication classes in the PTP framework

Introduction

When you try to replicate a person from EC to ECPY, then you may face a lot of difficulties like dealing with Pay Frequencies, storing information in a new subtype of an infotype, manipulating the employee data after the parsing of the XML.

SAP has provided country-specific standard replication classes & BADIs infotype wise, for that purpose. But, they are having less flexibility.

I have come across a similar situation like this, So, I am writing this blog post so that, it can help others to achieve their requirements through custom classes.

Solution

First of all, we should know how the PTP framework works. In the PTP framework, there are two tables namely ‘HRSFEC_CNTRY’, which is an SAP standard table. The table contains country-specific replication classes.

Please check the below screenshot for further reference.

There is another table that SAP has kept for the customersHRSFEC_CNTRY_CC’. The table generally remains blank but this can be used according to our needs.

SAP has created this table ‘HRSFEC_CNTRY_CC’  for the countries for whom there is no replication class created. People can enter the country ISO code, the Replication Type & the name of the custom class to perform replication.

There are two important classes namely: ‘

  1. CL_HRSFEC_EE_MDR_BNDL_PROC
  2. CL_HRSFEC_EE_MDR_MAIN.

Class ‘CL_HRSFEC_EE_MDR_BNDL_PROC’ handles the incoming API response and saves the data in the infotype framework.

The class ‘CL_HRSFEC_EE_MDR_BNDL_PROC’ is called first when we try to replicate an employee through the report ‘RP_HRSFEC_PTP_EE_REPLICATION’(It sends the outgoing API call to Employee Central).

This class identifies the country/molga of the employee & calls the relevant class from HRSFEC_CNTRY/HRSFEC_CNTRY_CC  table.

If no country-specific relevant class is found, the main class ’CL_HRSFEC_EE_MDR_MAIN’ is called for the replication.

If you notice properly, you will be able to see that  ’CL_HRSFEC_EE_MDR_MAIN’  is the superclass of all the country-specific classes.

In the case of the country-specific classes, the name of the classes is suffixed by the country ISO code.

General format: CL_HRSFEC_EE_MDR_MAIN_XX, where the XX is the Country ISO code.

So, for AE, the name will be CL_HRSFEC_EE_MDR_MAIN_AE.

BADI like ‘HRSFEC_B_CE_PROCESS_EMPLOYEE‘ can also be used to incase of custom requirements. All you have to do is to use the enhancement spot ‘HRSFEC_CE_MASTER_DATA_REPL’.

Please check the below screenshot for further details.

Now, if implementing these BADIs is not fulfilling your needs then, you can go with the option of overwriting the SAP standard class with the custom class.

To overwrite the standard class, you need to do the following steps.

  1. Create a custom class using code SE24.
  2. Make ’CL_HRSFEC_EE_MDR_MAIN’ as the superclass of the custom class. As a result of this, all the methods will be inherited in the custom class.
  3. Now, go to the editable mode by Ctrl+F1.
  4. Select the method in which you want to do the change & then click on redefine. As a result of this, you will be able to add codes to the method according to your needs & that will suppress the original code method of the superclass
  5. Activate the class & the methods.
  6. Go to SE16 & provide the table name: ‘HRSFEC_CNTRY_CC’.
  7. Click on Create entries & new entires & provide the name of the newly created custom class.
  8. Save the change in a customizing TR.

That’s it. It’s done. 🙂

Every time you try to replicate the employee the country-specific standard class will be bypassed & the methods of the custom class will be called accordingly.

If you are providing a custom class name in the customer table: ‘HRSFEC_CNTRY_CC’  for a country & if an entry regarding the same country exists in the standard table of SAP: ‘HRSFEC_CNTRY’ with the same replication type, the class in the customer table gets the priority first.

Thanks for reading!

Consider this post as a piece of information only. It is always better to go with the standards. 

If I have missed something, please feel free to add in the comment section so that, this post can be useful to others.

If you find this post useful, please like, share & comment.

Also, please don’t forget to endorse me on LinkedIn. 🙂

4 Comments
You must be Logged on to comment or reply to a post.