While using HCM PF, there can be cases where the process has to be started programatically OR the approvals of the forms have to be done from other applications.
If we take scenarios where a developed HCM Form has to be approved through other applications, then the best way is to
->Invoke the HCM PF framework
->Get the Form Data(Fields and values)
->Make any changes to the field values
->Approve OR Send Back OR any other event.
For this, we can use the Standard FM 'HRASR_PROCESS_EXECUTE'.
This FM would call the HCM PF framework by taking the Work item ID and Event as Inputs. The documentation provided for the FM explains it all clearly.
However, if we take above mentioned scenarios for approvals or starting forms programatcailly, the Initialize event has to be triggered for this FM first.
Once this event is triggered by passing INITIALIZE as event and Work Item ID to the FM, the form fields and values would be returned to an Internal table.
DATA: lt_form_val TYPE hrasr_special_param_tab,
lv_ok TYPE char1,
lt_messages TYPE hrasr_return_tab,
lv_pr_refnum TYPE asr_reference_number,
lv_confirmation TYPE STRING.
CALL FUNCTION 'HRASR_PROCESS_EXECUTE'
EXPORTING
iv_wi_id = lv_wi_id
iv_event = 'INITIALIZE'
IMPORTING
ev_is_ok = lv_ok
et_messages = lt_messages
ev_process_ref_number = lv_pr_refnum
ev_confirmation_text = lv_confirmation
CHANGING
ct_form_field_values = lt_form_values.
ev_is_ok shows if the processing is Success or not. If it is set as X, then the processing is successful.
et_messages would have any messages returned from the PF framework.
This FM call would invoke the HCM PF framework and the internal table lt_form_values will be returned having all the fields and values of the form.
If any changes are to be made to the field values of the from, then we can make the changes on this internal table and proceed further.
If the form has to be Approved, then pass the event as 'SEND' to the FM along with the Work Item ID.
This would again call the PF framework to approve the form. If any workflow is associated to the form, the Workflow would be completed with no manual intervention( through coding to complete the Workflow).
Task 33700021 is used for processing the Form in the Workflow.
The FM call with SEND as event would complete this step and proceed further.
The &PROCSTATE& would also be automatically set to Processed or BACK TO depending on the event that is passed to the FM.
The FM documention contains information on all event that can be passed.
One point to make sure is that to use any of the events like SEND, BACKTO etc, the INITIALIZE even is to be used first.
This FM also can be useful if we have to duplicate the form with values like say create two records with same values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |