Dear Experts,
I need to start a HCM process frmo a ABAP program.
The case:
-
The program Z_REPORT starts a Workflow which (starts a HCM process and form) generates a prefilled PDF-FORM in the UWL.
My scenario:
-
Z_REPORT --> Start Workflow (the WF containers have recieved vaules from the Z_REPORT) --> Starts a HCM process --> Generates a PDF-Work Item in UWL
The Process A contains the forms Form_A and Form_B. I am not able to use Backend services and field passing in HRASR_DT, due to the customer`s requirements.
The Workflow:
The Workflow has the following steps:
1. Start workflow (from triggering events)
2. Export from Workflow container --> Form container
3. Start a process and Display FORM_A
The challenge:
-
I need to trigger the workflow from Z_REPORT .
I have managed to start a workflow from Z_REPORT by using the FM "SAP_WAPI_START_WORKFLOW". In this case, the WF works fine with normal WF steps, however, it fails when processing STEPS that has anything to do with PROCESS A and FORMS(incl. my workflow step 2).
I have been using FM " SAP_WAPI_CREATE_EVENT " , but I don`t seem to manage to start the event CL_HRASR00_WF_PROCESS_OBJECT.
Code:
lv_objkey = ''.
lv_objtype = 'CL_HRASR00_WF_PROCESS_OBJECT'. " type
lv_event = 'TRIGGERED'. " event name
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = lv_objtype
object_key = lv_objkey
event = lv_event
commit_work = 'X'
IMPORTING
return_code = return_code
event_id = event_id
TABLES
input_container = lt_cont
.
I don`t get any error messages, but I can`t see any new events started in t-code SWEL.
Question 1:
-
How do I start a HCM-process from a ABAP-program?
Question 2:
-
"Do I need to use the event CL_HRASR00_WF_PROCESS_OBJECT in order to start my WF and being able to generate PDF-FORM Work item in UWL?"
Question 3:
-
"How do I start the event CL_HRASR00_WF_PROCESS_OBJECT from the report?
Thanks in advance.
Best regards,
Tor