Skip to Content
Author's profile photo Former Member

How to Add or Use the Customer Fields in ESS Leave Request

This blog explains How to Add or Use the Customer Fields in ESS Leave Request.

Requirement: I came across some discussions how can we add a Customer field to use as a Checkbox or Dropdown list in ESS Leave Request, So let me explain some of this scenarios.

Solution:

You can do with Customization of FPM component

Step 1:

Goto IMG path in Tx: SPRO

Personnel Management-> Employee Self-Service (Web Dynpro ABAP)-> Service Specific Settings -> Working Time -> Leave Requests -> Processing Processes -> Specify Processing Processes for Types of Leave -> Define Absences/Processing Processes -> Choose

Choose the Leave type for which you need the Customer Field, for ex: SMCL (Casual Leave).

Here you can find the ‘Field Selection for Additional Data’ you need to select one of the value from F4 help as shown below.

Leave request Validations- Additional Data_Config1.JPG

Step 2:

Goto Tx: SE80 and select Webdynpro Component as ‘FPM_FORM_UIBB’

Expand Component Configurations and select ‘HRESS_CC_GUIBBF_LEAVREQ’ and Start Configurator

You need to create Enhancement by going to ‘Other functions’ button as shown below.

Give the name as Z_ HRESS_CC_GUIBBF_LEAVREQ and SAVE it.

FPM_FORM_UIBB-GUIBBF Standard.JPG

Goto Z_ HRESS_CC_GUIBBF_LEAVREQ and Start Configurator and Click on Change button as shown

FPM_FORM_UIBB-GUIBBF Zcustom.JPG

Goto Group Additional Data, Elements

FPM_FORM_UIBB-GUIBBF Left panel.JPG

Change the Attributes as shown below

FPM_FORM_UIBB-GUIBBF Customer01.JPG

FPM_FORM_UIBB-GUIBBF Additional Data.JPG

Step 3:

Goto Tx: SE80 and select Webdynpro Component as ‘FPM_OVP_COMPONENT’

Expand Component Configurations and select ‘HRESS_CC_PTARQ_LEAVREQ’ and Start Configurator.

You need to create Enhancement by going to ‘Other functions’ button as shown below.

Give the name as Z_ HRESS_CC_PTARQ_LEAVREQ and SAVE it.

FPM_OVP_COMPONENT-PTARQ CC Zcustom.JPG

Goto Z_ HRESS_CC_PTARQ_LEAVREQ and Start Configurator and Click on Change button as shown

FPM_OVP_COMPONENT-PTARQ CC Zcustom Change.JPG

Goto Page LRF as shown below

FPM_OVP_COMPONENT-PTARQ CC Zcustom Page LRF.JPG

Goto SELECTION_FORM tab and Click on Attributes and change the Configuration Name as ‘Z_ HRESS_CC_GUIBBF_LEAVREQ’

Click on Save, that should look like below

FPM_OVP_COMPONENT-PTARQ CC Zcustom Page LRF GUIBBF.JPG

Step 4:

Expand Webdynpro Applications and select ‘HRESS_A_PTARQ_LEAVREQ_APPL’

Expand ‘HRESS_A_PTARQ_LEAVREQ_APPL’ goto HRESS_AC_PTARQ_LEAVREQ and Start Configurator

You need to create Enhancement by going to ‘Other functions’ button as shown below.

Give the name as Z_ HRESS_AC_PTARQ_LEAVREQ and SAVE it.

Now you will see the new Configuration Component at ‘ Applic. Configurations’ with the above Z name.

FPM_OVP_COMPONENT-PTARQ Standard.JPG

Goto Z_ HRESS_AC_PTARQ_LEAVREQ and Start Configurator and Click on Change button as shown.

FPM_OVP_COMPONENT-PTARQ ZCustom.JPG

Then Change the configuration to Z_HRESS_CC_PTARQ_LEAVREQ and click on save as shown below.

FPM_OVP_COMPONENT-PTARQ ZCustom name last.JPG

Output:

Login into Portal and go to Create Leave request Page you will find the Additional Data Field – Hours as Check box as shown below.

ESS Leave Request Output.JPG

The Additional Data Field will appear only for ‘CASUAL LEAVE’ as you have configured for only SMCL in Step1.

Business Logic/Validations:

The business logic should be written in the BADI PT_ABS_REQ in the method ‘SIMULATE_VIA_BLOP’

Then you can validate by seeing the Value as checked(X) for Customer01 field in the debugging mode as shown below.

ESS Leave Request Output 1.JPG

ESS Leave Request Debugging.JPG

Open IM_ATTABS_TAB by double click, you can see the Customer 01 field Value as ‘X’.

ESS Leave Request Debugging_Output Cust 01.JPG

You can write your own logic for validations further for this field.

Dropdown List

For Getting the field as Dropdown.

In step 2, for example select the Customer02 field and change the display type as ‘Drop Down’ in Attributes Element.

To assign the values for the dropdown list you need to enhance the method MODIFY_DEF_DEFAULT_LABEL (at the end of this method) of class CL_HRESS_PTARQ_LEAVREQ_GUIBBF write your logic, for example as below.

Example code:

data: lt_fixed_values type WDR_CONTEXT_ATTR_VALUE_LIST,       

         ls_fixed_values type WDR_CONTEXT_ATTR_VALUE.

     READ TABLE ct_field_description ASSIGNING <field_descr>

     WITH KEY name = ‘CUSTOMER02’.

     IF sy-subrc IS INITIAL. 

        ls_fixed_values-value = ’01’. 

        ls_fixed_values-text = ‘MALE’. 

        insert ls_fixed_values into table lt_fixed_values.

        <field_descr>-fixed_values = lt_fixed_values.

     ENDIF.

There might be some other ways to get this requirement done but I followed this way. If anything best please let me know.

Hope This blog helps all of you……Any comments or suggestions are most welcome

Regards,

Mohsin.

Assigned Tags

      13 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Thanks Syed for the details, it will help the community.

      Keep it up and keep posting such useful stuff.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks Yugandhar

      Regards,

      Mohsin

      Author's profile photo Former Member
      Former Member

      gud job ...

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks JWALA.

      Regards,

      Mohsin

      Author's profile photo Former Member
      Former Member

      Very helpful. Another one in our consultant toolbox

      Author's profile photo Vinoth Kumar
      Vinoth Kumar

      Thanks Syed for sharing. Have below query.

      Field selection for additional data "SAP_EDU". How is this SAP_EDU is linked or can we give any other values?

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Vinoth,

      SAP_EDU is standard Field Selection provided by SAP where in you can find additional Fields like Customer Fields. if you want to give any other values you can give but you need to create new Field Selection going through SPRO IMG Path 'Define Field Selection'.

      Regards,

      Mohsin.

      Author's profile photo Former Member
      Former Member

      Hi Mohsin,

      Good blog.

      Can you tell if this is EHP5 or EHP6.

      Regards,

      Bharat

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Bharath,

      Thanks, this is EHP6.

      Regards,

      Mohsin.

      Author's profile photo Former Member
      Former Member

      Hi Mohsin,

      Thanks.

      Can you tell me where I can find configuration documents for portal version of ESS/MSS!

      In fact I am a functional consultant. What all in portal do I need to know regarding ESS/MSS functional.

      Regards,

      Bharat

      Author's profile photo Sai Balaji Nukala
      Sai Balaji Nukala

      Hi Moshin,

      The blog was helpful to add the CUSTOMER fields to the standard application.

      I need make one of the customer fields as a DATE field. Could you please let me know how could I achieve this?

      Thanks,

      Balajii

      P.S: I have also started the discussion around the same query at custom field properties in ESS Leave Request

      Author's profile photo Former Member
      Former Member

      Hi Moshin,

      Thanks a lot for your post. It's very helpful. However, Now I am facing a client requirement to implement a link to url in the leave application screen. Is there a way to do that?

      I have taken a look at the customer fields' attributes and it seems that I can only select link to action. If there's no way to implement link to url, is there a way to use link to action to activate a redirection to a website on click?

      Many thanks.

      Isaac

      Author's profile photo NARENDER SINGH
      NARENDER SINGH

      Hi Mohsin,

      We have implemented the leave request application in both ESS and Fiori with an additional field called "Number of Days". In ESS the field is autopopulated with zero but in Fiori its coming blank.

       

      Do you know any customizing spot or BADI where we can set the default value in the custom field. I checked the configuration on SPRO and also BADI PT_ABS_REQ where we add the custom field, but i am not able to default the value.

       

      Regards,

      Narender