Skip to Content

This document describes how to enhance a Standard WD component and how to refine a HCM Process and display the HCM Form in the browser from MSS.

 

To do this, we need to enhance the Standard WD component as describe in detail below.

 

Enhancement of the WD Component:

The enhancement will be implemented on the following standard SAP Web-dynpro component:

  • HAP_MAIN_DOCUMENT

 

The sub components that will be affected are:

  • STATUS_CHANGE method of Component controller

 

The Web-dynpro component “Z_TRY_COMPLETE” should also be created by copying the standard WD4A component “HRASR00_PROCESS_EXECUTE”, it will discuss in later steps. 

An enhancement to “STATUS_CHANGE” method of the component controller is to be done as follows:

  • Create an enhancement on method “STATUS_CHANGE”. Name the enhancement will be as follows:
    • Enhancement Implementation: Z_TRY_COMPLETE
    • Short Text: Try Complete from enhancement implementation.

 

  TO DO Example to Enhance the View: 

Double Click on Componentcontroller in display mode and click on Enhance button. Refer to the screenshot for example:

 

It will open a popup window; fill Enhancement Implementation as “Z_TRY_COMPLETE” and Short Text as “Trial Complete From enhancement implementation”. Refer to the screenshot below:

 

Create an Overwrite Exit implementation which will contain the logic to display the HCM PROCESS form.

To Do Example to create an Overwrite Exit: 

Open your Componentcontroller in display mode and click on Enhancement button. Refer to the screen shot to enhance. Now, it will open a popup window, select your Enhancement “Z_TRY_COMPLETE” and click on OK button. Refer to the screenshot below:

 

Now click on the method tab of the controller and scroll right. It will display you the Overwrite-exit method for creation. Select the standard method and write here your code which will trigger after the standard method.

 

The logic in the Overwrite Exit implementation (after getting the button ID (L_BUTTON_ID) of Status change button From FPM) above is as follows:

 

Copy the code of Status change method and paste it in Overwrite method and then edit the code. The edited code will then overwrite the standard code and will open an external window as per the requirement.

 

********************
* Try a trick to open an external window for HCM FORM PROCESS,
  if l_button_id eq ‘COMPLETE’.

      data lo_window_manager1 type ref to if_wd_window_manager.
      data lo_api_component1  type ref to if_wd_component.
      data lo_window          type ref to if_wd_window.
      data host TYPE string.
      data port TYPE string.

      data url type string.

      lo_api_component1  = wd_this->wd_get_api( ).
      lo_window_manager1 = lo_api_component1->get_window_manager( ).
 

*Call below method to get host and port
  cl_http_server=>if_http_server~get_location(
     IMPORTING host = host
            port = port ). 

      URL = ‘http://HOST:PORT/sap/bc/webdynpro/sap/Z_TRYCOMPLETE.

****************************************************************

Or You can get the URL by giving the Web dynpro application name as below:

  DATA lv_url TYPE string.

  DATA: lt_parameters TYPE tihttpnvp,
        ls_parameters TYPE ihttpnvp,
        application_name TYPE string.

  application_name =’Z_TRYCOMPLETE’.

  cl_hrrcf_wd_services=>construct_wd_url(
  EXPORTING
  iv_application_name = application_name
  it_parameters = lt_parameters
  RECEIVING
  rv_url = lv_url ).

It’s upon to you to set the URL else static or dynamic.

The parameter URL having the static URL and Parameter lv_url having the dynamic URL for the WD application.

You need to pass only one of the URL. Pass else URL or the LV_URL to the method CREATE_EXTERNAL_WINDOW as below.

****************************************************************

Here I am passing the static URL to the method CREATE_EXTERNAL_WINDOW as below:

* Open External window
   CALL METHOD lo_window_manager1->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL                     = URL
          MODAL                = ABAP_FALSE
          HAS_MENUBAR      = ABAP_TRUE
          IS_RESIZABLE      = ABAP_TRUE
          HAS_SCROLLBARS = ABAP_TRUE
          HAS_STATUSBAR  = ABAP_TRUE
          HAS_TOOLBAR     = ABAP_TRUE
          HAS_LOCATION    = ABAP_TRUE
        RECEIVING
          WINDOW             = lo_window.
      lo_window->open( ).
      ENDIF.

**************** 

Activate your work.

 

 Ø  Note: 

This enhancement code will open an external window for WD4A application Z_TRYCOMPLETE.

  

  • Now Create a Web dynpro program “Z_TRY_COMPLETE” by copying the standard web dynpro Component “HRASR00_PROCESS_EXECUTE”.
  • Activate your work.

Now edit the method SELECT_PROCESSES of the component controller as shown below:

 

Write down the code here to refine the form processes as shown below:

 

 * Refine the Form Process
  DELETE process_starts where process NE ‘ZTEST‘. 

 

 

 

  • Activate your work.
  • Now create a WD4A application for WD4A Component “Z_TRY_COMPLETE” as “Z_TRYCOMPLETE” and pass the Window name as “ASR_PROCESS_EXECUTE” in the Interface View & Plug name as “DEFAULT”.

Also pass the parameters to the WD application as below:

 

Now the enhancement for “Complete” button has been created. When User selects the Complete Radio button and the user click CONTINUE button. Then it will open an external window if the status is unsuccessful.

 

 

Test Web dynpro functionality for the Process: 

Please refer to the below screenshots to test the WD4A functionality on Complete button, when status is unsuccessful:

 

Open the Portal link and go to the Talent Management > Performance Management under MSS as shown below:

 

It will now open the below screen:

 

 

Open one of the documents to complete the In Process status, as below:

 

 

Select the Complete radio button and click on Continue button, it will open an external window for HCM process form as below:

 

You only need to select the employee for the first time. After selecting the employee there is no need to select the employee again.

 

Select employee and then click on Select Process:

 

 

Then the Refined Process will come up for HCM process form display, as shown below:

 

Then click on Edit and Form will appear as below:

 

Now you can Check and Save the Form data.

 

Hopethis bolg will be useful for all of you. 

To report this post you need to login first.

2 Comments

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

  1. Christopher Solomon
    I am trying to follow this. So why exactly are you doing this? Is it that you are trying to trigger HCM P&F process directly from Perf. Mgmt by adding a new status (ie. “complete”)? I am having trouble following it. Also, although I know you are showing an example, I see quite a lot of “hardcode” in there. Lastly, why not just do something similar to ESS/MSS….save the PERNR in memory (or pass) and pass process name so that the pop-up just begins right into the form editting step. Again….maybe a little more explaination will clear up all the other questions too.
    (0) 
    1. Sanket Sethi Post author
      Hi Chris,

      Please find my replies below:

      1) Yes, I am trying to open a HCM Process in an external browser window via MSS by adding a new status “Complete”.

      The Status Complete is the final status for the Appraisal document to complete and update the same in DB.

      Please let me know, where are you exactally facing the problem?

      2) Can you please tell me which section of the blog you are referring as Hardcode.

      If you are referring for getting URL for external window, then I have given there two options to fetch the URL (Static/Dynamic). You can choose any one from it.

      3) We can do the same via ESS by passing the MemoryID as ESS01 and Process name, but in the case of MSS, it will pick up the Manager’s Personnel number and display the manager detail instead of the employees under manager. That’s why I am doing the same by a custom WD component to select the employees and refine the process.

      Hope it will clear your doubts.

      (0) 

Leave a Reply