cancel
Showing results for 
Search instead for 
Did you mean: 

How to Start the HCM P&F through URL

sreelatha_gullapalli
Active Participant
0 Kudos

Hi All,

Can anybody suggest me how to generate a URL to start a perticular HCM process and form. My requirement is I need to send a mail to employee to submit HCM procee and form through URL.Here the process has been not started already.

Please advice. Thanks in advance.

Thanks & Regards,

Sreelatha Gullapalli.

Accepted Solutions (0)

Answers (2)

Answers (2)

ChrisSolomon
Active Contributor
0 Kudos

HAve you looked at the email option that is in HCM P&F config?

0 Kudos

Hi Sreelatha,

You can use the class cl_hrrcf_wd_services=>construct_wd_url , pass application 'ASP_PROCESS_EXCEUTE' as the application name.

If you want the edit from to open directly without any initail selection screen, concatenate the PROCESS and PERNR_MEM_ID parameter to the URL which can be sent to the employee.

You can check the default method of window ASR_PROCESS_EXECUTE for the flow.

Thank You,

Vijetha.

sreelatha_gullapalli
Active Participant
0 Kudos

Hi Vijetha,

Can you please send me the sample code.

Thanks & Regards,

Sreelatha Gullapalli.

0 Kudos
DATA: l_url   TYPE string.
                       lt_parameters   TYPE tihttpnvp,
                     lv_id(5),
                     l v_pernr TYPE  pernr_d.


** lv_pernr = employee_id.
   move sy-uname to lv_id.


***************Save pernr in abap memory

CALL FUNCTION 'HR_ASR_WDA_SET_EMPLOYEE'
      EXPORTING
        pernr = lv_pernr 
        id       = lv_id.

*****************Construct URL

CALL METHOD cl_hrrcf_wd_services=>construct_wd_url
    EXPORTING
      iv_application_name = 'asr_process_execute'
      it_parameters       = lt_parameters
    RECEIVING
      rv_url              = l_url.

  CONCATENATE l_url '&process=Your process name&sap-wd-clientdebug=X&pernr_mem_id=' lv_id INTO l_url.

Let me know if you need any clarification .If you are in EHP5 there is slight change in code else this should work.

Thank You,

Vijetha.

Former Member
0 Kudos

Hi Vijetha,

This code only works if the user id (SY-UNAME) that generates the URL (saves the PERNR in ABAP memory using Function module HR_ASR_WDA_SET_EMPLOYEE) and the user id that receives this URL are the same. In other words, the user id that generates the URL and the User ID that receives and clicks on the URL need to have the same SY-UNAME. It does not work if the User ID that receives and accesses the URL is different from the User ID that generated the URL.

That is because the default method of window ASR_PROCESS_EXECUTE uses the function module HR_ASR_WDA_GET_EMPLOYEE to decode the PERNR_MEM_ID parameter. When this function module reads this parameter id from memory, it checks whether SY-UNAME that created the Parameter ID matches with SY-UNAME that is accessing this URL. If it does not match it will not pass the PERNR back.

Is there a way to bypass this SY-UNAME check? We have a requirement where the creator and accessor of the URL will be two different Users (bearing different user ids). Appreciate your feedback.

Thanks,

Zubair