Skip to Content

Making ESS Personal Profile read-only dynamically


It’s been a while since I’ve thrown together a blog which hasn’t involved cloud or mobile or just general ranting, but today I threw together some code that was so simple and useful that I just had to share it. 😀

The business problem

The client wanted a solution where accessing their ESS personal profile screens would not lock the employee records, but only during the day or so a month that payroll was processing.

Now, personally, if I had my way there wouldn’t be a need for this as I’d redesign payroll on HANA such that payroll processing was obsolete… but that’s another blog and a dream away.

The solution

A simple switch?

There is a parameter for the WDA personal profile application that can be set to put the application into a read-only state.  Check outSagar Joshi’s blog post Exciting Enhacements to ESS Personal Information Profile in Enhancement pack 6 for an explanation of the various parameters.

So by setting the WD application parameter READ_ONLY_PERSONAL_PROFILE equal to ‘X‘ the application won’t cause a lock. 🙂

Unfortunately a little testing found that this wasn’t actually the case 🙁


A search on Service Market Place however found:

oss note.PNG

After implementing the note, the promised functionality did work 🙂

Making it dynamic

So I could now switch the functionality to read only by using an application parameter, the question was how to do this dynamically?

Sometime the simplest ways are best 🙂

I created a simple freestyle FPM UIBB:

freestyle uibb.PNG

and in the WDDOINIT method added some very simple code:

METHOD wddoinit .
  DATA: lo_fpm TYPE REF TO if_fpm,
        lv_dummy TYPE string.
  IF wd_assist->is_pay_processing( ) = abap_true.
    lo_fpm = cl_fpm_factory=>get_instance( ).
        iv_value = abap_true
    MESSAGE e000(zm_hr_ess) INTO lv_dummy.
        iv_msgid     =  'ZM_HR_ESS'   " Message indentification (Class)
        iv_msgno     =  '000'   " Message number
        io_component =  wd_this->wd_get_api( ) 
        iv_severity  = if_fpm_message_manager=>gc_severity_warning  ).  " Report the severity of the message

This code called the assistance class to figure out if the payroll was processing. The logic of that will quite possibly vary from site to site so I won’t go into too much detail (also because I don’t think my employee object is perfectly implemented either (should have built an interface and a factory method, but never mind!)

METHOD is_pay_processing.
  DATA: lo_pernr TYPE REF TO zcl_hr_employee.
      CREATE OBJECT lo_pernr
          iv_pernr = cl_hress_employee_services=>get_instance( )->get_pernr( ).
      rv_payroll_processing = lo_pernr->is_pay_processing( ).
    CATCH cx_hress.
* caught and handled by main ESS page too

Note the use of the cl_hress_employee_services method – very useful!

Adding it together

Now I added this UIBB into the INITIAL_SCREEN of my ESS config.

component config.PNG

It’s important that it’s the first UIBB in the page – as this determines that it gets called first!

To wrap up


So I met the customer’s requirement to have a dynamic read-only ESS screen with very little code indeed, and even better, no modifications or enhancements! 🙂

I hope this post is of use to you, it was such a simple 😎 solution that it really needed to be shared. Hopefully it might save you buying a really expensive modification solution from a third party! 😀 Just throw a little code together and you should have a solution that can work in less than a day.

All the usual disclaimers, as in, even if the pictures above make it very clear that the solution and code provided work, they might not, they might even make little green men start running out of your coffee machine – you implement at your own risk! No opinions expressed here should be taken as representing the company I work for, the client I implemented this for or anything other than my ramblings. Nothing here or should be relied on for making any decisions whatsoever.  HTTP 418.

You must be Logged on to comment or reply to a post.
  • Hi Chris,

    Nice trick....

    Just another opinion

    I believe there could be a simpler solution to problem by implementing BAdI HRESS_MENU

    You could just evaluate if Payroll is on/off during certain days and pass additional parameter READ_ONLY_PERSONAL_PROFILE = 'X' Dynamically to application.

    On the Menu you can also display text that due to paryoll the access is set to read only.

    Thanks, Sagar

    • Thanks Sagar,

      Of course the BAdI only works if you are using the WDA LPD menu or NWBC menus (I believe) and requires you to redefine the filter values/re-implement the NWBC BAdI (as no-one would be using the standard SAP roles 😉 ). The BAdI also suffers from the same issues as using a proxy class did in WDJ ESS - in that the evaluation of the parameter/configuration to be chosen happens when the menu is loaded and not when the user executes the application. 🙁

      But being able to tell people on the LPD/NWBC menu that the pay area is processing (at least when the menu was first opened) is a very nice touch! 🙂

      Thanks for updating with that option! I have to admit that I hadn't really thought of using the NWBC_RUNTIME_EXTENSION_ROLE enhancement spot at all. (or the related call to the HRESS_MENU BAdI).



      • Hi Chris

        Thanks for the great blog.  I was able to do this following your procedure. From the personal profile overview, I see the pencil(edit) are now turned to Details and this is awesome as users could view the details as well read only. But when I come back to the Personal Profile overview from any of the details page, I lose the message warning message. Am I missing something?

        Thanks, Raj

    • I've just tried doing this (to control whether an employee has access to maintain their talent profile or not depending on whether they are part of a talent group or not) - and found that in NWBC the BAdI is only called if the navigation tree cache doesn't already exist. So in the case of HTML NWBC the BAdI always fires, but in the case of standard NWBC, the cache means it does not fire every access. So if the condition that access is being granted/denied is transient, then I'd suggest the use of this BAdI to control NWBC menus isn't the best 🙁

      Fortunately being part of a talent group isn't that transient, so should be OK. but will be a bugger for the testing team 😉

  • Hi,

    I have done the following

    setting the WD application parameter READ_ONLY_PERSONAL_PROFILE equal to 'X' . And this is working perfectly in Development. when I moved the TR to Quality, it is not working still getting PERNR is locked.

    Why happenening like this..??

    Do I want to implement note 1769653...??



  • Hi Chris,

    Thanks for the great blog. I am implement your code already, but still did not work for me. Is there anything that i must check to make your guidance worked well. Thanks.

    Best Regards.