cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Leave Application for Certain emplopyee in ESS

Former Member
0 Kudos

Hello Experts,

Hope you all are doing well. There is an issue where i need to hide SAP standard leave application for some group of employee and also show the application for some group of employee. To differentaite that i checked LPD_CUST. but there is not any option to fix that.

Can you people please share some advise, how to fix the issue.

The visibility for the leave application should be determine by Employee Personal area and subarea.

Regards,

Priti

Accepted Solutions (1)

Accepted Solutions (1)

former_member182426
Active Contributor
0 Kudos

you can implement the enhancement HRESS_COUNTRY_FILTER of BADI HRESS_MENU.

In this you see the method IF_EX_HRESS_MENU~MODIFY_APPLICATION_ATTRIBUTES

You can write logic based on PA , PSA and change that application attribute for parameter CV_ISVISIBLE

Former Member
0 Kudos

Thanks Shanka.. You always comes to the rescue.

Without coding is there any chance to achieve this.. I mean changing feature etc..

Can you share some light on this.

Former Member
0 Kudos

Also shankar if there is any code snippet please share it.

Thanks!!

former_member182426
Active Contributor
0 Kudos

There is no standard Feature to controll dynamically with out enhancement to standard.

In standard based on parameter COUNTRYGROUPING maintenance in Target App.Parameter field in lpd application we can controll. But at PA/PSA level there is no standard for this we need to build logic in this BADI.

Follow below simple snippet in your badi enhancement.


IF <check application name> EQ 'Leave Application'.

DATA: ls_personal_data type person.

CALL FUNCTION 'HR_GET_EMPLOYEE_DATA'

  EXPORTING

    PERSON_ID                   = lv_pernr

  IMPORTING

    PERSONAL_DATA               = ls_personal_data

  EXCEPTIONS

    PERSON_NOT_FOUND            = 1

    NO_ACTIVE_INTEGRATION       = 2

    OTHERS                      = 3

           .

IF SY-SUBRC EQ 0.

**Check personal area and make invisible.

IF ls_personal_data-werks EQ 'PM'.

MOVE '' TO CV_ISVISIBLE.

ENDIF.

ENDIF.

ENDIF.

Answers (1)

Answers (1)

Former Member
0 Kudos

Coding is needed for this, as Shankar suggested you might have to write code in BADI HRESS_MENU.

You can hard code ur condition check or better option may be you can create a custom table and there u can maintain the list of molgas/comany codes/PA/PSA etc for which the app has to be  be hidden. With in the badi, u can read this table and show as per the entries. This way you will be more flexible when your transport moves to dev/QA/prod etc

sample code for hiding:

data: lr_emp_service      type ref to cl_hress_employee_services,

      lv_molga            type molga,

      lv_pernr            type pernr_d.

     

       lr_emp_service = cl_hress_employee_services=>get_instance( ).

       lv_molga = lr_emp_service->get_molga( ).

       lv_pernr = lr_emp_service->get_pernr( ).

      

       if iv_application_alias eq '<Alias of Leave request>'.

      

       "check your conditions here

       "set

       CV_ISVISIBLE = abap_false. "for hiding the link

       "for disabling you have to set CV_ISDISABLED = abap_true.

      

      

       endif.

Former Member
0 Kudos

i think we can disable any standard application by using above BADI as given by shankar .....