Overview
When an employee terminates, a commonly asked question is how their benefit plans will be delimited per the varying benefit plan termination rules.  

SAP delivers the ability to call the benefits pop-up box ‘Possible subsequent activities’.  Based on the radio button selected by the user, they are taken to either Benefits Enrollment (HRBEN0001) or Benefits Termination (HRBEN0014).  

However, many clients find this step to be cumbersome, easily by-passed, and perhaps performed by a group not familiar with benefit plan rules/administration. 

As such, our document describes how to basically automate the delimiting of benefit plans in the background using Dynamic Actions with a call routine to a custom program.  This logic uses SAP delivered function modules to read the plans, determine the proper termination date for each plan, and then delimit each plan, per the configured Benefit Termination rules.

Step 1:  Configure Dynamic Action
Create Dynamic Actions entries to for the call to delimit benefit plans.  In the example below, the call occurs with a K3 Termination action for either Molga 10 or Molga 07:

Step 2: Create Form Routine  
Create a form routine that is called via a dynamic action.  This form routine will export the structure PSPAR to a memory ID and then submit a custom program that will use the memory ID.

  FORM delimit_bplans.  
    EXPORT pspar TO MEMORY ID 'PSPAR'.
    SUBMIT zhcm_delimit_bplans AND RETURN.
  ENDFORM.                    "delimit_bplans

Step 3: Create Custom Program
A custom program is needed to handle the actual delimiting of the benefit records.  The program will import the memory ID exported by the form routine called via a dynamic action in order to get the personnel number and the action date.  

  IMPORT pspar FROM MEMORY ID 'PSPAR'.
  g_begda = pspar-begda - 1.
  g_pernr = pspar-pernr.

From there, the program will use SAP delivered function modules to read the plans, determine the proper termination date for each plan, and then delimit each plan.  The use of standard SAP delivered function modules means that all date calculations and delimiting rules follow benefits configuration and not coded within the program itself.

Each category of benefit plan has its own specific function modules to read and delimit the benefit plans.   Below is a code example of how Health Plans are delimited.  The function modules for the other plan categories are named similarly, replacing ‘HEALTH’ with ‘INSURANCE’, ‘SAVINGS’, etc. 

*-> Health Plans
  CALL FUNCTION 'HR_BEN_READ_HEALTH_PLANS'
    EXPORTING
      pernr         = g_pernr
      barea         = gs_bendata-barea
      begda         = g_begda
      endda         = c_highdt
      logicview     = ' '
      fill_details  = ' '
      reaction      = c_reaction
    TABLES
      ex_heal_plans = gt_health
      error_table   = gt_error.

*-> Loop Health Plans, Determine the Termination Date, Terminate the Plan
  LOOP AT gt_health
       ASSIGNING <health>.
    CLEAR g_termdt.

*-> Determine the Termination Date
    CALL FUNCTION 'HR_BEN_CALC_TERMINATION_DATE'
      EXPORTING
        ee_benefit_data = gs_bendata
        bplan           = <health>-bplan
        datum           = g_begda
        reaction        = c_reaction
      IMPORTING
        term_date       = g_termdt
        subrc           = g_subrc
      TABLES
        error_table     = gt_error.

    IF g_termdt IS NOT INITIAL AND g_termdt < <health>-endda.
      IF test_flag = abap_true.
        records_found = abap_true.
        EXIT.
      ENDIF.

*-> Terminate the Plan  
      CALL FUNCTION 'HR_BEN_TERMINATE_HEALTH_PLAN'
        EXPORTING
          pernr       = g_pernr
          begda       = g_begda
          endda       = c_highdt
          pltyp       = <health>-pltyp
          term_date   = g_termdt
          reaction    = c_reaction
        TABLES
          error_table = gt_error.
    ENDIF.
  ENDLOOP.

Step 4: Unit Test
Unit test to validate the logic is working as expected, then sit back and take the thanks for automating a manual task! 

ABOUT HR FOCAL POINT

  • When time, accuracy and high-quality support are essential, HR Focal Point's precision approach to SAP HCM solutions is the clear choice. 
  • HR Focal Point has been the SAP HCM expert since 2004 with hundreds of years of combined consulting experience its team.
  • HR Focal Point has the SAP HCM experts that will allow you to achieve your goals on time, on point and on budget, thus maximizing your ROI.
  • HR Focal Point offers a flexible engagement model so you only pay for the services you require, when you require them.
  • As an SAP Services Partner, HR Focal Point is known for delivering high-quality solutions, in support of SAP HCM, that are completed accurately and on schedule.
  • HR Focal Point has partnered with SuccessFactors to develop and deliver innovative Cloud solutions, including Employee Central Payroll, for their clients.

FOR MORE INFORMATION

HR Focal Point
Telephone: +1 855.464.4737
Email: solutions@hrfocalpoint.com

Comment